Realtime

Realtime is a synchronous integration method. It requires keeping the connection open until the job is finished successfully or returns an error.

Job Submission

Endpoint

The Realtime API endpoint for job submission is:

POST https://realtime.oxylabs.io/v1/queries

Input

Provide the job parameters in a JSON payload as shown in the examples below. Python and PHP examples include comments for clarity.

curl --user "USERNAME:PASSWORD" \
'https://realtime.oxylabs.io/v1/queries' \
-H "Content-Type: application/json" \
-d '{"source": "universal", "url": "https://example.com", "geo_location": "United States"}'

Output

Realtime API supports these result types in the output:

  • HTML: The raw HTML content scraped from the target webpage;

  • JSON: Structured data parsed from the HTML content, formatted in JSON format;

  • PNG: Base64-encoded screenshot of the rendered page in PNG format.

This table explains the default and other available result types based on the parameters included in the payload of the API request.

Render parameterParse parameterDefault outputAvailable output

x

x

html

html

html

x

html

html

png

x

png

html, png

x

true

json

html, json

html

true

json

html, json

png

true

png

html, json, png

Output example:

{
  "results": [
    {
      "content": "<html>
      CONTENT
      </html>"
      "created_at": "2019-10-01 00:00:01",
      "updated_at": "2019-10-01 00:00:15",
      "id": null,
      "page": 1,
      "url": "https://www.example.com/",
      "job_id": "12345678900987654321",
      "status_code": 200
    }
  ]
}

Retrieve results

Endpoints

You can retrieve the job content using the following endpoints:

GET https://data.oxylabs.io/v1/queries/{job_id}/results
GET https://data.oxylabs.io/v1/queries/{job_id}/results?type=raw
GET https://data.oxylabs.io/v1/queries/{job_id}/results?type=parsed
GET https://data.oxylabs.io/v1/queries/{job_id}/results?type=png

Last updated