API 对接文档
接口地址
GET https://api.jingxialai.com/api/ip
请求参数
| 参数 | 类型 | 必须 | 说明 |
ip | string | 是 | 要查询的 IP 地址(IPv4 或 IPv6),传 self 查询调用者 IP |
鉴权方式
在请求头中携带 API Key:
X-API-Key: ip_live_xxxxxxxxxxxxxxxx
成功响应(200)
{
"ip": "114.114.114.114",
"continent": "亚洲",
"country": "中国",
"country_code": "CN",
"country_en": "China",
"province": "四川省",
"city": "成都市",
"district": "",
"postal_code": "610000",
"admin_code": "510100",
"isp": "中国电信",
"organization": "中国电信",
"longitude": "118.7969",
"latitude": "32.0603",
"timezone": "UTC+8",
"radius": "",
"region": "华东",
"network_type": "ISP"
}
返回字段说明
💡 为什么部分字段标注“部分数据提供”?
底层采用智能分流与降级路由引擎。所以返回的数据可能不一样。
如果你要稳定的国内区县数据,请单独联系说明。
| 字段 | 类型 | 说明 |
ip | string | 查询的 IP 地址 |
continent | string | 大洲,如"亚洲"(部分数据提供) |
country | string | 国家,如"中国" |
country_code | string | 国家简码,如"CN" |
country_en | string | 国家英文名,如"China"(部分数据提供) |
province | string | 省份,如"四川省" |
city | string | 城市,如"成都市" |
district | string | 区县(部分数据提供) |
postal_code | string | 邮政编码(部分数据提供) |
admin_code | string | 行政区划代码,如"320100" |
isp | string | 运营商,如"中国电信" |
organization | string | 所属机构(部分数据提供) |
longitude | string | 经度(部分数据提供) |
latitude | string | 纬度(部分数据提供) |
timezone | string | 时区,如"UTC+8"(部分数据提供) |
radius | string | 定位半径(部分数据提供) |
region | string | 大区,如"华东"(部分数据提供) |
network_type | string | IP应用场景类型(部分数据提供) |
错误码
| 状态码 | 含义 | 排查建议 |
200 | 成功 | — |
400 | IP 格式错误 | 检查 ip 参数是否合法 |
401 | Key 无效 / 不在白名单 | 检查 X-API-Key 和 IP 白名单 |
429 | 限流 / 配额耗尽 | 降低频率或联系管理员调额 |
502 | 上游无响应 | 稍后重试 |
cURL 示例
curl -X GET "https://api.jingxialai.com/api/ip?ip=8.8.8.8" \
-H "X-API-Key: ip_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json"
PHP 示例
$apiKey = "ip_live_xxxxxxxxxxxxxxxx";
$ip = "8.8.8.8";
$apiUrl = "https://api.jingxialai.com/api/ip?ip=" . $ip;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"X-API-Key: " . $apiKey,
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($err) {
echo "请求失败: " . $err;
} else {
$data = json_decode($response, true);
if ($httpCode == 200) {
foreach ($data as $key => $val) {
echo $key . ": " . $val . "\n";
}
} else {
echo "查询失败(HTTP " . $httpCode . "): " . $data['message'] . "\n";
}
}
Python 示例
import requests
api_key = "ip_live_xxxxxxxxxxxxxxxx"
ip = "8.8.8.8"
url = "https://api.jingxialai.com/api/ip"
headers = {"X-API-Key": api_key}
params = {"ip": ip}
response = requests.get(url, headers=headers, params=params, timeout=30)
if response.status_code == 200:
data = response.json()
for key, val in data.items():
print(f"{key}: {val}")
else:
result = response.json()
print(f"查询失败({response.status_code}): {result.get('message', '未知错误')}")
Node.js 示例
const https = require('https');
const apiKey = 'ip_live_xxxxxxxxxxxxxxxx';
const ip = '8.8.8.8';
const options = {
hostname: 'api.jingxialai.com',
path: `/api/ip?ip=${ip}`,
method: 'GET',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const result = JSON.parse(data);
if (res.statusCode === 200) {
for (const [key, val] of Object.entries(result)) {
console.log(key + ': ' + val);
}
} else {
console.log('查询失败:', result.message);
}
});
});
req.on('error', (e) => console.error('请求错误:', e.message));
req.setTimeout(30000, () => { req.destroy(); console.error('请求超时'); });
req.end();
快递查询 API
接口地址
GET https://api.jingxialai.com/api/express
请求参数
| 参数 | 类型 | 必须 | 说明 |
number | string | 是 | 运单编号 |
mobile | string | 否 | 收/寄件人 11 位手机号或后四位;顺丰、中通、跨越速运通常需要 |
expressCode | string | 否 | 快递公司编码,如圆通 YTO;不传则由系统自动识别 |
sort | string | 否 | asc 正序或 desc 倒序,默认 asc |
调用示例
curl -G "https://api.jingxialai.com/api/express" \
-H "X-API-Key: ip_live_xxxxxxxxxxxxxxxx" \
--data-urlencode "number=SF1234567890" \
--data-urlencode "mobile=1380" \
--data-urlencode "sort=desc"
响应说明
查询成功后返回快递公司、当前物流状态、最新物流信息和物流轨迹。具体字段以接口实际响应为准。
错误码
| 状态码 | 含义 | 排查建议 |
400 | 请求参数错误 | 检查运单编号、手机号、快递公司编码和排序参数 |
401 | API Key 无效或请求来源不在白名单 | 检查 X-API-Key 和 IP 白名单 |
403 | 快递查询服务未开通或账户已禁用 | 联系管理员确认服务权限 |
405 | 请求方式错误 | 请使用 GET 请求 |
429 | 请求过于频繁或可用次数不足 | 降低请求频率或联系管理员调整套餐 |
502 | 查询服务响应异常 | 稍后重试 |
503 | 查询服务暂时不可用 | 稍后重试 |
抖音视频解析 API
接口地址
GET https://api.jingxialai.com/api/douyin/video
请求参数
| 参数 | 类型 | 必须 | 说明 |
url | string | 是 | 原始 HTTPS 抖音分享链接。请直接传入链接,不要进行 Base64 编码;请求库会正常完成 URL 编码 |
鉴权与额度
在请求头中携带 X-API-Key。抖音视频解析使用独立的 QPS、日量、月量和并发额度,不消耗 IP、手机号、热点或快递额度。
X-API-Key: ip_live_xxxxxxxxxxxxxxxx
成功响应(200)
{
"code": 200,
"data": {
"title": "视频标题",
"cover": "https://example.com/video-cover.jpg",
"url": "https://example.com/video.mp4",
"width": 1080,
"height": 1920
}
}
下载地址有效期
data.url 为有时效性的下载地址,请在解析成功后及时使用,不要长期保存或缓存。
返回字段说明
| 字段 | 类型 | 说明 |
code | integer | 业务状态码,成功时为 200 |
data.title | string | 视频标题 |
data.cover | string | 视频封面地址 |
data.url | string | 有时效性的视频下载地址 |
data.width | integer | 视频宽度,单位为像素 |
data.height | integer | 视频高度,单位为像素 |
错误码
| 状态码 | 含义 | 排查建议 |
400 | 请求参数错误或不是有效的 HTTPS 抖音分享链接 | 检查 url 参数并直接传入原始分享链接 |
401 | API Key 无效或请求来源不在白名单 | 检查 X-API-Key 和 IP 白名单 |
403 | 抖音视频解析服务未开通或账户已禁用 | 联系管理员确认服务权限 |
405 | 请求方法不支持 | 请使用 GET 请求 |
429 | 请求过于频繁或抖音解析额度不足 | 降低请求频率或联系管理员调整套餐 |
502 | 上游返回异常或视频解析失败 | 确认分享链接有效后稍后重试 |
503 | 解析服务未配置或暂时不可用 | 稍后重试或联系管理员 |
cURL 示例
curl -G "https://api.jingxialai.com/api/douyin/video" \
-H "X-API-Key: ip_live_xxxxxxxxxxxxxxxx" \
--data-urlencode "url=https://v.douyin.com/xxxxxxxx/"
PHP 示例
$apiKey = 'ip_live_xxxxxxxxxxxxxxxx';
$shareUrl = 'https://v.douyin.com/xxxxxxxx/';
$url = 'https://api.jingxialai.com/api/douyin/video?' . http_build_query([
'url' => $shareUrl,
]);
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . $apiKey],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
$result = json_decode($response, true);
if ($status !== 200 || ($result['code'] ?? 0) !== 200) {
throw new RuntimeException($result['message'] ?? $result['msg'] ?? '解析失败');
}
print_r($result['data']);
Python 示例
import requests
response = requests.get(
'https://api.jingxialai.com/api/douyin/video',
headers={'X-API-Key': 'ip_live_xxxxxxxxxxxxxxxx'},
params={'url': 'https://v.douyin.com/xxxxxxxx/'},
timeout=30,
)
response.raise_for_status()
result = response.json()
if int(result.get('code', 0)) != 200:
raise RuntimeError(result.get('message') or result.get('msg') or '解析失败')
print(result['data'])
手机号归属地 API
接口地址
GET https://api.jingxialai.com/api/phone
请求参数
| 参数 | 类型 | 必须 | 说明 |
phone | string | 是 | 要查询的 11 位手机号码 |
鉴权方式
在请求头中携带 API Key(与 IP 查询完全共用同一套餐额度):
X-API-Key: ip_live_xxxxxxxxxxxxxxxx
成功响应(200)
{
"province": "广东省",
"city": "深圳市",
"zip_code": "518000",
"area_code": "0755",
"isp": "中国移动",
"prefix": "1380013"
}
返回字段说明
| 字段 | 类型 | 说明 |
province | string | 手机号所属省份 |
city | string | 手机号所属城市 |
zip_code | string | 城市邮政编码 |
area_code | string | 长途电话区号 |
isp | string | 基础运营商或虚拟运营商名称 |
prefix | string | 匹配到的号段(前7位) |
错误码
| 状态码 | 含义 | 排查建议 |
200 | 成功 | — |
400 | 手机号格式错误 | 检查 phone 参数是否为 11 位数字 |
404 | 号码未找到 | 该号段可能不存在于离线库中 |