City
Target specific cities in various countries with Residential Proxies. Learn to use the parameters to filter IPs by city and combine it with country-level targeting.
Add a city parameter to narrow down to city-level targeting. For example, cc-DE-city-munich means that a proxy from Munich, Germany, will handle the query.
Here are a few examples of valid combinations of cc and city parameters:
cc-US-city-los_angeles
cc-IT-city-rome
cc-TH-city-bangkok
cc-JP-city-tokyo
cc-AU-city-sydney
cc-ES-city-barcelona
Code examples
In this example, a query to ip.oxylabs.io/location is performed from a random IP address from Munich, Germany:
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-DE-city-munich:PASSWORD" https://ip.oxylabs.io/location<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'DE';
$city = 'munich';
$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-city-$city:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'DE'
city = 'munich'
entry = ('http://customer-%s-cc-%s-city-%s:%s@pr.oxylabs.io:7777' %
(username, country, city, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())Download the list of supported cities by clicking the file below:
Last updated
Was this helpful?

