🔗 JSON-RPC API
JSON-RPC proxy for Prediction Markets REST endpoints.
Prediction Markets - JSON RPC
Overview
Our JSON-RPC implementation is a thin proxy around the Prediction Markets REST API. It does not define separate RPC operations. Instead, it forwards JSON-RPC calls to the same REST resources.
methodis the REST path, for examplev1/markets/{exchange_id}/activeparamsis converted into REST path parameters and query string parameters- Keys used in placeholders are substituted into the path
- Remaining keys are appended to the request as query string values
Endpoint
Access Prediction Markets via JSON-RPC at:
| Environment | Encryption | Value |
|---|---|---|
| Production | Yes | https://api.prediction-markets.finfeedapi.com/jsonrpc |
Authentication
Authentication is exactly the same as for the REST API. See the authentication section.
Request Format
Use a JSON-RPC 2.0 request where method contains the REST path and params is an object:
{
"jsonrpc": "2.0",
"method": "v1/ohlcv/{exchange_id}/{market_id}/history",
"params": {
"exchange_id": "POLYMARKET",
"market_id": "WILL-RAIN-YES",
"period_id": "1DAY",
"time_start": "2025-01-01T00:00:00Z",
"time_end": "2025-01-31T23:59:59Z",
"limit": 100
},
"id": 1
}The request above is proxied to:
GET /v1/ohlcv/POLYMARKET/WILL-RAIN-YES/history?period_id=1DAY&time_start=2025-01-01T00:00:00Z&time_end=2025-01-31T23:59:59Z&limit=100API Design Mapping
The proxy follows the REST structure of the Prediction Markets API, including:
- Exchanges:
v1/exchangesandv1/exchanges/{exchange_id} - Markets:
v1/markets/{exchange_id}/historyandv1/markets/{exchange_id}/active - Market activity:
v1/activity/{exchange_id}/{market_id}/current,latest, and history endpoints - OHLCV:
v1/ohlcv/periods,v1/ohlcv/{exchange_id}/{market_id}/history,latest - Order books:
v1/orderbook/{exchange_id}/{market_id}/currentandhistory
Examples
Exchanges
{
"jsonrpc": "2.0",
"method": "v1/exchanges",
"params": {},
"id": 1
}Markets
{
"jsonrpc": "2.0",
"method": "v1/markets/{exchange_id}/history",
"params": { "exchange_id": "POLYMARKET", "limit": 100, "page": 1 },
"id": 2
}Market Activity
{
"jsonrpc": "2.0",
"method": "v1/activity/{exchange_id}/{market_id}/current",
"params": { "exchange_id": "POLYMARKET", "market_id": "WILL-RAIN-YES" },
"id": 3
}OHLCV
{
"jsonrpc": "2.0",
"method": "v1/ohlcv/periods",
"params": {},
"id": 4
}Orderbook
{
"jsonrpc": "2.0",
"method": "v1/orderbook/{exchange_id}/{market_id}/current",
"params": { "exchange_id": "POLYMARKET", "market_id": "WILL-RAIN-YES" },
"id": 5
}Responses and Errors
Successful JSON-RPC responses return the underlying REST payload in the result field.
If the proxied REST request fails, the error is returned as a JSON-RPC error object.
