Making Requests
The easiest way to start is to send a simple query without custom options. We will add all standard headers on our end, pick the fastest proxy, and deliver you the response body.
curl -k -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://ip.oxylabs.io/location'To utilize additional functionalities of Web Unblocker, such as setting up proxy location or reusing the same IP for a few consecutive requests, please send additional headers with the request.
Here's the full list of supported functionalities and headers:
Additional functionalities
X-Oxylabs-Session-Id
If you would like to reuse the same IP for multiple requests, add a session ID which can be a random string of characters.
X-Oxylabs-Geo-Location
To use an IP address from a specific location, specify a country or a city, for example, Germany. You can find supported geo-location values here.
Headers
If you want to send custom headers, use x-oxylabs-force-headers: 1 header when submitting your request.
X-Oxylabs-Status-Code
If your target site returns a non-standard status code with a successful response, you can send the response status code, and our system will not retry the request.
X-Oxylabs-Render
If you would like to render JavaScript, use html to get a rendered HTML or png to get a screenshot of the page.
Code examples
curl -k -x https://unblock.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
'https://ip.oxylabs.io/headers'import requests
# Use your Web Unblocker credentials here.
USERNAME, PASSWORD = 'YOUR_USERNAME', 'YOUR_PASSWORD'
# Define proxy dict.
proxies = {
'http': f'http://{USERNAME}:{PASSWORD}@unblock.oxylabs.io:60000',
'https': f'https://{USERNAME}:{PASSWORD}@unblock.oxylabs.io:60000',
}
response = requests.request(
'GET',
'https://ip.oxylabs.io/headers',
verify=False, # Ignore the SSL certificate
proxies=proxies,
)
# Print result page to stdout
print(response.text)
# Save returned HTML to result.html file
with open('result.html', 'w') as f:
f.write(response.text)Last updated
Was this helpful?

