marketstringwajib
The market (asset id) to query.
https://api.sandbase.ai/v1/api/polymarket/prices-historyGet prices history from Polymarket. Returns the official Polymarket API response unchanged.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
Returns the price history of one Polymarket outcome token as a list of timestamped prices. It needs a market value, which is the asset (token) id, and accepts optional interval, fidelity, startTs and endTs parameters.
startTs and endTs.curl -X POST "https://api.sandbase.ai/v1/api/polymarket/prices-history" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"market": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "interval": "1w", "fidelity": 60}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
market | string | Yes | The market (asset id) to query. |
endTs | number | No | Filter by items before this unix timestamp. |
fidelity | integer | No | Accuracy of the data expressed in minutes. Default is 1 minute. |
interval | string | No | Time interval for data aggregation. |
startTs | number | No | Filter by items after this unix timestamp. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"history": [
{
"p": 0.0375,
"t": 1793088028
}
]
}
| Field | Meaning |
|---|---|
history | List of price points for the requested market, in time order. |
history[].p | Price of the outcome token at that point. The values in this response sit between 0 and 1, such as 0.0375. |
history[].t | Unix timestamp in seconds for the price point. |
market is the asset (token) id, a long numeric string. Use Polymarket Get market by slug to look up a market and find its token ids.fidelity is 60 and the points are about 3,600 seconds apart, which matches one point per hour.$0.012 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
curl -X POST "https://api.sandbase.ai/v1/api/polymarket/prices-history" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fidelity": 60,
"interval": "1w"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
marketstringwajibThe market (asset id) to query.
endTsnumberFilter by items before this unix timestamp.
fidelityintegerAccuracy of the data expressed in minutes. Default is 1 minute.
intervalstringTime interval for data aggregation.
Nilai yang mungkin: max, all, 1m, 1w, 1d, 6h, 1h
startTsnumberFilter by items after this unix timestamp.
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
Belum ada respons tersimpan yang dipublikasikan. Jalankan API di Playground untuk melihat responsnya.
Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
Polymarket | $0.012 per panggilan | JSON |
Polymarket | $0.012 per panggilan | JSON |
Polymarket | $0.012 per panggilan | JSON |
Polymarket | $0.012 per panggilan | JSON |
Polymarket | $0.012 per panggilan | JSON |
Polymarket | $0.012 per panggilan | JSON |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/polymarket/prices-history dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
$0.012 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Wajib: market (string). Opsional: endTs (number), fidelity (integer), interval (salah satu dari max, all, 1m, 1w, 1d, 6h, 1h) dan startTs (number). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.
Tidak. Polymarket Get prices history berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Polymarket secara terpisah.