{ "code": "10000", "charge": false, "remain": 0, "remainTimes": -1, "remainSeconds": -1, "msg": "查询成功", "result": { "items": [{ "cid_list": [{ "root": "玩具乐器", "score": 0.9708835 }, { "root": "母婴", "score": 0.89061433 }, { "root": "童车童床", "score": 0.941696 }, { "root": "电动车", "score": 0.65561 }], "rectangle": { "bottom": 538.3639892578125, "confidence": 0.6000407338142395, "left": 66.85603637695313, "right": 852.2189208984374, "top": 111.47796020507812 } }], "message": "Inference Succeed!", "status": "0" } }
<?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/image_recognition_product?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/image_recognition_product?appkey=appkey&body=images" ) 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)) }