---
title: 🔗 JSON-RPC API
description: JSON-RPC proxy for Prediction Markets REST endpoints.
order: 99
---

# 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.

- `method` is the REST path, for example `v1/markets/{exchange_id}/active`
- `params` is 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](/products/prediction-markets-api/docs/authentication).

### Request Format

Use a JSON-RPC 2.0 request where `method` contains the REST path and `params` is an object:

```json
{
  "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:

```text
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=100
```

### API Design Mapping

The proxy follows the REST structure of the Prediction Markets API, including:

- Exchanges: `v1/exchanges` and `v1/exchanges/{exchange_id}`
- Markets: `v1/markets/{exchange_id}/history` and `v1/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}/current` and `history`

### Examples

#### Exchanges
```json
{
  "jsonrpc": "2.0",
  "method": "v1/exchanges",
  "params": {},
  "id": 1
}
```

#### Markets
```json
{
  "jsonrpc": "2.0",
  "method": "v1/markets/{exchange_id}/history",
  "params": { "exchange_id": "POLYMARKET", "limit": 100, "page": 1 },
  "id": 2
}
```

#### Market Activity
```json
{
  "jsonrpc": "2.0",
  "method": "v1/activity/{exchange_id}/{market_id}/current",
  "params": { "exchange_id": "POLYMARKET", "market_id": "WILL-RAIN-YES" },
  "id": 3
}
```

#### OHLCV
```json
{
  "jsonrpc": "2.0",
  "method": "v1/ohlcv/periods",
  "params": {},
  "id": 4
}
```

#### Orderbook
```json
{
  "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.
