Multi-format Output
See how to get more than one output format with a single API call.
You can get multiple result types in a single API response. This feature works the same way with Realtime and Push-Pull integration methods.
Available result types
png
The PNG screenshot of a web page.
parsed
Parsed content of the web page, formatted as a JSON data structure.
markdown
Markdown of a web page.
xhr
XHR requests made while loading the page.
raw
The raw content found at a given URL. It's likely to be (but won’t always be) an HTML document.
Step 1: Specify result types to be available for fetching
Start by enabling the result types in your initial request payload to make them available. The example uses a source with a Dedicated parser. For a page without one, parse: true needs Custom parser instructions instead.
Sample POST https://data.oxylabs.io/v1/queries payload:
{
"source": "amazon_product",
"query": "B07FZ8S74R",
"parse": true,
"markdown": true,
"xhr": true,
"render": "png"
}Step 2: Retrieve multiple result types
Then, specify which types to retrieve using the type URL parameter when fetching results. For example:
type=parsed,pngwill return parsed results and the PNG screenshottype=parsed,markdown,xhr,png,rawwill return all result types
Realtime API endpoint:
Push-Pull API endpoint:
Output sample
The API will return all requested types together in a single results[] array. The order of the entries is not fixed (Realtime and Push-Pull return them in different orders):
Last updated
Was this helpful?