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:

ParameterTypeRequiredDescription
targetstringTarget type must be set to perplexity
promptstringThe prompt sent to Perplexity. Must be fewer than 8000 characters
parsebooleanAutomatically parses results when set to true. Default value is false.
geostringSet 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 keyDescription
modelThe Perplexity model used
prompt_queryThe original query submitted in the request
displayed_tabsInterface tabs in Perplexity (e.g., shopping, images).
answer_resultsThe full response text
answer_results_mdThe full response text in Markdown format
related_queriesQueries list associated with the main prompt.
top_imagesA list of top images with associated titles, links
top_sourcesA list of main citations, each with associated links and titles.
inline_productsA 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 KeyDescription
hotels_resultsA list of hotels with associated titles, links, addresses, and additional details.
places_resultsA list of places with associated titles, links, coordinates, and other metadata.
videos_resultsA list of videos with associated thumbnails, titles, links, and sources.
shopping_resultsA list of shopping items with associated titles, prices, links, and other metadata.
sources_resultsA list of citations, each with associated links and titles.
images_resultsA list of related images with associated titles, image links, and source page links.