Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 57 additions & 26 deletions apps/developer-hub/content/docs/price-feeds/pro/api/history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,20 @@ All `{channel}` path segments refer to a price channel (e.g. `real_time`, `fixed
connect TradingView charting UIs directly to this API.
</Callout>

<Callout type="warning" title="API key required starting July 24, 2026">
Starting **July 24, 2026**, `GET /{channel}/price` and `GET /{channel}/history`
require API-key authentication, and unauthenticated access to them will be
disabled. API-key auth is supported today, so add the
`Authorization: Bearer <PRO_API_KEY>` header now to stay forward-compatible.
See [Authentication](#authentication) for the header format, and
[Frontend Authentication](/price-feeds/pro/frontend-auth) for browser apps.
See the
[announcement](https://dev-forum.pyth.network/t/action-required-pyth-pro-history-api-auth-required-starting-july-24/808)
for details.
</Callout>

## Endpoints

| Method | Path | Auth | Description |
| ------ | ---------------------- | -------------------------- | ----------------------------- |
| GET | `/live` | No | Health check |
| GET | `/symbols` | No | List available symbols |
| GET | `/{channel}/price` | Yes (from July 24, 2026) | Price at a specific timestamp |
| GET | `/{channel}/history` | Yes (from July 24, 2026) | OHLC candlestick data |
| GET | `/{channel}/search` | No | Search symbols |
| GET | `/{channel}/symbols` | No | Resolve a single symbol |
| GET | `/{channel}/streaming` | No | SSE price stream |
| GET | `/{channel}/config` | No | TradingView configuration |
| GET | `/publisher_updates` | Yes | Raw publisher updates |
| Method | Path | Auth | Description |
| ------ | ------------------------ | ---- | ----------------------------------- |
| GET | `/live` | No | Health check |
| GET | `/symbols` | No | List available symbols |
| GET | `/{channel}/price` | Yes | Price at a specific timestamp |
| GET | `/{channel}/price/range` | Yes | Paginated prices over a time window |
| GET | `/{channel}/history` | Yes | OHLC candlestick data |
| GET | `/{channel}/search` | No | Search symbols |
| GET | `/{channel}/symbols` | No | Resolve a single symbol |
| GET | `/{channel}/streaming` | No | SSE price stream |
| GET | `/{channel}/config` | No | TradingView configuration |
| GET | `/publisher_updates` | Yes | Raw publisher updates |

---

Expand Down Expand Up @@ -74,6 +63,48 @@ Returns price data at a specific historical timestamp.

---

### GET /\{channel\}/price/range

Returns paginated price data for a set of feeds over a bounded time window.

**Query Parameters**

| Parameter | Type | Required | Description | Example |
| ----------------- | ---------- | -------- | ------------------------------------------------------------------------------ | ------------------ |
| `ids` | `number[]` | Yes | Price feed IDs (max 100) | `1,2` |
| `start_timestamp` | `number` | Yes | Window start, Unix timestamp in **microseconds**, inclusive | `1704067200000000` |
| `end_timestamp` | `number` | Yes | Window end, Unix timestamp in **microseconds**, inclusive; the window may not exceed 60 seconds | `1704067260000000` |
| `limit` | `number` | No | Max results per page, 1–1000 (default: `100`) | `500` |
| `after` | `string` | No | Opaque pagination cursor from a previous response's `next` field | |

**Response Schema**

| Field | Type | Description |
| ------ | ---------- | ---------------------------------------------------- |
| `data` | `object[]` | Price objects, one per feed and timestamp |
| `next` | `string` | Opaque cursor, present only when another page exists |

Each `data` entry has the same shape as the `GET /{channel}/price` response:
`channel`, `channel_name`, `price_feed_id`, `price`, `publish_time`,
`best_bid_price`, `best_ask_price`, `publisher_count`, `exponent`,
`confidence`, `funding_rate`, `funding_timestamp`, `funding_rate_interval`,
`market_session`, `ema_price`, `ema_confidence`, `feed_update_timestamp`.

To fetch the next page, pass `next` verbatim as the `after` parameter of the
following request; stop when `next` is absent. Cursors are opaque and must not
be constructed by hand.

**Errors**

| Status | Cause |
| ------ | ---------------------------------------------------------------------------------------- |
| `400` | Invalid parameters, window longer than 60 seconds, or feed not ready/unavailable on the channel |
| `401` | Missing bearer token |
| `403` | Token not entitled to a requested feed |
| `404` | Unknown feed ID |

Comment on lines +66 to +105

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 New range-endpoint section is unverifiable from this repo

The documented parameters, limits (max 100 ids, 60-second window, limit 1–1000 default 100), cursor semantics, and error codes for GET /{channel}/price/range cannot be cross-checked here — no price_range handler exists anywhere in this repository. As the PR description itself notes, this section should be validated against the live OpenAPI spec at https://pyth.dourolabs.app/docs/v1/openapi.json before merge, otherwise users may hit undocumented 400s.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

---

### GET /\{channel\}/history

Returns OHLC candlestick data in TradingView format.
Expand Down Expand Up @@ -178,9 +209,9 @@ Returns raw publisher price updates. Requires authentication.

## Authentication

Starting **July 24, 2026**, `GET /{channel}/price` and `GET /{channel}/history`
require API-key authentication, and unauthenticated access to them will be
disabled. Pass your Pro API key as a bearer token:
`GET /{channel}/price`, `GET /{channel}/price/range`, and
`GET /{channel}/history` require API-key authentication. Pass your Pro API key
as a bearer token:

```bash copy
curl -H "Authorization: Bearer $PRO_API_KEY" \
Expand Down
26 changes: 6 additions & 20 deletions apps/developer-hub/content/docs/price-feeds/pro/api/rest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,12 @@ import { Callout } from "fumadocs-ui/components/callout";
https://pyth-lazer.dourolabs.app
```

<Callout type="warning" title="API key required for POST /v1/price starting July 24, 2026">
Starting **July 24, 2026**, `POST /v1/price` requires API-key authentication,
and unauthenticated access to it will be disabled. Pass
`Authorization: Bearer <PRO_API_KEY>`; API-key auth is supported today, so add
the header now to stay forward-compatible. Do not expose the key in browser
apps — keep it server-side. See [Authentication](#authentication) for the
header format, and
[Frontend Authentication](/price-feeds/pro/frontend-auth) for browser apps,
and the
[announcement](https://dev-forum.pyth.network/t/action-required-pyth-pro-history-api-auth-required-starting-july-24/808)
for details.
</Callout>

## Endpoints

| Method | Path | Auth | Description |
| ------ | ------------------ | -------------------------- | --------------------------------------------------- |
| POST | `/v1/latest_price` | Yes | Fetch the latest price for one or more price feeds |
| POST | `/v1/price` | Yes (from July 24, 2026) | Fetch price data at a specific historical timestamp |
| Method | Path | Auth | Description |
| ------ | ------------------ | ---- | --------------------------------------------------- |
| POST | `/v1/latest_price` | Yes | Fetch the latest price for one or more price feeds |
| POST | `/v1/price` | Yes | Fetch price data at a specific historical timestamp |

### POST /v1/latest_price

Expand Down Expand Up @@ -66,9 +53,8 @@ For the full response schema — including price feed fields, signed payloads, a

## Authentication

Starting **July 24, 2026**, `POST /v1/price` requires API-key authentication,
and unauthenticated access to it will be disabled. Pass your Pro API key as a
bearer token:
`POST /v1/latest_price` and `POST /v1/price` require API-key authentication.
Pass your Pro API key as a bearer token:

```bash copy
curl -X POST -H "Authorization: Bearer $PRO_API_KEY" \
Expand Down
4 changes: 2 additions & 2 deletions apps/developer-hub/content/docs/price-feeds/pro/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ https://pyth.dourolabs.app/v1/fixed_rate@200ms/history?symbol=Crypto.BTC/USD&fro

See the [History API](/price-feeds/pro/api/history) for full endpoint details, query parameters, and resolutions.

Starting **July 24, 2026**, `GET /{channel}/history` and `GET /{channel}/price` require the `Authorization: Bearer <PRO_API_KEY>` header, and unauthenticated access to them will be disabled. See the [History API](/price-feeds/pro/api/history#authentication) for the header format and frontend-safe guidance.
`GET /{channel}/history` and `GET /{channel}/price` require the `Authorization: Bearer <PRO_API_KEY>` header. See the [History API](/price-feeds/pro/api/history#authentication) for the header format and frontend-safe guidance.

#### Q. How do I fetch the latest price via HTTP?

Expand All @@ -138,7 +138,7 @@ https://pyth-lazer.dourolabs.app

See the [REST API](/price-feeds/pro/api/rest) for request/response schemas and examples.

Starting **July 24, 2026**, `POST /v1/price` will require the `Authorization: Bearer <PRO_API_KEY>` header, and unauthenticated access to it will be disabled. See the [REST API](/price-feeds/pro/api/rest#authentication) for details. `POST /v1/latest_price` is unaffected by this change.
`POST /v1/price` requires the `Authorization: Bearer <PRO_API_KEY>` header. See the [REST API](/price-feeds/pro/api/rest#authentication) for details.

#### Q. How should I authenticate the History and REST endpoints from a frontend app?

Expand Down
6 changes: 3 additions & 3 deletions apps/developer-hub/content/docs/price-feeds/pro/mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The Pyth MCP server gives AI assistants direct, structured access to Pyth market
Recommended workflow: `get_symbols` → `get_latest_price` / `get_historical_price` → `get_candlestick_data`

<Callout type="warning">
`get_latest_price` requires a Pyth Pro API key passed as `access_token`. `get_historical_price` and `get_candlestick_data` require it as of **July 24, 2026** (optional before then). Get one at [acquire API key guide](./acquire-api-key). `get_symbols` and `convert_date_to_timestamp` work without a key.
`get_latest_price`, `get_historical_price`, and `get_candlestick_data` require a Pyth Pro API key passed as `access_token`. Get one at [acquire API key guide](./acquire-api-key). `get_symbols` and `convert_date_to_timestamp` work without a key.
</Callout>

## Setup
Expand Down Expand Up @@ -157,7 +157,7 @@ Get prices at a single historical timestamp.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `access_token` | string | From Jul 24, 2026 | Pyth Pro API key |
| `access_token` | string | **Yes** | Pyth Pro API key |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Docs mark MCP access_token as required while tool schemas keep it optional

The MCP docs now state access_token is Yes (required) for get_historical_price and get_candlestick_data, but their Zod schemas still declare it .optional() (apps/mcp/src/tools/get-historical-price.ts:26-33, apps/mcp/src/tools/get-candlestick-data.ts:26-33), unlike get_latest_price where it is required (apps/mcp/src/tools/get-latest-price.ts:19-23). If the upstream API now enforces auth, callers omitting the token get a runtime auth error rather than a clear schema-level requirement; consider making the schemas required (and updating their .describe/tool descriptions) so code and docs agree.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

| `symbols` | string[] | No\* | Full symbols |
| `price_feed_ids` | number[] | No\* | Feed IDs |
| `timestamp` | number | **Yes** | Unix seconds, milliseconds, or microseconds |
Expand All @@ -179,7 +179,7 @@ Fetch OHLC candlestick data for a single feed.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `access_token` | string | From Jul 24, 2026 | Pyth Pro API key |
| `access_token` | string | **Yes** | Pyth Pro API key |
| `symbol` | string | **Yes** | Full symbol (e.g. `Crypto.BTC/USD`) |
| `resolution` | string | **Yes** | `1`, `5`, `15`, `30`, `60`, `120`, `240`, `360`, `720`, `D`, `W`, `M` |
| `from` | number | **Yes** | Start time (Unix seconds) |
Expand Down
7 changes: 4 additions & 3 deletions apps/developer-hub/src/app/llms-price-feeds-pro.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ You MUST connect to all three endpoints simultaneously. Any single endpoint may
- POST /v1/price — Fetch price at a specific historical timestamp (Unix microseconds)

### History API (base: https://pyth.dourolabs.app/v1)
- GET /{channel}/history — OHLC candlestick data
- GET /{channel}/price — Price at specific timestamp
- GET /{channel}/history — OHLC candlestick data (requires auth)
- GET /{channel}/price — Price at specific timestamp (requires auth)
- GET /{channel}/price/range — Paginated prices over a time window (requires auth)
- GET /symbols — List available symbols (no auth required)
- Supports TradingView UDF specification

Expand All @@ -154,7 +155,7 @@ Pyth Pro also provides an MCP server so agents can discover feeds and fetch pric

- MCP endpoint: https://mcp.pyth.network/mcp
- Tool workflow: \`get_symbols\` -> \`get_latest_price\` / \`get_historical_price\` -> \`get_candlestick_data\`
- Token behavior: \`get_latest_price\` requires \`access_token\`; \`get_historical_price\` and \`get_candlestick_data\` require it as of July 24, 2026
- Token behavior: \`get_latest_price\`, \`get_historical_price\`, and \`get_candlestick_data\` require \`access_token\`
- 9 pre-built skills for Claude Code: price alerts, cross-asset comparison, volatility analysis, FX conversion, portfolio tracking, funding rate monitoring, data export, time-series snapshots, and integration guidance
- Skills docs: https://docs.pyth.network/price-feeds/pro/mcp-skills.mdx

Expand Down
Loading