Perplexity Search API
Perplexity provides high-quality conversational search. It excels at answering complex questions with citations from diverse web sources.
POST
https://llm.siraya.ai/v1/perplexity
Body
model
string
Required
Use `perplexity-search`.
query
string
Required
The search query or question.
max_results
integer
Maximum number of results to return (default: 10, range: 1-20).
search_recency_filter
string
`hour`, `day`, `week`, `month`, or `year`.
import requests
url = "https://llm.siraya.ai/v1/perplexity"
headers = {"Authorization": "Bearer <API_KEY>"}
data = {
"model": "perplexity-search",
"query": "What is the status of the James Webb Space Telescope?"
}
response = requests.post(url, headers=headers, json=data)
results = response.json().get("results", [])
Example Response