本API提供获取高质量代理IP的服务,支持通过协议筛选代理,并可自定义获取数量。
GET https://proxy.scdn.io/api/get_proxy.php
以下是一些常用的API调用示例,点击链接可以直接查看返回结果:
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
protocol | string | 否 |
代理协议类型。支持的值:http , https , socks4 , socks5 。
默认为 all ,获取任意可用协议的代理。
注意: 如果一个代理同时支持HTTP和SOCKS5,当您请求 http 时,它也可能被返回。
|
count | integer | 否 | 获取代理数量,默认1个,最大20个。 |
{
"code": 200,
"message": "success",
"data": {
"proxies": [
"192.168.1.1:8080",
"10.0.0.1:3128"
],
"count": 2
}
}
$url = 'https://proxy.scdn.io/api/get_proxy.php?protocol=http&count=2';
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
import requests
url = 'https://proxy.scdn.io/api/get_proxy.php'
params = {
'protocol': 'http',
'count': 2
}
response = requests.get(url, params=params)
data = response.json()
print(data)
fetch('https://proxy.scdn.io/api/get_proxy.php?protocol=http&count=2')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));