{"id":51844426,"url":"https://github.com/scrapeless-ai/perplexity-scraper","last_synced_at":"2026-07-23T10:01:42.192Z","repository":{"id":371105462,"uuid":"1299146804","full_name":"scrapeless-ai/perplexity-scraper","owner":"scrapeless-ai","description":"Collect Perplexity answers, Markdown output, links, and citations through the Scrapeless LLM Chat Scraper API for AI search monitoring and source analysis.","archived":false,"fork":false,"pushed_at":"2026-07-13T10:19:09.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-13T12:11:28.627Z","etag":null,"topics":["ai-scraper","answer-engine","geo","perplexity","perplexity-ai","perplexity-api","perplexity-scraper","seo"],"latest_commit_sha":null,"homepage":"https://docs.scrapeless.com/en/llm-chat-scraper/scrapers/perplexity/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scrapeless-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-13T10:16:21.000Z","updated_at":"2026-07-13T10:22:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/scrapeless-ai/perplexity-scraper","commit_stats":null,"previous_names":["scrapeless-ai/perplexity-scraper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/scrapeless-ai/perplexity-scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapeless-ai%2Fperplexity-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapeless-ai%2Fperplexity-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapeless-ai%2Fperplexity-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapeless-ai%2Fperplexity-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrapeless-ai","download_url":"https://codeload.github.com/scrapeless-ai/perplexity-scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapeless-ai%2Fperplexity-scraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35798804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-scraper","answer-engine","geo","perplexity","perplexity-ai","perplexity-api","perplexity-scraper","seo"],"created_at":"2026-07-23T10:01:42.125Z","updated_at":"2026-07-23T10:01:42.182Z","avatar_url":"https://github.com/scrapeless-ai.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perplexity Scraper\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://app.scrapeless.com/passport/login?redirect=/quick-start\u0026utm_source=github\u0026utm_medium=repo\u0026utm_campaign=perplexity_scraper\" target=\"_blank\"\u003e\n    \u003cimg src=\"./assets/banner.svg\" alt=\"Scrapeless Perplexity Scraper - collect Perplexity answers with one API call\" width=\"100%\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://app.scrapeless.com/passport/login?redirect=/quick-start\u0026utm_source=github\u0026utm_medium=repo\u0026utm_campaign=perplexity_scraper\"\u003e\n    \u003cimg alt=\"Try Scrapeless\" src=\"https://img.shields.io/badge/Try%20Scrapeless-Start%20Free-1A73E8?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.scrapeless.com/en/blog?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=perplexity_scraper\"\u003e\n    \u003cimg alt=\"Blog\" src=\"https://img.shields.io/badge/Blog-Web%20Scraping%20Guides-22C55E?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://x.com/Scrapelessteam\"\u003e\n    \u003cimg alt=\"X\" src=\"https://img.shields.io/badge/X-Scrapeless-000000?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.linkedin.com/company/scrapeless/\"\u003e\n    \u003cimg alt=\"LinkedIn\" src=\"https://img.shields.io/badge/LinkedIn-Scrapeless-0A66C2?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nCollect Perplexity AI answers through the **Scrapeless LLM Chat Scraper** API, including Markdown responses, related follow-up prompts, web citations, and media references, without reverse-engineering the Perplexity UI, maintaining browsers, or building your own anti-blocking stack.\n\nUse this repo when you need a repeatable way to monitor Perplexity answers for GEO and AI search visibility, compare prompts across regions, audit cited sources, or pipe AI responses into analytics and automation workflows.\n\n- **Full documentation:** https://docs.scrapeless.com/en/llm-chat-scraper/quickstart/introduction/\n- **Get your `x-api-token`:** https://app.scrapeless.com/passport/login?redirect=/quick-start\n- **API endpoint:** `POST https://api.scrapeless.com/api/v2/scraper/execute`\n\n## How it works\n\nSend a single `POST` request to the Scrapeless endpoint with your API token in\nthe `x-api-token` header. The body specifies the actor (`scraper.perplexity`) and\nan `input` object with your prompt and options. The API runs the query and\nreturns the structured result in `task_result`.\n\n```http\nPOST https://api.scrapeless.com/api/v2/scraper/execute\nContent-Type: application/json\nx-api-token: \u003cYOUR_API_TOKEN\u003e\n```\n\n## Quick start (curl)\n\n```bash\ncurl 'https://api.scrapeless.com/api/v2/scraper/execute' \\\n  --header 'Content-Type: application/json' \\\n  --header 'x-api-token: YOUR_API_TOKEN' \\\n  --data '{\n    \"actor\": \"scraper.perplexity\",\n    \"input\": {\n      \"prompt\": \"Recommended attractions in New York\",\n      \"country\": \"US\",\n      \"web_search\": true\n    }\n  }'\n```\n\nTo receive the result asynchronously, add a `webhook` object:\n\n```json\n\"webhook\": { \"url\": \"https://www.your-webhook.com\" }\n```\n\n## Request parameters\n\nThe request body has three top-level fields: `actor` (always `scraper.perplexity`),\n`input` (below), and an optional `webhook`.\n\n| Parameter (`input.*`) | Type    | Required | Description                              |\n| --------------------- | ------- | -------- | ---------------------------------------- |\n| `prompt`              | string  | Yes      | Prompt to send to Perplexity.            |\n| `country`             | string  | Yes      | Country / region code (e.g. `US`, `JP`). |\n| `web_search`          | boolean | No       | Enable or disable web search enrichment. |\n\n## Response\n\nA successful call returns a status envelope; the scraped data lives in\n`task_result`:\n\n```json\n{\n  \"status\": \"success\",\n  \"task_id\": \"e705743d-da2e-4163-9ccd-eef62529ff72\",\n  \"task_result\": {\n    \"prompt\": \"Recommended attractions in New York\",\n    \"result_text\": \"...markdown answer...\",\n    \"related_prompt\": [],\n    \"web_results\": [\n      { \"name\": \"...\", \"url\": \"https://...\", \"snippet\": \"...\" }\n    ],\n    \"media_items\": [\n      { \"medium\": \"map\", \"url\": \"https://...\", \"image\": \"https://...\", \"source\": \"web\", \"thumbnail\": \"https://...\", \"locations\": [] }\n    ]\n  }\n}\n```\n\n### Top-level fields\n\n| Field         | Type   | Description                                    |\n| ------------- | ------ | ---------------------------------------------- |\n| `status`      | string | Request status, e.g. `success`.                |\n| `task_id`     | string | Unique identifier for the task.                |\n| `task_result` | object | Scraped result (fields below).                 |\n\n### `task_result` fields\n\n| Field            | Type   | Description                                                                      |\n| ---------------- | ------ | -------------------------------------------------------------------------------- |\n| `prompt`         | string | Original prompt.                                                                 |\n| `result_text`    | string | Markdown response from Perplexity.                                               |\n| `related_prompt` | array  | Related follow-up questions.                                                     |\n| `web_results`    | array  | Web citations referenced (`name`, `url`, `snippet`).                             |\n| `media_items`    | array  | Media references (`medium`, `url`, `image`, `source`, `thumbnail`, `locations`). |\n\nFor the complete field list (media location details — coordinates, categories,\nreviews, addresses, etc.), see the\n[official documentation](https://docs.scrapeless.com/en/llm-chat-scraper/quickstart/introduction/).\n\n## Code examples\n\nReady-to-run examples live in [`examples/`](./examples):\n\n| Language | File                                       | Run                                   |\n| -------- | ------------------------------------------ | ------------------------------------- |\n| Python   | [`example.py`](./examples/example.py)      | `pip install requests \u0026\u0026 python example.py` |\n| Node.js  | [`example.js`](./examples/example.js)      | `node example.js` (Node 18+)          |\n| Go       | [`example.go`](./examples/example.go)      | `go run example.go`                   |\n| Java     | [`Example.java`](./examples/Example.java)  | `java Example.java` (Java 11+)        |\n| PHP      | [`example.php`](./examples/example.php)    | `php example.php`                     |\n\nAll examples read the token from the `SCRAPELESS_API_TOKEN` environment variable:\n\n```bash\nexport SCRAPELESS_API_TOKEN=\"your_api_token\"\n```\n\n## Practical use cases\n\n### AI answer monitoring\n\nTrack how Perplexity responds to your brand, product category, documentation topics, or competitor prompts. Store the Markdown answer, web citations, and related prompts so your team can measure AI visibility over time.\n\n### GEO and SEO research\n\nRun the same prompt across countries and web search settings to compare which sources Perplexity cites, how recommendations change by region, and where your content appears in AI-generated answers.\n\n### Competitor intelligence\n\nCollect structured Perplexity answers for competitor names, feature comparisons, pricing questions, and \"best tool for...\" prompts. Use the output to identify messaging gaps and content opportunities.\n\n### Dataset and workflow automation\n\nPipe Perplexity answers into internal dashboards, knowledge-base QA systems, spreadsheets, data warehouses, or alerting workflows through the synchronous API response or webhook callback.\n\n## Why use Scrapeless for Perplexity scraping?\n\n| Benefit | What it means for your team |\n| ------- | --------------------------- |\n| One unified API | Query Perplexity through the same Scrapeless LLM Chat Scraper workflow used for other AI answer engines. |\n| Structured output | Receive Markdown answers, related prompts, web citations, and media references in a developer-friendly response. |\n| Less maintenance | Avoid building browser automation, UI selectors, proxy rotation, retries, and anti-blocking logic yourself. |\n| Region-aware analysis | Use country inputs to compare localized AI answers and cited sources. |\n| Production integration | Use API tokens, webhooks, and language examples to connect Perplexity data to real applications quickly. |\n\n## FAQ\n\n### What is Perplexity Scraper?\n\nPerplexity Scraper is a Scrapeless LLM Chat Scraper actor that sends prompts to Perplexity AI and returns structured answer data, including the Markdown response, related follow-up prompts, web citations, and media references.\n\n### Do I need to run a browser or proxy pool?\n\nNo. This repo shows how to call the Scrapeless API. Scrapeless handles the scraping workflow behind the API, so your application only needs to send requests and process the returned data.\n\n### What do `related_prompt` and `media_items` return?\n\n`related_prompt` returns suggested follow-up questions surfaced alongside the answer, useful for expanding a topic or building question trees. `media_items` returns media references such as maps and images, each with fields like `medium`, `url`, `image`, `source`, `thumbnail`, and `locations`. You can toggle web search enrichment with the optional `web_search` parameter.\n\n### Can I get results asynchronously?\n\nYes. Add a `webhook` object with your callback URL to receive results asynchronously when the task completes.\n\n### Is this suitable for AI search visibility monitoring?\n\nYes. The response includes AI-generated Markdown, related prompts, web citations, and media references, which makes it useful for GEO analysis, brand monitoring, source tracking, and competitive research.\n\n### What should I consider before using AI scraping in production?\n\nMake sure your use case complies with applicable laws, platform terms, privacy requirements, and your organization's data policies. Avoid collecting sensitive, private, or unauthorized information.\n\n## Learn more\n\n- [Scrapeless LLM Chat Scraper documentation](https://docs.scrapeless.com/en/llm-chat-scraper/quickstart/introduction/)\n- [Supported LLM Chat Scraper actors](https://docs.scrapeless.com/en/llm-chat-scraper/quickstart/introduction/)\n- [Scrapeless dashboard](https://app.scrapeless.com/passport/login?redirect=/quick-start)\n- [Scrapeless website](https://www.scrapeless.com/en)\n\n## Contact us\n\nNeed help building a Perplexity monitoring workflow or scaling AI answer collection?\n\n- Join our [Discord](https://discord.gg/VU2vtbq7Q2).\n- Contact us on [Telegram](https://t.me/scrapeless).\n- For repo-specific issues or improvements, open an issue or pull request in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrapeless-ai%2Fperplexity-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrapeless-ai%2Fperplexity-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrapeless-ai%2Fperplexity-scraper/lists"}