AGG is currently in alpha. APIs, components, and docs may change.
Agg.market — Prediction Market Aggregator logo

API Overview

AGG REST API — authentication, users, markets, orderbooks, charts, and execution

API Overview

The AGG API gives partner apps access to authentication, user profile endpoints, venue events and markets, categories, live orderbooks, charts, and execution workflows.

Base URL

https://api.agg.market

(Use your deployment URL in development.)

Authentication

Authentication is tiered. Each documented endpoint uses one of these partner-facing tiers:

TierHeadersTypical use
appx-app-idPublic partner reads: venue events, venue markets, orderbooks, charts, and auth start/exchange flows
userx-app-id + Authorization: Bearer <jwt>User profile, avatar upload, KYC, balances, positions, orders, deposit addresses, withdrawals

API Reference

For request/response schemas, try-it-out, and full endpoint details, use the API Reference tab (OpenAPI).

Current orderbook reads

GET /orderbooks is the only supported public REST endpoint for live current-book reads.

Pass one or more venueMarketIds query parameters for the exact markets you want:

curl \
  -H "x-app-id: YOUR_APP_ID" \
  "https://api.agg.market/orderbooks?venueMarketIds=market-1&venueMarketIds=market-2"

The response returns one item per requested venueMarketId in request order. Inspect each item’s status and error fields to distinguish:

  • ok
  • market_not_found
  • market_resolved
  • market_closed
  • market_paused
  • market_unopened
  • book_not_loaded

Legacy public REST current-book endpoints return 410 Gone and should be migrated to /orderbooks.

Example (app-tier)

curl \
  -H "x-app-id: YOUR_APP_ID" \
  "https://api.agg.market/venue-events?limit=10"

Example (user-tier, after sign-in)

curl \
  -H "x-app-id: YOUR_APP_ID" \
  -H "Authorization: Bearer YOUR_JWT" \
  "https://api.agg.market/execution/balances"

Route families

  • Authentication: start a provider flow, verify wallet signatures, exchange redirect codes, refresh access tokens, sign out.
  • Users: fetch the current user, update profile data, upload avatars, disconnect linked providers, initiate KYC, and access balances, positions, orders, and deposit addresses.
  • Venue Events / Venue Markets / Categories: browse normalized market data for lists and detail views.
  • News Feed / Correlated Markets: show market-aware articles, resolve related markets, inspect generated signals, and find expand or hedge candidates through the public Discovery API.
  • Orderbook / Charts: fetch live per-venue books through /orderbooks, route previews, historical candles, and chart-ready data.
  • Execution: execute quotes and withdrawals.

Next steps

Setup Guide

Wire up createAggClient, providers, auth, and WebSocket connections.

Authentication

SIWE, SIWS, OAuth, and email magic-link flows.

WebSocket Protocol

Real-time orderbooks, trades, heartbeats, and authenticated user events.

News Feed

Add market-aware articles to discovery pages and market detail views.

Funding & Withdrawals

Balances, deposit addresses, and withdrawal flows.