SDK
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketCandlesticks('MARKET_TICKER');
curl --request GET \
--url https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks \
--header 'x-api-key: <api-key>'import requests
url = "https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks"
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks', 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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks",
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks"
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks")
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{
"count": 1,
"data": [
{
"close": 123,
"exchange": "<string>",
"high": 123,
"low": 123,
"open": 123,
"periodInterval": "<string>",
"ticker": "<string>",
"timestamp": "<string>",
"tradeCount": 1,
"volume": 123
}
],
"hasMore": true,
"cursor": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}Markets
预测市场 OHLCV K 线 API
获取单个 Kalshi 或 Polymarket 市场的 OHLCV K 线,可设置周期和时间范围,用游标翻页。GET /v1/markets//candlesticks。
GET
/
v1
/
markets
/
{ticker}
/
candlesticks
SDK
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketCandlesticks('MARKET_TICKER');
curl --request GET \
--url https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks \
--header 'x-api-key: <api-key>'import requests
url = "https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks"
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks', 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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks",
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks"
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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/candlesticks")
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{
"count": 1,
"data": [
{
"close": 123,
"exchange": "<string>",
"high": 123,
"low": 123,
"open": 123,
"periodInterval": "<string>",
"ticker": "<string>",
"timestamp": "<string>",
"tradeCount": 1,
"volume": 123
}
],
"hasMore": true,
"cursor": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}SDK Example
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketCandlesticks('MARKET_TICKER');
授权
Solana Tracker Data API key
路径参数
Market ticker or condition id
查询参数
kalshi, polymarket, or poly
Candle period (default 1h)
Start timestamp
End timestamp
Max candles (default 200, max 2000)
必填范围:
x >= 0Pagination cursor (overrides start_ts)
此页面对您有帮助吗?