獲取市場溫度
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