💡 ToolFK provides all tools free of charge. The ads you see help us keep the site running sustainably. Thank you for your support! ❤️ ToolFK tools are free. Ads help keep the site running. Thanks! ❤️

身份证归属地 API

提供精准在线身份证号码归属地与信息查询,支持API接口调用,一键获取身份验证数据,助力开发与安全。

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/idcard | 在线体验接口
请求方法: [ "GET", "POST" ]
请求参数:
名称类型描述示例
tokenstring请求的token用户中心获取token
contentstring身份证号522424xxxxxxx0015
-- Response Format --
返回数据:
{
    "status": 1,
    "data": {
        "addressCode": "522424",
        "abandoned": 1,
        "address": "贵州省毕节地区金沙县",
        "addressTree": [
            "贵州省",
            "毕节地区",
            "金沙县"
        ],
        "birthdayCode": "xxxx-09-01",
        "constellation": "处女座",
        "chineseZodiac": "亥猪",
        "sex": "男",
        "length": 18,
        "checkBit": "5",
        "age": 15
    }
}
                
Code Examples:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
curl -X POST \
  http://api.toolfk.com/api/idcard \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'token=用户中心获取&content=522424xxxxxxx0015'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/idcard",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "token=用户中心获取&content=522424xxxxxxx0015",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取&content=522424xxxxxxx0015");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/idcard")
  .post(body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();

Response response = client.newCall(request).execute();
import requests

url = "http://api.toolfk.com/api/idcard"

payload = "token=用户中心获取&content=522424xxxxxxx0015"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
var data = "token=用户中心获取&content=522424xxxxxxx0015";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        if (this.readyState === 4 && this.status >= 400) {
            layer.msg('Request failed: ' + this.status);
        }
    }
});

xhr.open("POST", "http://api.toolfk.com/api/idcard");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {
	url := "http://api.toolfk.com/api/idcard"
	payload := strings.NewReader("token=用户中心获取&content=522424xxxxxxx0015")

	req, _ := http.NewRequest("POST", url, payload)
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))
}
返回状态码 status 描述参照
返回码描述
status1:表示成功,0:表示失败
data成功返回数据
errmsg失败返回数据
Note: By subscribing to the API service, you will also enjoy VIP membership benefits on www.toolfk.com.