API Reference

API Documentation

Complete reference for the PredictingAPI REST API. Access enriched prediction market data with 160+ metadata fields.

Quick Start

Get started with x402 pay-per-query or an API key subscription.

curl (with API Key)
curl -H "X-API-Key: your-api-key" \
  "https://api.predictingapi.com/v1/markets?category=WAR&limit=10"

No API key? Use x402 micropayments to pay $0.25 per query with USDC on Solana.

Access Tiers

PredictingAPI supports three access methods:

Tier Header Limit
x402 Pay-per-query X-PAYMENT Unlimited ($0.25/query)
API Key Subscription (Coming Soon) X-API-Key Unlimited ($200/month)

API Key Authentication

Header
X-API-Key: your-api-key

x402 Payment Authentication

Header
X-PAYMENT: solana-transaction-signature

x402 Micropayments

Pay per query with USDC on Solana. No subscription required.

How it works

  1. Make a request without payment headers
  2. If free tier limit exceeded, receive 402 Payment Required with payment details
  3. Send USDC to the provided Solana wallet address
  4. Retry request with X-PAYMENT header containing the transaction signature

402 Response Example

JSON Response
{
  "error": "Payment required",
  "paymentRequirements": {
    "x402Version": 1,
    "network": "solana-mainnet",
    "asset": "USDC",
    "payTo": "8hTmULLrTpXJxpebL246N4aCo4cqxHTpTrKJyRxeDdWT",
    "maxAmountRequired": "250000",
    "description": "PredictingAPI query: /markets ($0.25)"
  }
}

Pricing

Endpoint Price (USDC)
/markets $0.25
/markets/{id} $0.25
/cascade/{id} $0.50
/sectors $1.00

Subscription: $200/month for unlimited access to all endpoints. (Coming Soon)

Base URL

URL
https://api.predictingapi.com/v1

Endpoints

Endpoint Description
GET/markets List markets with optional filters
GET/markets/{id} Get single market with full metadata
GET/cascade/{id} Get probability cascade for a market
GET/sectors Get sector exposure breakdown
GET/stats Get database statistics

Query Parameters

Use these parameters to filter and paginate results.

Response Format

All responses are JSON. Here's an example market object:

JSON Response
{
  "market_id": "polymarket_0x1d54eb...",
  "title": "Russia x Ukraine ceasefire by March 31, 2026?",
  "category": "WAR",
  "severity": 50,
  "price": 0.075,
  "volume_24h": 683413.41,
  "actors": ["Russian Federation", "Ukraine"],
  "region": "EUROPE",
  "resolution_date": "2026-03-31T00:00:00",
  "effects": [...],
  // 160+ additional fields available
}

Rate Limits

Access Method Rate Limit Monthly Limit
x402 Payment 100 requests/minute Unlimited (pay per query)
API Key Subscription (Coming Soon) 500 requests/minute Unlimited

Error Codes

Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
402 Payment Required - x402 payment needed
404 Not Found - Market not found
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error