接口地址:https://p.3.cn/prices/mgets |
---|
返回格式:json |
请求方式:get/post |
请求示例:https://p.3.cn/prices/mgets?skuIds=100026761926 |
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
skuIds | string | 必填 | 京东id |
名称 | 类型 | 说明 |
---|---|---|
op | string | 价格 |
[{
"p": "4049.00",
"op": "4599.00",
"cbf": "0",
"id": "J_100026761926",
"l": "4599.00",
"m": "4599.00"
}]
错误码 | 说明 |
---|---|
- | - |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2022/04/08 11:38
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://p.3.cn/prices/mgets?skuIds=100026761926';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://p.3.cn/prices/mgets?skuIds=100026761926"
)
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))
}