为超过 100 万开发者提供专业的 API 服务,所有 API 均提供免费的服务

开发常用的好用API接口,含免费次数(附代码示例)

开发常用的好用API接口,含免费次数(附代码示例)
1、手机号码归属地:提供三大运营商的手机号码归属地查询。

Python 接入示例:

import http.client

conn = http.client.HTTPSConnection("eolink.o.apispace.com")

payload = "mobile="

headers = {
    "X-APISpace-Token":"API密钥,登录 APISpace 获取",
    "Authorization-Type":"apikey",
    "Content-Type":""
}

conn.request("POST","/teladress/teladress", payload, headers)

res = conn.getresponse()

data = res.read()

print(data.decode("utf-8"))
2 空气质量查询:支持国内3400+个城市的整点观测,并附带空气质量监测点(全国共2335个)的整点观测数据。

Python 接入示例:

import requests

url = "https://eolink.o.apispace.com/34324/air/v001/aqi"

payload = {"areacode" : "101010100","lonlat" : "116.407526,39.904030"}

headers = {
    "X-APISpace-Token":"API密钥,登录 APISpace 获取",
    "Authorization-Type":"apikey"
}

response=requests.request("GET", url, params=payload, headers=headers)

print(response.text)
3、短信验证码:可用于登录、注册、找回密码、支付认证等等应用场景。支持三大运营商,3秒可达,99.99%到达率,支持大容量高并发。

微信小程序接入示例:

var data = "{"msg":"","params":"","sendtime":"","extend":"","uid":""}"

wx.request({
    "url":"https://eolink.o.apispace.com/sms-code/verifycode",
    "method": "POST",
    "header": {
        "X-APISpace-Token":"API密钥,登录 APISpace 获取",
        "Authorization-Type":"apikey",
        "Content-Type":""
    },
    "data": data,
    "success": (response)=> {
        console.log(response.data)
    }
})
4、天气预警:支持输入经纬度或者区域编码,获取指定城市当前生效中的各类天气预警,如寒潮蓝色预警信号,或一次性拉取全国所有生效中的天气预警。

Java 接入示例:

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
Request request = new Request.Builder()
  .url("https://eolink.o.apispace.com/467456/weather/v001/alarm?areacode=101010100&lonlat=116.407526,39.904030")
  .method("GET",null)
  .addHeader("X-APISpace-Token","API密钥,登录 APISpace 获取")
  .addHeader("Authorization-Type","apikey")
  .build();

Response response = client.newCall(request).execute();
System.out.println(response.body().string());
5、企业基本信息:通过公司名称/公司ID/注册号或社会统一信用代码获取企业基本信息,企业基本信息包括公司名称或ID、类型、成立日期、经营状态、注册资本、法人、工商注册号、统一社会信用代码、组织机构代码、纳税人识别号等字段信息。

JavaScript 接入示例:

var data = {

}

$.ajax({
    "url":"https://eolink.o.apispace.com/baseinfo/normal?keyword=%E8%B4%B5%E5%B7%9E%E5%8A%9B%E6%BA%90%E6%B6%B2%E5%8E%8B%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8",
    "method": "GET",
    "headers": {
        "X-APISpace-Token":"API密钥,登录 APISpace 获取",
        "Authorization-Type":"apikey"
    },
    "data": data,
    "crossDomain": true
})
    .done(function(response){})
    .fail(function(jqXHR){})
6、空号检测:通过手机号码查询其在网活跃度,返回包括空号、实号、停机、库无、沉默号、风险号等状态。

NodeJS 接入示例:

var qs = require("querystring");
var http = require("https");
var requestInfo={
    "method": "POST",
    "hostname": "eolink.o.apispace.com",
    "path": "/konghao/batch-ucheck",
    "headers": {
        "X-APISpace-Token":"API密钥,登录 APISpace 获取",
        "Authorization-Type":"apikey",
        "Content-Type":""
   }
};

var req = http.request(requestInfo, function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
    });
});

req.write(qs.stringify({
        "mobiles": "",
        "type": ""
}));
req.end();
7、IP归属地-IPv4区县级:根据IP地址查询归属地信息,包含43亿全量IPv4,支持到中国地区(不含港台地区)区县级别,含运营商数据。

NodeJS 接入示例:

var request = require("request");
var requestInfo={
   method: "GET",
   url: "https://eolink.o.apispace.com/ipguishu/ip/geo/v1/district?ip=1.45.124.145&coordsys=WGS84",
   headers: {
      "X-APISpace-Token":"API密钥,登录 APISpace 获取",
      "Authorization-Type":"apikey"
   },
   form: {

   }
};

request(requestInfo, function (error, response, body) {
    if (error) throw new Error(error);
    console.log(body);
});

Last Updated on 2024-02-29 by admin