# OKX API

> OKX API on Apizie: 15 endpoints (Order Book, Candles, Funding Rate History, Funding Rate, …) returned as clean JSON through one API key. 15 endpoints are live now. Call it over REST at https://zieapi.vercel.app/v1/finance:okx/{endpoint} or from Claude, ChatGPT and Cursor through the Apizie MCP server. Free plan: 1,000 requests a month.

- Project key: `finance:okx`
- Category: Finance
- Status: live
- Source: https://okx.com
- Page: https://zieapi.vercel.app/api/finance/okx
- OpenAPI: https://zieapi.vercel.app/api/finance/okx/openapi.json

OKX v5 public market data: tickers, candles, order books, funding, open interest and trading statistics.

## Endpoints

### Order Book
`GET https://zieapi.vercel.app/v1/finance:okx/books`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |
| count | integer | no | Depth per side |

### Candles
`GET https://zieapi.vercel.app/v1/finance:okx/candles`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |
| bar | string | no |  |
| end | string | no | Return candles older than this time (epoch ms or ISO) |
| count | integer | no | Number of candles |
| page | integer | no |  |

### Funding Rate History
`GET https://zieapi.vercel.app/v1/finance:okx/funding-rate-history`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |
| end | string | no | Older than this time |
| count | integer | no | Number of rows to return |
| page | integer | no |  |

### Funding Rate
`GET https://zieapi.vercel.app/v1/finance:okx/funding-rate`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |

### History Candles
`GET https://zieapi.vercel.app/v1/finance:okx/history-candles`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |
| bar | string | no |  |
| end | string | no | Return candles older than this time (epoch ms or ISO) |
| count | integer | no | Number of candles |
| page | integer | no |  |

### Instruments
`GET https://zieapi.vercel.app/v1/finance:okx/instruments`

| Parameter | Type | Required | Description |
|---|---|---|---|
| instType | string | no |  |
| symbol | string | no |  |
| instFamily | string | no |  |
| uly | string | no |  |

### Long/Short Account Ratio
`GET https://zieapi.vercel.app/v1/finance:okx/long-short-ratio`

| Parameter | Type | Required | Description |
|---|---|---|---|
| currency | string | no |  |
| period | string | no |  |
| start | string | no | Epoch ms or ISO date |
| end | string | no | Epoch ms or ISO date |

### Mark Price
`GET https://zieapi.vercel.app/v1/finance:okx/mark-price`

| Parameter | Type | Required | Description |
|---|---|---|---|
| instType | string | no |  |
| symbol | string | no |  |
| instFamily | string | no |  |

### Open Interest & Volume
`GET https://zieapi.vercel.app/v1/finance:okx/open-interest-volume`

| Parameter | Type | Required | Description |
|---|---|---|---|
| currency | string | no |  |
| period | string | no |  |
| start | string | no | Epoch ms or ISO date |
| end | string | no | Epoch ms or ISO date |

### Open Interest
`GET https://zieapi.vercel.app/v1/finance:okx/open-interest`

| Parameter | Type | Required | Description |
|---|---|---|---|
| instType | string | no |  |
| symbol | string | no |  |
| instFamily | string | no |  |

### Price Limit
`GET https://zieapi.vercel.app/v1/finance:okx/price-limit`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |

### Taker Volume
`GET https://zieapi.vercel.app/v1/finance:okx/taker-volume`

| Parameter | Type | Required | Description |
|---|---|---|---|
| currency | string | no |  |
| instType | string | no |  |
| period | string | no |  |
| start | string | no | Epoch ms or ISO date |
| end | string | no | Epoch ms or ISO date |

### Ticker
`GET https://zieapi.vercel.app/v1/finance:okx/ticker`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |

### Tickers
`GET https://zieapi.vercel.app/v1/finance:okx/tickers`

| Parameter | Type | Required | Description |
|---|---|---|---|
| instType | string | no |  |
| instFamily | string | no |  |
| uly | string | no |  |

### Trades
`GET https://zieapi.vercel.app/v1/finance:okx/trades`

| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | yes | OKX instrument id (instId) |
| count | integer | no | Number of rows to return |

## Example
```
curl "https://zieapi.vercel.app/v1/finance:okx/books" \
  -H "x-api-key: $APIZIE_KEY"
```

## FAQ

### How do I call the OKX API?
Create a free Apizie key, then send GET https://zieapi.vercel.app/v1/finance:okx/books with the header x-api-key. Every endpoint returns { project, data, timestamp }.

### Is the OKX API free on Apizie?
Yes. The Free plan includes 1,000 requests a month at 100 requests a minute, no credit card.

### Can AI agents use the OKX API?
Yes. Add the Apizie MCP server (https://zieapi.vercel.app/mcp) to Claude, ChatGPT, Cursor or VS Code, then ask in plain language. The agent calls run_scraper with project key finance:okx.

### What is the status of the OKX API?
Live: works with just an Apizie key
