Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.scrapellm.com/llms.txt

Use this file to discover all available pages before exploring further.

The Perplexity endpoint sends any prompt to Perplexity AI and returns the response as structured JSON — including numbered inline citations, the web sources behind them with full text snippets, and Perplexity’s suggested follow-up questions.
Web search on by defaultWeb search is enabled for all requests. Set web_search=false for a faster answer without live citations.

Overview

Perplexity is a research-first AI that cites every claim with a numbered source. Use this endpoint to monitor brand mentions in AI search, track which sources Perplexity trusts for your industry, and extract follow-up questions as content and keyword ideas.

Unique features

  • Numbered citations: Every source is numbered and mapped to inline [1][2] references in the response text
  • Source snippets: Full text excerpts from each cited page — not just the URL
  • Related questions: Perplexity’s suggested follow-up questions for further research

Request parameters

prompt
string
required
The prompt to send to Perplexity. Maximum 4,000 characters.
country
string
default:"US"
ISO 3166-1 alpha-2 country code for localised responses.
Enable live web search. Set to false for a faster response without citations.
bypass_cache
boolean
default:"false"
Skip the response cache and always fetch a fresh result.
timeout
float
default:"300"
Maximum seconds to wait for Perplexity to respond (10–600).
3 credits per request

Example request

curl "https://api.scrapellm.com/scrapers/perplexity" \
  -H "X-API-Key: YOUR_API_KEY" \
  -G \
  --data-urlencode "prompt=What brands do marketers recommend for email automation?" \
  --data-urlencode "country=US"

Response schema

Includes common response fields plus:
FieldTypeDescription
resultstringPlain-text response. Inline citation markers like [1] map to positions in sources[]
result_markdownstringMarkdown-formatted response
sourcesarrayCited web sources — each has title, url, and snippet
sources[].titlestringArticle title of the cited page
sources[].urlstringURL of the cited source
sources[].snippetstringText excerpt from the source page
related_questionsarrayPerplexity’s suggested follow-up questions
credits_usedintegerCredits consumed — always 3 for Perplexity
elapsed_msfloatEnd-to-end request duration in milliseconds
cachedbooleantrue if served from cache

Common questions

How do inline citation numbers map to sources?

The result field contains inline markers like [1][2]. The number is the 1-based position of the source in the sources[] array — [1] refers to sources[0], [2] to sources[1], and so on.

When should I set web_search=false?

When you need a fast, low-latency answer and don’t need cited sources — for example, generating summaries or using Perplexity as a general-purpose language model. Responses without web search are typically 2–4× faster.

How is Perplexity different from ChatGPT for citation monitoring?

Perplexity returns richer source metadata (full text snippets per source) and uses numbered inline citations that map directly to positions in the response text. ChatGPT returns links[] which are sources mentioned but not always position-mapped.