ZIP/Postal code
Target Residential Proxies by ZIP code. Learn how to use the postalcode parameter alongside country codes for precise US location targeting.
To connect to a proxy using a ZIP code, add and specify the postalcode parameter with a five-digit ZIP code in the username. This parameter must be used combined with the country code parameter cc and a case-insensitive country code in 2-letter 3166-1 alpha-2 format.
Here is an example of the username:
customer-USERNAME-cc-US-postalcode-90210
Code examples
In this example, a query to ip.oxylabs.io/location is performed from a proxy located in the United States with a ZIP code 90210:
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-US-postalcode-90210:PASSWORD" https://ip.oxylabs.io/location<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'US';
$postalcode = '90210';
$proxy = 'pr.oxylabs.io:7777';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country-postalcode-$postalcode:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
postalcode = '90210'
entry = ('http://customer-%s-cc-%s-postalcode-%s:%s@pr.oxylabs.io:7777' %
(username, country, postalcode, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())Last updated
Was this helpful?

