接口提取
按指定国家/州/城市与会话参数,一次生成 N 条可直接使用的代理串。这是把静态配置变成「可直接用」代理地址的最后一步。
接口信息
POST /api/iplt/client/ip/dynamics/exportIp
认证方式:API Key(x-merchant-code + x-merchant-token)
请求头
| 参数名 | 必选 | 类型 | 说明 |
| x-merchant-token | 是 | String | 商户令牌(API Key 的 token 部分) |
| x-merchant-code | 是 | String | 商户代码(API Key 的 code 部分) |
| Content-Type | 否 | String | 固定 application/json(POST/PUT 必填) |
请求参数(Body)
| 参数名 | 必选 | 类型 | 说明 |
| accountId | 是 | String | 账号 ID |
| endpointHost | 是 | String | 接入点域名,来自接入点接口 |
| endpointPort | 是 | Integer | 接入点端口 |
| count | 是 | Integer | 生成条数,范围 1~1000 |
| formatType | 是 | Integer | 拼接格式,见下表 |
| countryCode | 否 | String | 国家二字码,如 US |
| stateCode | 否 | String | 州/省代码,需先传 countryCode |
| cityCode | 否 | String | 城市代码,需先传 stateCode |
| sessionCode | 否 | String | 会话标识;相同值复用同一出口 IP,实现会话粘滞 |
| sessionTime | 否 | Integer | 会话粘滞时长(分钟) |
| protocol | 否 | String | 协议,如 http / socks5 |
| 值 | 格式 | 示例 |
| 0 | user:pass@host:port | u-1:p@gate.example.com:8000 |
| 1 | host:port@user:pass | gate.example.com:8000@u-1:p |
| 2 | user:pass:host:port | u-1:p:gate.example.com:8000 |
| 3 | host:port:user:pass | gate.example.com:8000:u-1:p |
请求示例
curl -s -X POST 'https://www.iplight.net/api/iplt/client/ip/dynamics/exportIp' \
-H 'Content-Type: application/json' \
-H 'x-merchant-code: YOUR_CODE' \
-H 'x-merchant-token: YOUR_TOKEN' \
-d '{
"accountId": "384940",
"endpointHost": "gate.example.com",
"endpointPort": 8000,
"count": 2,
"formatType": 0,
"countryCode": "US",
"stateCode": "CA",
"cityCode": "losangeles",
"sessionCode": "order_20250722",
"sessionTime": 10
}'
响应示例
{
"msg": "操作成功",
"code": 200,
"data": [
"user-region-us-st-ca-city-losangeles-session-order_20250722-sessTime-10:pwd@gate.example.com:8000",
"user-region-us-st-ca-city-losangeles-session-x7Kd2-sessTime-10:pwd@gate.example.com:8000"
]
}
响应参数说明
| 参数名 | 类型 | 说明 |
| data | String[] | 代理串数组,长度等于 count |
说明同一 sessionCode 下第 1 条保持你传入的会话标识,其余条目会自动生成随机后缀,因此不会返回 N 条相同 IP。需要固定 IP 时把 count 设为 1。
常见错误
| code | msg | 原因 |
| 500 | count must be between 1 and 1000 | count 超出范围 |
| 500 | formatType must be 0, 1, 2, or 3 | formatType 非法 |
| 500 | accountId, endpointHost, endpointPort, count, and formatType cannot be null | 必填项缺失 |