Part 2: A collection of popular free APIs (attached with access code samples)

1. Notification SMS : When you need to quickly notify users, notification SMS is the fastest and most effective way. SMS notification supports the three major operators and virtual operators. We provide carrier-level operation and maintenance guarantees and exclusive dedicated channels.

Java access example:

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{"msg":"","params":"","sendtime":"","extend":"","uid":""}");
Request request = new Request.Builder()
  .url("https://eolink.o.apispace.com/sms-notify/notify")
  .method("POST",body)
  .addHeader("X-APISpace-Token","")
  .addHeader("Authorization-Type","apikey")
  .addHeader("Content-Type","")
  .build();

Response response = client.newCall(request).execute();
System.out.println(response.body().string());

2. Air quality query : Supports point-by-point observation of 3,400+ cities in China, with point-of-point observation data of air quality monitoring points (a total of 2,335 across the country) .

Example of Python access:

import requests

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

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

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

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

print(response.text)

3. Two-dimensional code recognition OCR : detect and recognize the two-dimensional code and barcode in the picture, and return the stored text content.

Example of PHP access:

<?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. Invoice verification : invoice authenticity verification service, obtain the full face information of the invoice according to the invoice type code and the four elements of the invoice, support the national VAT special invoices, VAT ordinary invoices (including electronic ordinary invoices, roll invoices, and toll invoices) , Verification of different invoices such as uniform invoices for motor vehicle sales, special value-added tax invoices for the cargo transportation industry, and uniform invoices for used car sales.

JavaScript access example:

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. National express logistics map trajectory query : automatically evaluate the logistics timeliness through the logistics order number and receiving and sending address, and display the package transportation trajectory on the map. Including SF, YTO, STO and other mainstream express companies. Automatically identify the courier company and tracking number, real-time query, stable and efficient, the server responds in milliseconds, and the data is timely and accurate.

Example of WeChat applet access:

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. Empty number detection : Query its online activity through the mobile phone number, and return the status including empty number, real number, downtime, no inventory, silent number, risky number, etc.

NodeJS access example:

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();

Guess you like

Origin blog.csdn.net/m0_58974397/article/details/131933943