marketstringобязательно
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.
Ваш результат появится здесь
Заполните входные данные, затем нажмите «Запустить».
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.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
marketstringобязательноThe 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.
Возможные значения: max, all, 1m, 1w, 1d, 6h, 1h
startTsnumberFilter by items after this unix timestamp.
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
Сохранённый ответ не опубликован. Запустите API в Playground, чтобы посмотреть его ответ.
Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
Polymarket Get prices historyЭтот API Polymarket | $0.012 за запрос | JSON |
Polymarket | $0.012 за запрос | JSON |
Polymarket | $0.012 за запрос | JSON |
Polymarket | $0.012 за запрос | JSON |
Polymarket | $0.012 за запрос | JSON |
Polymarket | $0.012 за запрос | JSON |
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/polymarket/prices-history, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.012 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: market (string). Необязательные: endTs (number), fidelity (integer), interval (один из max, all, 1m, 1w, 1d, 6h, 1h) и startTs (number). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. Polymarket Get prices history работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API Polymarket.