For the complete documentation index, see llms.txt. This page is also available as Markdown.

城市

使用移动代理定位不同国家的特定城市。按城市筛选 IP,并将其与国家级定位结合使用。

添加一个 城市 参数,以缩小到城市级定向。例如, cc-DE-city-munich 表示来自德国慕尼黑的代理将处理该查询。

我们支持世界上每一个城市,但由于移动代理的动态特性,我们不能保证在特定时刻一定会有该地的代理。热门城市覆盖良好。

以下是一些有效的 cc城市 参数组合示例: 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

代码示例

在此示例中,对 ip.oxylabs.io 会从德国慕尼黑的随机 IP 地址执行:

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'
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())

通过点击下面的文件下载受支持城市列表:

这有帮助吗?