今日油价API接口

今日成品油价格查询网提供最新92号汽油价格和95号汽油油价,今天0号柴油国内各省最新今日油价查询。

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/youjia
请求方法: [ "GET", "POST" ]
请求参数:
名称 类型 描述 示例
token string 请求的token 用户中心获取token
-- 漂亮的分割符 --
返回数据:

{
    "status": 1,
    "data": [
        {
            "area": "北京",
            "y89": null,
            "y92": "7.14",
            "y95": "7.60",
            "y98": "8.58",
            "y0": "6.83",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "上海",
            "y89": null,
            "y92": "7.11",
            "y95": "7.56",
            "y98": "8.51",
            "y0": "6.76",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "天津",
            "y89": null,
            "y92": "7.13",
            "y95": "7.54",
            "y98": "8.76",
            "y0": "6.79",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "重庆",
            "y89": null,
            "y92": "7.21",
            "y95": "7.62",
            "y98": "8.58",
            "y0": "6.86",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "福建",
            "y89": null,
            "y92": "7.11",
            "y95": "7.59",
            "y98": "8.31",
            "y0": "6.78",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "甘肃",
            "y89": null,
            "y92": "7.14",
            "y95": "7.62",
            "y98": "7.99",
            "y0": "6.69",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "广东",
            "y89": null,
            "y92": "7.16",
            "y95": "7.76",
            "y98": "8.90",
            "y0": "6.79",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "广西",
            "y89": null,
            "y92": "7.20",
            "y95": "7.78",
            "y98": "8.60",
            "y0": "6.85",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "贵州",
            "y89": null,
            "y92": "7.27",
            "y95": "7.68",
            "y98": "8.58",
            "y0": "6.89",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "海南",
            "y89": null,
            "y92": "8.26",
            "y95": "8.77",
            "y98": "9.91",
            "y0": "6.87",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "河北",
            "y89": null,
            "y92": "7.13",
            "y95": "7.54",
            "y98": "8.36",
            "y0": "6.79",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "河南",
            "y89": null,
            "y92": "7.15",
            "y95": "7.63",
            "y98": "8.29",
            "y0": "6.77",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "湖北",
            "y89": null,
            "y92": "7.15",
            "y95": "7.65",
            "y98": "8.63",
            "y0": "6.78",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "湖南",
            "y89": null,
            "y92": "7.10",
            "y95": "7.54",
            "y98": "8.34",
            "y0": "6.85",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "吉林",
            "y89": null,
            "y92": "7.11",
            "y95": "7.66",
            "y98": "8.35",
            "y0": "6.71",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "江苏",
            "y89": null,
            "y92": "7.12",
            "y95": "7.57",
            "y98": "8.55",
            "y0": "6.75",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "江西",
            "y89": null,
            "y92": "7.11",
            "y95": "7.63",
            "y98": "9.13",
            "y0": "6.83",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "辽宁",
            "y89": null,
            "y92": "7.12",
            "y95": "7.59",
            "y98": "8.26",
            "y0": "6.70",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "内蒙古",
            "y89": null,
            "y92": "7.08",
            "y95": "7.56",
            "y98": "8.29",
            "y0": "6.67",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "安徽",
            "y89": null,
            "y92": "7.10",
            "y95": "7.61",
            "y98": "8.44",
            "y0": "6.82",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "宁夏",
            "y89": null,
            "y92": "7.05",
            "y95": "7.45",
            "y98": "8.51",
            "y0": "6.68",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "青海",
            "y89": null,
            "y92": "7.10",
            "y95": "7.61",
            "y98": "8.29",
            "y0": "6.72",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "山东",
            "y89": null,
            "y92": "7.12",
            "y95": "7.64",
            "y98": "8.36",
            "y0": "6.78",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "陕西",
            "y89": null,
            "y92": "7.03",
            "y95": "7.43",
            "y98": "8.29",
            "y0": "6.69",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "山西",
            "y89": null,
            "y92": "7.10",
            "y95": "7.66",
            "y98": "8.36",
            "y0": "6.85",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "四川",
            "y89": null,
            "y92": "7.24",
            "y95": "7.74",
            "y98": "8.41",
            "y0": "6.84",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "西藏",
            "y89": null,
            "y92": "8.03",
            "y95": "8.49",
            "y98": "-",
            "y0": "7.33",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "黑龙江",
            "y89": null,
            "y92": "7.15",
            "y95": "7.64",
            "y98": "8.67",
            "y0": "6.64",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "新疆",
            "y89": null,
            "y92": "7.04",
            "y95": "7.58",
            "y98": "8.47",
            "y0": "6.67",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "云南",
            "y89": null,
            "y92": "7.29",
            "y95": "7.82",
            "y98": "8.50",
            "y0": "6.86",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "浙江",
            "y89": null,
            "y92": "7.12",
            "y95": "7.57",
            "y98": "8.29",
            "y0": "6.77",
            "update_date": "2022/1/15 3:12:09"
        },
        {
            "area": "深圳",
            "y89": null,
            "y92": "7.16",
            "y95": "7.76",
            "y98": "8.90",
            "y0": "6.79",
            "update_date": "2022/1/15 3:12:09"
        }
    ]
}
                
                            
代码示例:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
  • Nodejs

    curl -X POST \
    http://api.toolfk.com/api/youjia \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'token=用户中心获取'
                                       
//记得去掉这个 "\" 斜线
<\?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/youjia",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "token=用户中心获取",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

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

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/youjia")
  .post(body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();

Response response = client.newCall(request).execute();


                                       
import requests

url = "http://api.toolfk.com/api/youjia"

payload = "token=用户中心获取"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
var data = "token=用户中心获取";

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

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

xhr.open("POST", "http://api.toolfk.com/api/youjia");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);
                                       
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://api.toolfk.com/api/youjia"

	payload := strings.NewReader("token=用户中心获取")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	async res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                                       
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://api.toolfk.com/api/youjia"

        payload := strings.NewReader("{
          "token": "用户中心获取token",
          "type": "a",
          "format": "json"
        }")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	async res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                                       
返回状态码 status 描述参照
返回码 描述
status 1:表示成功,0:表示失败
data 成功返回数据
errmsg 失败返回数据
备注:开通API接口服务,可同时享用 www.toolfk.com 网站的会员工具。