Skip to main content

Welcome to the Matchr API

The Matchr API provides programmatic access to our prediction market aggregation infrastructure. Access market data, execute trades, and build applications on top of unified prediction market data.
API Status: Beta — We’re actively developing and improving our API. Breaking changes may occur.

What You Can Build

Trading Bots

Automate your prediction market strategies with programmatic trading.

Analytics Dashboards

Build custom visualizations and analysis tools.

AI Agents

Power autonomous trading agents with real-time market data.

Aggregator Apps

Create your own interfaces on top of Matchr data.

API Overview

Base URL

https://api.matchr.xyz/v1

Available Endpoints

CategoryEndpointsDescription
Events/events, /events/{id}Market events and metadata
Markets/markets, /markets/{id}Individual markets within events
Prices/prices/{id}, /prices/historyCurrent and historical prices
Matches/matches, /matches/spreadsCross-platform matched markets
Trading/orders, /positionsOrder submission and portfolio

Quick Example

Fetch all prediction markets with Python:
import requests

response = requests.get(
    "https://api.matchr.xyz/v1/events",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"limit": 10, "sort": "volume"}
)

events = response.json()
for event in events["data"]:
    print(f"{event['title']}: {event['markets'][0]['price']}")
Or with JavaScript:
const response = await fetch(
  'https://api.matchr.xyz/v1/events?limit=10&sort=volume',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const { data: events } = await response.json();
events.forEach(event => {
  console.log(`${event.title}: ${event.markets[0].price}`);
});

Rate Limits

TierRequests/MinuteRequests/Day
Free6010,000
Pro300100,000
EnterpriseUnlimitedUnlimited
Rate limit headers are included in every response:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1699876543

Response Format

All responses follow a consistent format:

Success Response

{
  "success": true,
  "data": { ... },
  "meta": {
    "page": 1,
    "limit": 10,
    "total": 1000
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid API key",
    "details": {}
  }
}

HTTP Status Codes

CodeMeaning
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid or missing API key)
403Forbidden (insufficient permissions)
404Not found
429Rate limit exceeded
500Internal server error

SDKs

Official SDKs

JavaScript/TypeScript

npm install @matchr/sdk

Python

pip install matchr-sdk

SDK Example

import { Matchr } from '@matchr/sdk';

const matchr = new Matchr({
  apiKey: 'YOUR_API_KEY'
});

// Get matched markets with spreads
const matches = await matchr.getMatchedMarkets({
  minSpread: 0.03
});

// Place an order
const order = await matchr.placeOrder({
  marketId: 'market_123',
  side: 'BUY',
  amount: 100
});

Webhooks

Subscribe to real-time events:
await matchr.webhooks.subscribe({
  url: 'https://your-server.com/webhook',
  events: ['order.filled', 'market.resolved', 'spread.alert']
});
See Webhooks for details.

Get Your API Key

1

Create Account

Sign up at matchr.xyz if you haven’t already.
2

Go to Settings

Navigate to Settings → API Keys.
3

Generate Key

Click “Create API Key” and save your secret key securely.
Your API key is shown only once. Store it securely. If lost, generate a new one.

Next Steps