Perplexity
Query Perplexity via Wire — the answer with inline citations and web sources
POST
https://api.anakin.io/v1/wire/taskPerplexity is an answer engine: it returns the answer with inline [n] citation markers and the full list of web sources behind them. Run it with the perplexity action on POST /v1/wire/task.
Catalog: perplexity · action_id: perplexity · Credits: 2 / call · Auth: none
Request Body
{
"action_id": "perplexity",
"params": {
"query": "What is the capital of France?",
"focus": "internet",
"country": "us"
}
}| Parameter | Type | Description |
|---|---|---|
action_id required | string | Set to perplexity |
params.query required | string | The question/prompt to ask Perplexity |
params.focus | string | internet (web search) or writing (no web). Default internet |
params.country | string | Residential exit country (2-letter ISO). Default us |
Code Examples
curl -X POST https://api.anakin.io/v1/wire/task \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"action_id": "perplexity",
"params": { "query": "best CRM for small teams", "focus": "internet", "country": "us" }
}'import requests
res = requests.post(
'https://api.anakin.io/v1/wire/task',
headers={'X-API-Key': 'your_api_key'},
json={
'action_id': 'perplexity',
'params': {'query': 'best CRM for small teams', 'focus': 'internet', 'country': 'us'},
},
)
job_id = res.json()['job_id']const res = await fetch('https://api.anakin.io/v1/wire/task', {
method: 'POST',
headers: { 'X-API-Key': 'your_api_key', 'Content-Type': 'application/json' },
body: JSON.stringify({
action_id: 'perplexity',
params: { query: 'best CRM for small teams', focus: 'internet', country: 'us' },
}),
});
const { job_id } = await res.json();Response
202 Accepted{
"status": "processing",
"job_id": "c2916a5d-d4e8-49b4-bf24-f1e85321845a",
"poll_url": "/v1/wire/jobs/c2916a5d-d4e8-49b4-bf24-f1e85321845a"
}Poll GET /v1/wire/jobs/{id} until status: "completed":
{
"status": "completed",
"credits_used": 2,
"execution_ms": 6061,
"data": {
"status": "ok",
"data": {
"query": "best CRM for small teams",
"answer_text": "The strongest options are … [1][4]",
"citations": [
{ "title": "…", "url": "https://…", "position": 1, "snippet": "…", "domain": "…", "image": "https://…" }
],
"search_sources": [],
"web_search_triggered": true,
"related_queries": ["best CRM for startups"],
"reformulated_query": "top CRM software for small teams",
"thread_title": "Best CRMs for small teams",
"media": [], "shopping": [], "model": "…"
},
"meta": { "action_id": "perplexity", "catalog_slug": "perplexity", "envelope_version": "v1" }
}
}| Field | Type | Description |
|---|---|---|
data.data.answer_text | string | The answer, with inline [n] markers mapping to citations[n-1].position |
data.data.citations | array | { title, url, position, snippet, domain, image } — the web sources cited |
data.data.search_sources | array | All sources considered (superset of citations) |
data.data.related_queries | string[] | Follow-up queries Perplexity suggests |
data.data.reformulated_query | string | How Perplexity rewrote your query — a useful GEO signal |
data.data.web_search_triggered | boolean | Whether live web search ran |
focus: "writing"skips web search — the answer comes from the model with no citations. Billed only on success.