Location
Location targeting is arguably the most crucial aspect of configuring a proxy. Users frequently need to access a proxy server in a specific location for various purposes. IPRoyal offers extensive possibilities in this regard, enabling users to target a region, country, state, or city and even a specific internet service provider (ISP) within that location. We will explore these options in greater detail in the subsequent paragraphs, focusing on the comprehensive location-targeting capabilities provided by IPRoyal within this section.
Region
_region- is the key for region configuration. Adding this value will tell our router to filter proxies that are located in this region.
Example:
curl -v -x http://username123:[email protected]:12321 -L https://google.com<?php
$username = 'username123';
$password = 'password321_region-europe';
$proxy = 'geo.iproyal.com:12321';
$url = 'http://example.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>Country
_country- is the key for country configuration. The value of this parameter is a two letter country code (ISO 3166-1 alpha-2 format).
You can select more than one country. When resolving a proxy with this configuration, our router will randomly select one of the countries you had set as a value for the country key.
Examples:
curl -v -x http://username123:password321_country-dk,it,[email protected]:12321 -L http://example.com<?php
$username = 'username123';
$password = 'password321_country-dk,it,ie';
$proxy = 'geo.iproyal.com:12321';
$url = 'http://example.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>City
_city- is the key to target a city. The value should be a name of the city.
Additionally, it's essential to specify the country when targeting a specific city, as multiple countries may have cities with the same name.
Example:
State
_state- is used to target a state in the US. The value should be the name of the state.
Be sure to select the US as a country.
Example:
ISP
_isp- is used to target a specific ISP (Internet service provider) in a location. The value should be a concatenated name of the provider.
Be sure to chain it to a city. A single ISP is often present in many cities or even countries.
Example:
Last updated
Was this helpful?