# REST API

One REST API for every chain. Query markets, trades, positions, wallets, and candlesticks across EVM and SVM behind a single schema, with complete backfilled history and millisecond latency.

## Query onchain data across every chain

- **One integration, every chain**: Markets, trades, wallets, and prices across EVM and SVM, all behind a single consistent schema. Learn the API once and query them all. The unified schema spans Tokens, Trades, Wallets, Candlesticks, and more.
- **Complete history**: Every trade, transfer, and price from genesis. Not just the last few days, the full onchain record, ready to query.
- **Millisecond latency**: Data is queryable the moment it lands onchain. No polling intervals, no cache windows, no waiting on upstream APIs.

## Every onchain resource, one query away

Markets, trades, wallets, and prices. Structured, enriched, and returned in a shape you can build on.

- **Markets & Events**: Find any market or event by id, slug, tag, or category. Every response includes outcomes, metrics, and status.
- **Trades**: The full trade history for any market or wallet, with cursor pagination and filtering by type, size, and time.
- **Wallets & Positions**: Holdings, cost basis, and realized PnL for any wallet on any chain, resolved from raw onchain balances.
- **Candlesticks & Prices**: OHLCV candles and price series from 1 second to 1 day, per market, token, or outcome.

Explore the full API reference: https://docs.struct.to

## One API, everything you build on top

From consumer trading apps to autonomous agents, the same endpoints power it all.

- **Trading Apps**: Build consumer trading apps with real-time discovery feeds, live prices, and token metrics, all from a single feed. Discovery feeds, live prices, token metrics.
- **Wallets & Portfolio**: Track any wallet on any chain, surface holdings and PnL, and power portfolio dashboards from real-time onchain balances. Holdings and PnL, any wallet on any chain, live balances.
- **AI Agents**: Give agents the context to research, monitor, and trade across tokens, markets, and wallets, wherever they trade. Research and monitoring, cross-market context, live trade data.

## Everything the platform gives you

The infrastructure behind production trading terminals, exposed as a REST API.

- **Aggregated metrics**: Volume, liquidity, probability, and PnL pre-computed at every level. No client-side math.
- **Terminal-grade signals**: Discovery feeds, live prices, wallet PnL, and token metrics, the signals top terminals run on.
- **Benchmark-leading latency**: 10ms median in production. Data is queryable the moment it lands onchain.
- **Expressive filters**: Slice trades, wallets, and markets by chain, time range, size, type, and dozens of other dimensions.
- **Cursor pagination**: Page through millions of records with stable cursors that never skip or repeat a row.
- **99.99% uptime**: Production-grade reliability, monitored around the clock so your app never waits on ours.

## Frequently asked questions

### How do I get started with the REST API?

Talk to us and we'll provision access. Make your first request against api.struct.to. The documentation covers authentication, query parameters, and response shapes. You can also use the TypeScript SDK for typed access to every endpoint.

### What does the REST API cover?

REST coverage is scoped per protocol: markets, events, trades, wallets, and candlesticks. Contact us and we'll index them with your team: https://www.struct.to/apps

### What resources can I query?

Markets and events, trades, wallets and positions, candlesticks and prices, token metrics, and discovery feeds. Every response is structured and enriched with aggregated metrics like volume, liquidity, probability, and PnL.

### How fresh is the data?

Data is queryable the moment it lands onchain. Struct indexes in real time with a 10ms median latency in production, with no polling intervals, cache windows, or upstream API delays.

### Is historical data available?

Yes. Every trade, transfer, and price is backfilled from genesis, not just recent history. You get the full onchain record, ready to query without running your own indexer.

### How does pagination work?

Large result sets use cursor-based pagination. Cursors are stable across requests, so you can page through millions of records without skipping or repeating rows.

### What filtering options are available?

Slice trades, wallets, and markets by chain, time range, size, type, and dozens of other dimensions. Search endpoints support lookups by id, slug, tag, and category.

### How is REST API usage billed?

Usage is scoped as part of the engagement. Contact us and we'll put a number on it: https://www.struct.to/contact

### Where can I find the full API reference?

The complete endpoint reference, request parameters, and response schemas live in the API reference. It covers every resource, filter, and pagination parameter.

## Learn more

- [WebSockets](https://www.struct.to/websockets)
- [Webhooks](https://www.struct.to/webhooks)
- [Contact](https://www.struct.to/contact)
- [Documentation](https://docs.struct.to)
- [API reference](https://docs.struct.to/api-reference)
- [TypeScript SDK](https://docs.struct.to/sdk/getting-started)
