手机号码归属地

GET
https://api.xuewutheme.com/api/info/phone

快速查询手机号码归属地等信息

接口概述

请求示例: https://api.xuewutheme.com/api/info/phone?apikey=用户开通的apikey&phone=13812345678

快速查询手机号码归属地等信息

请求参数

参数名 类型 必填 描述
apikey string 整数 string

用户开通的apikey

phone string 整数 string

电话号码

响应参数

成功响应

状态码: 200 OK
格式: json
参数名 类型 描述
code integer integer

返回的状态码

data.phone string string

完整电话号码(国际格式)

data.country_code string string

国家代码

data.national_number number number

国内号码(不含国家代码)

data.location string string

号码归属地

data.carrier string string

运营商名称

data.time_zones array array

时区列表

data.number_type string string

号码类型

data.format.international string string

国际格式号码

data.format.national string string

国内格式号码

msg string string

返回的消息

time string string

请求时间

响应示例

JSON
{
    "code": 200,
    "data": {
        "carrier": "中国移动",
        "country_code": "+86",
        "format": {
            "international": "+86 138 1234 5678",
            "national": "138 1234 5678"
        },
        "location": "江苏省连云港市",
        "national_number": 13812345678,
        "number_type": "移动电话",
        "phone": "+86 138 1234 5678",
        "time_zones": [
            "Asia/Shanghai"
        ]
    },
    "msg": "请求成功!",
    "time": "2025-03-12 21:17:37"
}

请求示例

cURL

Bash
curl -X GET \
  "https://api.example.com/v1/users/12345" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"

Python

Python
import requests

url = "https://api.example.com/v1/users/12345"
headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())

JavaScript

JavaScript
const response = await fetch(
  'https://api.example.com/v1/users/12345',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
      'Content-Type': 'application/json'
    }
  }
);

const data = await response.json();
console.log(data);

PHP

PHP
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.example.com/v1/users/12345");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

$headers = array();
$headers[] = "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...";
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

curl_close($ch);

错误码

状态码 描述
100 您的apikey值为空!
101 您的apikey值不存在!
103 当前接口为实名认证后可用,请您先进行实名!
104 请求频率超限!
105 接口不存在或已下线!
106 您的余额不足,请及时充值!
107 您当前的接口免费使用次数已用完,请明日再来!
109 您的账号已被封禁,不可使用任何接口!
110 接口维护中,请稍后再试!
111 请求参数不完整,请检查后再次访问!

错误响应示例

JSON
{
  "code": 1001,
  "message": "用户不存在",
  "data": null
}