Perplexity Search API
Perplexity provides high-quality conversational search. It excels at answering complex questions with citations from diverse web sources.
Endpoint
POST https://llm.siraya.pro/v1/perplexity
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Use perplexity-search. |
query |
string | Yes | The search query or question. |
max_results |
integer | No | Maximum number of results to return (default: 10, range: 1-20). |
search_recency_filter |
string | No | hour, day, week, month, or year. |
Example Request
import requests
url = "https://llm.siraya.pro/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", [])
Response Body
Returns a list of structured results, including titles, URLs, and snippets.