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

下篇:热门免费 API 集合(附接入代码示例)

1、AI 绘画:通过AI 生成图片,包括图生文、文生图等。

HTTP 接入示例:

POST  /aigc/txt2img HTTP/1.1
Host: 23329.o.apispace.com
X-APISpace-Token:
Authorization-Type:apikey
Content-Type:

{"task":null,"params":{"model":null,"text":null,"w":null,"h":null,"guidance_scale":null,"negative_prompt":null,"sampler":null,"seed":null,"num_steps":null},"notify_url":null}

2运营商三要素 API:输入姓名、身份证号码、手机号码,验证此三种信息是否一致,返回验证结果、手机归属地、运营商名称。

Python 接入示例:

import http.client

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

payload = "name=&idNum=&mobile="

headers = {
    "X-APISpace-Token":"",
    "Authorization-Type":"apikey",
    "Content-Type":""
}

conn.request("POST","/carriers/carriers-auth", payload, headers)

res = conn.getresponse()

data = res.read()

print(data.decode("utf-8"))

3、二维码识别OCR:对图片中的二维码、条形码进行检测和识别,返回存储的文字内容。

PHP 接入示例:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://eolink.o.apispace.com/ocrbarcode/ocr/v1/barcode",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"image\":null,\"url\":null,\"pdf\":null,\"pdf_page\":null}",
  CURLOPT_HTTPHEADER => array(
    "X-APISpace-Token:",
    "Authorization-Type:apikey",
    "Content-Type:application/json"
  ),
));

$response = curl_exec($curl);

$err = curl_error($curl);

curl_close($curl);

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

4、发票核验:发票真伪验证服务,根据发票类型代码和发票四要素获取发票全票面信息,支持全国增值税专用发票、增值税普通发票(含电子普通发票、卷式发票、通行费发票)、机动车销售统一发票、货物运输业增值税专用发票、二手车销售统一发票等不同发票的验真。

JavaScript 接入示例:

var data = "{\"date\":\"20180101\",\"number\":\"12341234\",\"code\":\"1234123412\",\"verifyCode\":\"123132\",\"priceWithoutTax\":\"123.12\",\"type\":\"01\"}"

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

xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("POST", "https://eolink.o.apispace.com/fphy2/fapiao2");
xhr.setRequestHeader("X-APISpace-Token","");
xhr.setRequestHeader("Authorization-Type","apikey");
xhr.setRequestHeader("Content-Type","application/json");

xhr.send(data);

5、全国快递物流地图轨迹查询:通过物流单号和收寄件地址,自动评估物流时效,并在地图中展示包裹运输轨迹。包括顺丰、圆通、申通等主流快递公司。自动识别快递公司及单号,实时查询,稳定高效,服务器毫秒响应,数据及时准确。

微信小程序接入示例:

var data = "{\"cpCode\":null,\"mailNo\":null,\"phone\":null,\"origin\":null,\"destination\":null,\"receiveAddress\":null,\"responseModel\":null}"

wx.request({
    "url":"https://eolink.o.apispace.com/wldtgj1/paidtobuy_api/trace_map",
    "method": "POST",
    "header": {
        "X-APISpace-Token":"",
        "Authorization-Type":"apikey",
        "Content-Type":""
    },
    "data": data,
    "success": (response)=> {
        console.log(response.data)
    }
})

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":"",
        "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();

Last Updated on 2023-07-27 by admin