Skip to main content
Perplexity
current

Search documentation

Type to search this documentation.

On this pageOverview

Overview

Perplexity API Platform - build with the Router, Agent, Search, and Embeddings APIs. Real-time, web-wide research and Q&A capabilities for your products.

Perplexity API PlatformPerplexity API Platform

Power your products with unparalleled real-time, web-wide research and Q&A capabilities.

Quickstart Guide

Getting started is simple and fast—make your first API call within minutes.

Get Started

Get Your API Key

Get Started

Python
from perplexity import Perplexity

client = Perplexity()

search = client.search.create(
    query=[
      "What is Comet Browser?",
      "Perplexity AI",
      "Perplexity Changelog"
    ]
)

for result in search.results:
    print(f"{result.title}: {result.url}")
Typescript
import Perplexity from '@perplexity-ai/perplexity_ai';

const client = new Perplexity();

const search = await client.search.create({
  query: [
    "What is Comet Browser?",
    "Perplexity AI",
    "Perplexity Changelog"
  ]
});

search.results.forEach(result => {
  console.log(`${result.title}: ${result.url}`);
});
cURL
curl https://api.perplexity.ai/search \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": [
      "What is Comet Browser?",
      "Perplexity AI",
      "Perplexity Changelog"
    ]
  }' | jq
Python
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.5",
    input="What are the major AI developments and announcements from today across the tech industry?"
)

print(response.output_text)
Typescript
import Perplexity from '@perplexity-ai/perplexity_ai';

const client = new Perplexity();

const response = await client.responses.create({
  model: 'openai/gpt-5.6-terra',
  input: 'What are the major AI developments and announcements from today across the tech industry?'
});

console.log(response.output_text);
cURL
curl https://api.perplexity.ai/v1/agent \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.5",
    "input": "What are the major AI developments and announcements from today across the tech industry?"
  }' | jq
Python
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.5",
    input="What are the most promising machine learning breakthroughs in computer vision and multimodal AI from recent arXiv publications?",
    tools=[
        {
            "type": "web_search",
            "filters": {
                "search_domain_filter": ["arxiv.org"],
                "search_recency_filter": "month"
            }
        }
    ],
    instructions="You have access to a web_search tool. Use it for current information."
)

print(response.output_text)
Typescript
import Perplexity from '@perplexity-ai/perplexity_ai';

const client = new Perplexity();

const response = await client.responses.create({
  model: 'openai/gpt-5.6-terra',
  input: 'What are the most promising machine learning breakthroughs in computer vision and multimodal AI from recent arXiv publications?',
  tools: [
    {
      type: 'web_search',
      filters: {
        search_domain_filter: ['arxiv.org'],
        search_recency_filter: 'month'
      }
    }
  ],
  instructions: 'You have access to a web_search tool. Use it for current information.'
});

console.log(response.output_text);
cURL
curl https://api.perplexity.ai/v1/agent \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.5",
    "input": "What are the most promising machine learning breakthroughs in computer vision and multimodal AI from recent arXiv publications?",
    "tools": [
      {
        "type": "web_search",
        "filters": {
          "search_domain_filter": ["arxiv.org"],
          "search_recency_filter": "month"
        }
      }
    ],
    "instructions": "You have access to a web_search tool. Use it for current information."
  }' | jq
Python
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.5",
    input="What were the largest AI startup funding rounds announced this week?",
    tools=[{"type": "web_search"}],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "funding_rounds",
            "schema": {
                "type": "object",
                "properties": {
                    "deals": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "company": {"type": "string"},
                                "amount": {"type": "string"},
                                "round": {"type": "string"},
                                "lead_investors": {
                                    "type": "array",
                                    "items": {"type": "string"}
                                }
                            },
                            "required": ["company", "amount", "round", "lead_investors"]
                        }
                    }
                },
                "required": ["deals"]
            }
        }
    }
)

print(response.output_text)
Typescript
import Perplexity from '@perplexity-ai/perplexity_ai';

const client = new Perplexity();

const response = await client.responses.create({
  model: 'openai/gpt-5.6-terra',
  input: 'What were the largest AI startup funding rounds announced this week?',
  tools: [{ type: 'web_search' }],
  response_format: {
    type: 'json_schema',
    json_schema: {
      name: 'funding_rounds',
      schema: {
        type: 'object',
        properties: {
          deals: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                company: { type: 'string' },
                amount: { type: 'string' },
                round: { type: 'string' },
                lead_investors: {
                  type: 'array',
                  items: { type: 'string' }
                }
              },
              required: ['company', 'amount', 'round', 'lead_investors']
            }
          }
        },
        required: ['deals']
      }
    }
  }
});

console.log(response.output_text);
cURL
curl https://api.perplexity.ai/v1/agent \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.5",
    "input": "What were the largest AI startup funding rounds announced this week?",
    "tools": [{"type": "web_search"}],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "funding_rounds",
        "schema": {
          "type": "object",
          "properties": {
            "deals": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "company": {"type": "string"},
                  "amount": {"type": "string"},
                  "round": {"type": "string"},
                  "lead_investors": {
                    "type": "array",
                    "items": {"type": "string"}
                  }
                },
                "required": ["company", "amount", "round", "lead_investors"]
              }
            }
          },
          "required": ["deals"]
        }
      }
    }
  }' | jq
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu