State
Target specific US states with Mobile Proxies. Learn to filter IPs by state and combine it with city-level targeting.
To get a proxy from a specific US state, add the st flag to the authorization string. For example, us_california, us_illinois. See a complete list of supported US States here.
Here are a few examples of valid combinations of state parameters:
st-us_california-city-los_angeles
st-us_illinois-city-springfield
st-us_michigan-city-detroit
st-us_ohio-city-columbus
st-us_maine-city-portland
st-us_tennessee-city-memphis
Code example
In this example, a query to ip.oxylabs.io is performed from a random IP address from California, USA:
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-st-us_california:PASSWORD" https://ip.oxylabs.io/location<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$state = 'us_california';
$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-st-$state:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
state = 'us_california'
entry = ('http://customer-%s-st-%s:%s@pr.oxylabs.io:7777' %
(username, state, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())Find the complete list of US states by clicking the file below:
Last updated
Was this helpful?

