cURL
curl -X POST 'https://miyaip.com/api/UserShort/GenerateIps' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YOUR_TOKEN>' \
-H 'Content-Type: application/json' \
--data '{
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}'const url = 'https://miyaip.com/api/UserShort/GenerateIps';
const response = await fetch(url, {
method: 'POST',
headers: {
"Accept": "application/json",
"Authorization": "Bearer <YOUR_TOKEN>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}),
});
const result = await response.text();
console.log(result);import requests
url = "https://miyaip.com/api/UserShort/GenerateIps"
headers = {
"Accept": "application/json",
"Authorization": "Bearer <YOUR_TOKEN>"
}
payload = {
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.text){
"code": 200,
"message": "Success",
"body": {
"proxyList": [
"gateway.miyaip.com:10000:username:********"
],
"failedList": [],
"requestCount": 1,
"failedCount": 0
}
}{
"code": 500,
"message": "Invalid request",
"body": null
}代理生成
MiyaIP 短效住宅 API:生成代理 IP
通过 Bearer Token 调用 MiyaIP 短效住宅生成接口,选择国家、可选州和数量,核对生成结果及短效 IP 额度消耗。
cURL
curl -X POST 'https://miyaip.com/api/UserShort/GenerateIps' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YOUR_TOKEN>' \
-H 'Content-Type: application/json' \
--data '{
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}'const url = 'https://miyaip.com/api/UserShort/GenerateIps';
const response = await fetch(url, {
method: 'POST',
headers: {
"Accept": "application/json",
"Authorization": "Bearer <YOUR_TOKEN>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}),
});
const result = await response.text();
console.log(result);import requests
url = "https://miyaip.com/api/UserShort/GenerateIps"
headers = {
"Accept": "application/json",
"Authorization": "Bearer <YOUR_TOKEN>"
}
payload = {
"CountryCode": "US",
"StateCode": "CA",
"Count": 1
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.text){
"code": 200,
"message": "Success",
"body": {
"proxyList": [
"gateway.miyaip.com:10000:username:********"
],
"failedList": [],
"requestCount": 1,
"failedCount": 0
}
}{
"code": 500,
"message": "Invalid request",
"body": null
}为当前账户生成短效住宅代理。来源说明每条生成代理的有效期为 24 小时。
发送请求会消耗短效 IP 额度。发送前核对国家、可选州和数量。调试器不会自动重试生成请求。
生成一批代理
- 在登录接口取得访问 Token,填写为 Bearer 凭据。
- 填写必填的
CountryCode与Count。国家使用大写 ISO 代码,需要指定州时填写受支持地区的StateCode。 - 仅发送一次,检查 HTTP 状态与业务结果。读取
proxyList与failedList,再核对requestCount和failedCount,不要假设所有请求项均已生成。
Count 为 1 至 100。这是界面的输入范围,不代表账户一定有足够额度,或每个地区均有资源。来源未提供完整国家与州枚举。
请求超时或取消后,请先核对账户,再决定是否重新生成。没有收到响应不代表生成未发生。参阅 API 响应处理说明。
在线调试
来源:官方短效生成接口参考。授权
使用登录响应中的 token,发送 Authorization: Bearer 请求头。Token 有效期和刷新方式未在来源中说明。
请求体
application/json