Send a prompt to the real perplexity.ai — not an LLM API — and get the answer back as structured JSON, including every web source it cited and where in the answer that source is used. Anonymous: no Perplexity account, no Perplexity API key.
No credit card required · PAYG credits never expire
# Ask the real perplexity.ai and read the sources
import scrapebadger
client = scrapebadger.ScrapeBadger("sb_live_...")
answer = client.perplexity.ask(
prompt="Best web scraping APIs in 2026?",
focus="web"
){
"answer": "Several APIs stand out in 2026...",
"web_search_triggered": true,
"citation_count": 8,
"citations": [{
"url": "https://example.com/scraping-apis",
"title": "Web Scraping APIs Compared",
"domain": "example.com",
"ref_index": 1,
"start_index": 128, "end_index": 214,
"matched_text": "APIs that handle anti-bot..."
}],
"search_queries": ["best web scraping apis 2026"],
"related_questions": ["Which API is cheapest?"],
"source_domains": ["example.com", "..."],
"focus": "web",
"latency_ms": 14602
}Structured JSON responses with normalized data models. No HTML parsing. No proxy management. No Perplexity account.
/v1/perplexity/ask/v1/perplexity/brand-visibility/v1/perplexity/modelsMost Perplexity scrapers hand back text and, at best, a list of URLs. ScrapeBadger returns the evidence behind the answer.
Answers come from the consumer product with live web retrieval, so you see what a real user sees — including the sources Perplexity surfaced. No Perplexity account, no Perplexity API key, no per-token bill.
Every citation carries start_index, end_index, and matched_text — the exact substring of the answer that source supports, resolved from Perplexity’s inline [n] markers. Everyone else hands you a bare URL list.
search_results returns everything Perplexity retrieved with a cited flag on each entry, next to citations which returns only what the answer actually referenced. You can see what it read and rejected.
search_queries returns the actual sub-queries Perplexity issued to its search backend for your prompt. No surveyed competitor — Oxylabs, Bright Data, SerpApi, DataForSEO, or any Apify actor — exposes it.
One call returns mention count, first position, share of voice against named competitors, whether your domain was cited, and its citation rank. AEO/GEO platforms sell this as a $29–499/mo subscription.
Credits are only deducted for successful responses. Blocked, rate-limited, and upstream errors are never billed. PAYG credits never expire.
Same job, different depth. Prices are per 1,000 requests as published by each vendor.
| Vendor | Price / 1K | Citations | Full search trail | Brand analysis |
|---|---|---|---|---|
| Oxylabs | Credits | Yes | No | No |
| Bright Data | $1.50 | Yes | No | No |
| SerpApi | Plan-based | Yes | No | No |
| DataForSEO LLM Scraper | $1.20–4.00 | Yes | No | Separate product |
| Apify actors | $2.00–5.00 | Yes | No | No |
| ScrapeBadger | $3.00 | Yes + text offsets | Yes + fan-out queries | Bundled |
You only pay for successful responses — blocked, rate-limited, and upstream errors are always free. PAYG credits never expire; volume subscription tiers reduce per-credit cost further.
Get started in minutes with Node.js, Python, or plain HTTP requests.
The scrapebadger Node.js library wraps the Perplexity API with typed methods. Install with npm install scrapebadger, then start asking Perplexity in a few lines of code.
import ScrapeBadger from 'scrapebadger'
const client = new ScrapeBadger({
apiKey: 'sb_live_...'
})
// Ask the real perplexity.ai (takes 10-40s live)
const res = await client.perplexity.ask({
prompt: 'Best web scraping APIs in 2026?',
focus: 'web',
})
console.log(res.answer)
console.log(res.webSearchTriggered, res.citationCount)
// Which sentence does each source back?
for (const c of res.citations) {
console.log(c.domain, c.startIndex, c.endIndex)
}
// How visible is your brand in that answer?
const vis = await client.perplexity.brandVisibility({
prompt: 'Best web scraping APIs in 2026?',
brand: 'ScrapeBadger',
domain: 'scrapebadger.com',
competitors: ['Bright Data', 'ScrapingBee'],
})
console.log(vis.mentioned, vis.shareOfVoicePct, vis.citationRank)Common questions about scraping Perplexity with the API — Node.js, Python, or REST.
The /ask endpoint returns the prompt, the answer as plain text and markdown, citations (url, title, snippet, domain, source_type, published_at, plus start_index/end_index/matched_text pointing into the answer), search_results with the full retrieved set and a cited flag on each, source_domains, search_queries (Perplexity’s own retrieval fan-out), related_questions, images, videos, web_search_triggered, truncated, focus, the model slug, backend_uuid, country, answer_length, citation_count, latency_ms, and created_at.
The real perplexity.ai. Requests go to the consumer product anonymously — no Perplexity account and no Perplexity API key is involved on either side. That is why answers include the full search trail and related questions, which the official Sonar API does not give you.
Perplexity retrieves sources and composes the answer live, so /ask and /brand-visibility measure roughly 10-40s end to end. /models returns immediately. Size your client timeouts to at least 60 seconds. If the stream budget expires mid-answer, the response is flagged truncated rather than silently served as complete.
Call /brand-visibility with a prompt, your brand name, and optionally your domain, aliases, and competitors. You get back mentioned, mention_count, first_position, position_score (1.0 = named at the very start), share_of_voice_pct against the competitors you named, cited plus cited_urls and citation_rank for your domain, a per-competitor breakdown, and an excerpt of the answer around the first mention — alongside the answer and its citations.
Install with `npm install scrapebadger`, initialise the client with your API key, then call client.perplexity.ask({ prompt: "..." }) or client.perplexity.brandVisibility({ prompt: "...", brand: "...", competitors: ["..."] }). Ask accepts an optional country (ISO-3166 alpha-2, default US) and focus (web | scholar | social). Plain HTTP works too — every endpoint accepts GET or POST with the X-API-Key header.
Per-request credit costs are listed above. For higher monthly volume, subscription tiers reduce the per-credit rate substantially. All Perplexity endpoints — ask, brand visibility, and models — included on every plan.
1,000 free credits. No credit card. Get your API key in under a minute.
PAYG credits never expire · Pay only for successful requests · No Perplexity account needed