获取市场温度
curl --request GET \
--url https://openapi.fcontext.com/api/market-data/market/temperature \
--header 'x-api-key: <api-key>'import requests
url = "https://openapi.fcontext.com/api/market-data/market/temperature"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://openapi.fcontext.com/api/market-data/market/temperature', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.fcontext.com/api/market-data/market/temperature",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.fcontext.com/api/market-data/market/temperature"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.fcontext.com/api/market-data/market/temperature")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.fcontext.com/api/market-data/market/temperature")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"temperature": {
"market": 123,
"temperature": 123,
"timestamp": "2023-11-07T05:31:56Z",
"records": [
{}
]
}
}{
"error": "<string>"
}{
"error": "Unauthorized: missing API key"
}市场
获取市场温度
获取当前市场温度;当 history=true 时,返回请求日期范围内的历史市场温度。
GET
/
api
/
market-data
/
market
/
temperature
获取市场温度
curl --request GET \
--url https://openapi.fcontext.com/api/market-data/market/temperature \
--header 'x-api-key: <api-key>'import requests
url = "https://openapi.fcontext.com/api/market-data/market/temperature"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://openapi.fcontext.com/api/market-data/market/temperature', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.fcontext.com/api/market-data/market/temperature",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.fcontext.com/api/market-data/market/temperature"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.fcontext.com/api/market-data/market/temperature")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.fcontext.com/api/market-data/market/temperature")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"temperature": {
"market": 123,
"temperature": 123,
"timestamp": "2023-11-07T05:31:56Z",
"records": [
{}
]
}
}{
"error": "<string>"
}{
"error": "Unauthorized: missing API key"
}授权
ApiKeyHeaderBearerAuth
在账户设置中生成的 Financial Context key。请以 x-api-key: <key> 形式发送。
查询参数
市场代码。支持 HK(默认)、US、CN/SH/SZ 和 SG。
是否返回历史序列。
历史开始日期 YYYY-MM-DD。省略时,默认使用结束日期前 30 天。
历史结束日期 YYYY-MM-DD。省略时,默认使用当前日期。
响应
市场温度
市场温度快照或历史序列数据。
Show child attributes
Show child attributes
⌘I