Perplexity
Web Scraping API Perplexity Target
The perplexity
target is built to obtain conversational responses from Perplexity.
This target is available with Web API Advanced plans.
This template is available via both Real-time and Asynchronous integration methods, however this target does not support batch requests.
Input parameters
Request parameters available for Perplexity target:
Parameter | Type | Required | Description |
---|---|---|---|
target | string | ✅ | Target type must be set to perplexity |
prompt | string | ✅ | The prompt sent to Perplexity. Must be fewer than 8000 characters |
parse | boolean | Automatically parses results when set to true . Default value is false . | |
geo | string | Set the country to use when submitting the prompt. Full list of locations available for Advanced plan can be found here. |
Request example
curl --request 'POST' \
--url 'https://scraper-api.decodo.com/v2/task' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Auth.token' \ // update with your authorization token
--header 'Content-Type: application/json' \
--data '
{
"target": "perplexity",
"prompt": "Top 3 tips to improve productivity while working from home?",
"parse": true,
"geo": "United States"
}
'
Output
As an output, you will get a JSON file.
Descriptions for fields in the parsed JSON content
section are provided in the table below. Keep in mind that the amount of fields can vary according to the provided prompt.
Content key | Description |
---|---|
model | The Perplexity model used |
prompt_query | The original query submitted in the request |
displayed_tabs | Interface tabs in Perplexity (e.g., shopping, images). |
answer_results | The full response text |
answer_results_md | The full response text in Markdown format |
related_queries | Queries list associated with the main prompt. |
top_images | A list of top images with associated titles, links |
top_sources | A list of main citations, each with associated links and titles. |
inline_products | A list of inline products with associated titles, prices, links, and other metadata. |
In addition to the main AI response, we provide extra data under additional_results
. Descriptions for these fields can be found in the table below. Keep in mind that the amount of fields can vary according to the provided prompt.
Additional results Key | Description |
---|---|
hotels_results | A list of hotels with associated titles, links, addresses, and additional details. |
places_results | A list of places with associated titles, links, coordinates, and other metadata. |
videos_results | A list of videos with associated thumbnails, titles, links, and sources. |
shopping_results | A list of shopping items with associated titles, prices, links, and other metadata. |
sources_results | A list of citations, each with associated links and titles. |
images_results | A list of related images with associated titles, image links, and source page links. |
Updated about 21 hours ago