{ "code": 0, "charge": false, "remainTimes": 4998, "remainSeconds": -1, "msg": "查询成功", "result": { "code": 0, "message": "success", "request_id": "815774d6ed6ca43e5d0cce316d36d822", "result": { "checker": "盛霞", "drawer": "张立辉", "buyer_address": "德徽长丰双凤经济开发区淮南北路与双凤路交叉口950618", "buyer_bank": "开户行及账事国银行长丰支行182745058998", "buyer_name": "安徽省京邦达供应链科技有限公司", "buyer_tax_no": "91340121MA2NXC8K97", "code": "3100191130", "invoice_amount": "183.50", "invoice_date": "20190722", "invoice_no": "35659539", "invoice_type": "01", "payee": "赵圆容", "saler_address": "上海市嘉定区永盛路2739-2731号(单号)二层、永盛路2763号二层18001982788", "saler_bank": "中国农业银行股份有限公司上海新成分理处03832710040006850", "saler_name": "葡萄商务酒店(上海)有限公司", "saler_tax_no": "91310114MA1GUE1L3N", "tax_amount": "5.50", "total_amount": "189.00", "verify_code": "44095028783173850994" } } }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2021/05/01 15:26 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://way.jd.com/JDAI/ocr_invoice?appkey=appkey&body=image'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://way.jd.com/JDAI/ocr_invoice?appkey=appkey&body=image" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }