Does OddsForge Have an API?

Updated June 2025

Yes — REST API Available

OddsForge provides a public REST API that gives you programmatic access to market data, events, trades, portfolios, and more. Whether you're building a trading bot, analyzing market data, or integrating OddsForge into your own application, the API has you covered.

Base URL:
https://oddsforge.org/api

All endpoints return JSON responses. No API key is required for public read endpoints.

Key Endpoints

Here's an overview of the main API endpoints:

GET /api/markets

Returns a list of all prediction markets, including their titles, descriptions, current prices, categories, and resolution status. You can filter by status (active, resolved, upcoming) and category.

GET /api/markets/:id

Returns detailed information about a specific market, including the full description, current outcome prices, total volume, liquidity, and resolution details if the market is settled.

GET /api/events

Returns event groupings — markets that are related to the same real-world event. Events can contain multiple binary markets (e.g., an election event might include one market per candidate).

GET /api/trades

Returns recent trade activity across all markets. Each trade record includes the market ID, outcome, direction (buy/sell), amount, price, and timestamp. Useful for building price charts and monitoring market activity.

GET /api/portfolio/:address

Returns the portfolio of a specific wallet address — their current share holdings across all markets, trade history, and realized/unrealized profit and loss.

GET /api/search?q=query

Full-text search across markets and events. Returns matching markets ranked by relevance.

Example Request

Fetching all active markets is as simple as:

curl https://oddsforge.org/api/markets

Example response (abbreviated):

{
  "markets": [
    {
      "id": 1,
      "title": "Will BNB reach $1,000 by Dec 2026?",
      "yes_price": 0.35,
      "no_price": 0.65,
      "volume": 125000,
      "status": "active",
      "end_date": "2026-12-31"
    }
  ]
}

Use Cases

The OddsForge API enables a wide range of applications:

Rate Limits & Best Practices

To ensure fair access and platform stability, the API enforces rate limits:

Follow these best practices when using the API:

  1. Cache responses where possible. Market data doesn't change every second — polling every 10–30 seconds is usually sufficient.
  2. Use specific endpoints rather than fetching all data and filtering client-side. For example, use /api/markets/:id instead of fetching the full market list.
  3. Handle errors gracefully. The API returns standard HTTP status codes (200, 400, 404, 429, 500). Implement retry logic with exponential backoff for temporary failures.
  4. Respect rate limits. If you receive a 429 (Too Many Requests) response, back off and reduce your request frequency.
Note: The API provides read-only access to market data. Actual trading (buying and selling shares) is performed through on-chain smart contract interactions, not through the REST API. Use a Web3 library like ethers.js or web3.js to interact with the OddsForgeV2 contract directly.

Did this answer your question?