首页 全部接口 API文档 文章 贡献者 友链 赞助 关于
登录/注册

手机号归属地查询

GET https://api.xunjinlu.fun/api/74/index.php

手机号归属地查询API文档

接口简介

本接口提供手机号归属地查询服务,用户可以通过传入11位手机号码,获取归属地、区号、邮编及行政区划码等全维度数据。

请求说明

  • 请求地址:https://api.xunjinlu.fun/api/74/index.php
  • 请求方法:GET
  • 请求头:无特殊请求头要求

请求参数

参数名类型是否必填说明
keystring接口访问密钥(开启密钥访问时必填)
mobilestring需要查询的11位手机号

返回参数

参数名类型说明
codeinteger状态码,200表示成功
msgstring描述信息,成功时为"success"
dataobject返回的具体数据
- mobilestring查询的手机号
- locationstring归属地
- area_codestring区号
- postcodestring邮编
- division_codestring行政区划码
api_infoobject接口信息
- developerstring开发者
- blogstring开发者博客
- api_platformstringAPI平台

返回示例

成功响应

{
    "code": 200,
    "msg": "success",
    "data": {
        "mobile": "13000000000",
        "location": "云南 曲靖 联通",
        "area_code": "0874",
        "postcode": "655000",
        "division_code": "530300"
    },
    "api_info": {
        "developer": "尋鯨錄",
        "blog": "https://www.xunjinlu.fun",
        "api_platform": "https://api.xunjinlu.fun"
    }
}

失败响应

{
    "code": 404,
    "msg": "手机号不存在"
}

错误码说明

  • 404:手机号不存在

调用示例

直接访问链接

手机号归属地查询API

cURL命令示例

curl -X GET "https://api.xunjinlu.fun/api/74/index.php?key=YOUR_KEY&mobile=13000000000"

JavaScript (fetch) 示例

fetch('https://api.xunjinlu.fun/api/74/index.php?key=YOUR_KEY&mobile=13000000000')
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

jQuery AJAX 示例

$.ajax({
    url: 'https://api.xunjinlu.fun/api/74/index.php?key=YOUR_KEY&mobile=13000000000',
    type: 'GET',
    dataType: 'json',
    success: function(data) {
        console.log(data);
    },
    error: function(error) {
        console.error('Error:', error);
    }
});

Python (requests) 示例

import requests

url = 'https://api.xunjinlu.fun/api/74/index.php'
params = {
'key': 'YOUR_KEY',
'mobile': '13000000000'
}

response = requests.get(url, params=params)
data = response.json()
print(data)

PHP (curl) 示例

$url = 'https://api.xunjinlu.fun/api/74/index.php';
$params = array(
    'key' => 'YOUR_KEY',
    'mobile' => '13000000000'
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);

HTML (iframe/img/script标签)

图片