For the complete documentation index, see llms.txt. This page is also available as Markdown.

Proxy Endpoint

Send and receive data via the Oxylabs Web Scraper API Proxy Endpoint. Access target pages directly through a simple URL-based integration.

If you have ever used regular proxies for data scraping, integrating the Proxy Endpoint delivery method will be a breeze. All you need to do is use our entry node as a proxy, authorize with Web Scraper API credentials, and ignore certificates. In cURL, it's -k or --insecure. Your data will reach you on an open connection.

Proxy Endpoint only works with the URL-based data sources, where full URL is provided. Therefore, it only accepts a handful of additional job parameters, which should be sent as headers.

Endpoint

GET realtime.oxylabs.io:60000

Input

Please see a request example below.

curl -k -x https://realtime.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
-H 'x-oxylabs-user-agent-type: desktop' \
-H 'x-oxylabs-geo-location: Germany' \
'https://www.example.com'
import requests
from pprint import pprint

# Use your Web Scraper API credentials here.
USERNAME, PASSWORD = 'YOUR_USERNAME', 'YOUR_PASSWORD'

# Define proxy dict.
proxies = {
  'http': f'http://{USERNAME}:{PASSWORD}@realtime.oxylabs.io:60000',
  'https': f'https://{USERNAME}:{PASSWORD}@realtime.oxylabs.io:60000'
}

# To set a specific geo-location, user-agent or to render Javascript
# it is required to send parameters as request headers.
headers = {
    'x-oxylabs-user-agent-type': 'desktop',
    'x-oxylabs-geo-location': 'Germany',
    #'X-Oxylabs-Render': 'html', # Uncomment if you want to render JavaScript within the page.
}

response = requests.request(
    'GET',
    'https://www.example.com',
    headers = headers, # Pass the defined headers.
    verify=False,  # Accept our certificate.
    proxies=proxies,
)

# Print result page to stdout.
pprint(response.text)

# Save returned HTML to 'result.html' file.
with open('result.html', 'w') as f:
    f.write(response.text)

Output

Below you will find a sample response from https://example.com:

Sample response
<!doctype html>
<html lang="en">
<head>
<title>Example Domain</title>
<link rel="icon" href="data:,">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p>
<p>
<a href="https://iana.org/domains/example">Learn more</a>
</p>
</div>
</body>
</html>

Accepted parameters

When making your request, along with the URL, you can send us some job parameters that we will use while executing your job. The job parameters should be sent in your request headers - see an example here.

Here is the list of job parameters that you can send with Proxy Endpoint requests:

Parameter
Description

x-oxylabs-user-agent-type

There is no way to indicate a specific User-Agent, but you can let us know which user-agent type you would like us to use. A list of supported User-Agent types can be found here.

x-oxylabs-geo-location

In some cases, you may need to indicate the geographical location that the result should be adapted for. This parameter corresponds to the geo_location parameter, described separately in source-level documentation. Accepted values depend on the URL you would like us to scrape. Read more here.

x-oxylabs-render

JavaScript execution. Accepted values: html and png. Read more here.

x-oxylabs-parse

Set to true to get structured JSON output instead of raw page content. Only works for URLs covered by a dedicated parser.

x-oxylabs-parser-type

Selects a parser explicitly. Must be sent together with x-oxylabs-parse: true, and must be a parser that supports the URL you are scraping.

x-oxylabs-browser-instructions

Browser instructions as a JSON string. Requires x-oxylabs-render. Read more here.

Last updated

Was this helpful?