Documentation has been updated: see help center and changelog in one place.

Perplexity

Learn how to send prompts to Perplexity and get structured responses using the Web Scraper API. Find out more about its request parameters and structured output.

The perplexity source lets you send prompts and capture complete responses directly from Perplexity. It returns both the generated text and relevant metadata in a structured format, along with a Markdown version of the result.

Request samples

The code examples below illustrate how to send prompts to Perplexity and retrieve parsed responses.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "perplexity",
        "prompt": "top 3 smartphones in 2025, compare pricing across US marketplaces",
        "geo_location": "United States",
        "parse": true
    }'

Our examples use the Realtime (synchronous) integration method. To use Proxy Endpoint or Push-Pull (asynchronous), refer to the integration methods section.

By default, all requests to Perplexity use JavaScript rendering. Make sure to set a sufficient timeout (e.g. 180s) when using the Realtime integration method.

Request parameter values

Generic

Basic setup and configuration parameters for retrieving Perplexity responses.

Parameter
Description
Default Value

source

Sets the scraper.

perplexity

prompt

The prompt or question to submit to Perplexity.

-

parse

Returns parsed data when set to true.

false

geo_location

Specify a country to send the prompt from. More info.

-

callback_url

URL to your callback endpoint. More info.

-

- mandatory parameter

Structured data

Web Scraper API returns either an HTML document or a JSON object of Perplexity's output, which contains structured data from the results page.

perplexity structured output

Output data dictionary

HTML example

JSON structure

The structured perplexity output includes fields such as url, model, answer_results, and more. The table below breaks down the page elements we parse, along with descriptions, data types, and relevant metadata.

The number of items and fields for a specific result type may vary depending on the submitted prompt.

Field
Description
Type

url

The URL of Perplexity's conversation.

string

page

Page number.

integer

content

An object containing parsed Perplexity page data.

object

model

Perplexity model used to generate the answer.

string

prompt_query

The original prompt submitted to Perplexity.

string

displayed_tabs

Tabs displayed in Perplexity's interface (e.g., shopping, images).

list

answer_results

The complete Perplexity response containing text or nested content.

list or string

answer_results_md

The entire answer rendered in Markdown format.

string

related_queries

A list of queries related to the main prompt.

list

top_images

A list of top images with their titles and URLs.

array

top_sources

A list of top cited sources with their titles, sources, and URLs.

array

inline_products

A list of inline products with titles, prices, links, and other metadata.

array

additional_results.hotels_results

A list of hotels with titles, URLs, addresses, and other hotel details.

array

additional_results.places_results

A list of places with titles, URLs, coordinates,, and other metadata.

array

additional_results.videos_results

A list of videos with thumbnails, titles, URLs, and sources.

array

additional_results.shopping_results

A list of shopping items with titles, prices, URLs, and other product metadata.

array

additional_results.sources_results

A list of cited sources with their titles and URLs.

array

additional_results.images_results

A list of related images with titles, image URLs, and source page URLs.

array

parse_status_code

Status code of the parsing operation.

integer

created_at

The timestamp when the scraping job was created.

timestamp

updated_at

The timestamp when the scraping job was finished.

timestamp

job_id

The ID of the job associated with the scraping job.

string

geo_location

Proxy location from which the prompt was submitted.

string

status_code

The status code of the scraping job. You can see the scraper status codes described here.

integer

parser_type

The type of the parser used for breaking down the HTML content.

string

Additional results and inline products

Along with the main AI response, we return extra data under additional_results, such as

  • images_results

  • sources_results

  • shopping_results

  • videos_results

  • places_results

  • hotels_results

These arrays are extracted from the tabs on the original results page and are included only if relevant content is available:

Moreover, the inline_products array contains products that are directly embedded in the response:

Last updated

Was this helpful?