Betfair Betting API

SportsAPING - market navigation, prices, and bet placement.

Operations 13

POST /betting/rest/v1.0/listEventTypes/ List event types (sports) #
POST /betting/rest/v1.0/listCompetitions/ List competitions #
POST /betting/rest/v1.0/listEvents/ List events #
POST /betting/rest/v1.0/listMarketTypes/ List market types #
POST /betting/rest/v1.0/listMarketCatalogue/ List market catalogue #
POST /betting/rest/v1.0/listMarketBook/ List market book (live prices) #
POST /betting/rest/v1.0/listRunnerBook/ List runner book #
POST /betting/rest/v1.0/listCurrentOrders/ List current orders #
POST /betting/rest/v1.0/listClearedOrders/ List cleared (settled) orders #
POST /betting/rest/v1.0/placeOrders/ Place orders (bets) #
POST /betting/rest/v1.0/cancelOrders/ Cancel orders #
POST /betting/rest/v1.0/replaceOrders/ Replace orders #
POST /betting/rest/v1.0/updateOrders/ Update orders #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/betfair-betting-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

betfair-betting-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Betfair Exchange API (API-NG) Betting API
  description: OpenAPI description of the request/response HTTP surface of the Betfair Exchange API (API-NG).
  version: 1.0.0
  contact:
    name: API Evangelist
    email: kin@apievangelist.com
    url: https://apievangelist.com
  license:
    name: API documentation - Betfair Developer Program Terms
    url: https://developer.betfair.com/
servers:
- url: https://api.betfair.com/exchange
  description: Betfair Exchange API-NG (Betting, Accounts, Heartbeat)
security:
- appKey: []
  sessionToken: []
tags:
- name: Betting
  description: SportsAPING - market navigation, prices, and bet placement.
paths:
  /betting/rest/v1.0/listEventTypes/:
    post:
      operationId: listEventTypes
      tags:
      - Betting
      summary: List event types (sports)
      description: Returns a list of event types (e.g. Soccer, Horse Racing) matching the market filter.
      requestBody:
        $ref: '#/components/requestBodies/MarketFilterBody'
      responses:
        '200':
          description: Event type results.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventTypeResult'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listCompetitions/:
    post:
      operationId: listCompetitions
      tags:
      - Betting
      summary: List competitions
      description: Returns competitions (e.g. leagues) associated with markets matching the filter.
      requestBody:
        $ref: '#/components/requestBodies/MarketFilterBody'
      responses:
        '200':
          description: Competition results.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listEvents/:
    post:
      operationId: listEvents
      tags:
      - Betting
      summary: List events
      description: Returns a list of events matching the market filter.
      requestBody:
        $ref: '#/components/requestBodies/MarketFilterBody'
      responses:
        '200':
          description: Event results.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listMarketTypes/:
    post:
      operationId: listMarketTypes
      tags:
      - Betting
      summary: List market types
      description: Returns market types (e.g. MATCH_ODDS, OVER_UNDER_25) matching the filter.
      requestBody:
        $ref: '#/components/requestBodies/MarketFilterBody'
      responses:
        '200':
          description: Market type results.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listMarketCatalogue/:
    post:
      operationId: listMarketCatalogue
      tags:
      - Betting
      summary: List market catalogue
      description: Returns a list of information about published (ACTIVE/SUSPENDED) markets that does not change (or changes very rarely). Use this to discover markets, their runners, and metadata; the returned marketId and runner selectionId are required to place bets.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - filter
              - maxResults
              properties:
                filter:
                  $ref: '#/components/schemas/MarketFilter'
                marketProjection:
                  type: array
                  items:
                    type: string
                    enum:
                    - COMPETITION
                    - EVENT
                    - EVENT_TYPE
                    - MARKET_START_TIME
                    - MARKET_DESCRIPTION
                    - RUNNER_DESCRIPTION
                    - RUNNER_METADATA
                sort:
                  type: string
                  enum:
                  - MINIMUM_TRADED
                  - MAXIMUM_TRADED
                  - MINIMUM_AVAILABLE
                  - MAXIMUM_AVAILABLE
                  - FIRST_TO_START
                  - LAST_TO_START
                maxResults:
                  type: integer
                  maximum: 1000
                locale:
                  type: string
      responses:
        '200':
          description: Market catalogue results.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketCatalogue'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listMarketBook/:
    post:
      operationId: listMarketBook
      tags:
      - Betting
      summary: List market book (live prices)
      description: Returns dynamic data about markets - prices, status, and available to back/lay depth - for a list of market IDs. Data request weighting applies; a single request has a maximum weighting of 200.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - marketIds
              properties:
                marketIds:
                  type: array
                  items:
                    type: string
                priceProjection:
                  $ref: '#/components/schemas/PriceProjection'
                orderProjection:
                  type: string
                  enum:
                  - ALL
                  - EXECUTABLE
                  - EXECUTION_COMPLETE
                matchProjection:
                  type: string
                  enum:
                  - NO_ROLLUP
                  - ROLLED_UP_BY_PRICE
                  - ROLLED_UP_BY_AVG_PRICE
                currencyCode:
                  type: string
      responses:
        '200':
          description: Market book results.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketBook'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listRunnerBook/:
    post:
      operationId: listRunnerBook
      tags:
      - Betting
      summary: List runner book
      description: Returns dynamic price/depth data for a single runner in a single market.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - marketId
              - selectionId
              properties:
                marketId:
                  type: string
                selectionId:
                  type: integer
                  format: int64
                handicap:
                  type: number
                priceProjection:
                  $ref: '#/components/schemas/PriceProjection'
      responses:
        '200':
          description: Runner book results.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketBook'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listCurrentOrders/:
    post:
      operationId: listCurrentOrders
      tags:
      - Betting
      summary: List current orders
      description: Returns a list of the customer's current (unmatched and matched) orders.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                betIds:
                  type: array
                  items:
                    type: string
                marketIds:
                  type: array
                  items:
                    type: string
                orderProjection:
                  type: string
                  enum:
                  - ALL
                  - EXECUTABLE
                  - EXECUTION_COMPLETE
                fromRecord:
                  type: integer
                recordCount:
                  type: integer
      responses:
        '200':
          description: Current orders.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentOrderSummaryReport'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/listClearedOrders/:
    post:
      operationId: listClearedOrders
      tags:
      - Betting
      summary: List cleared (settled) orders
      description: Returns a list of settled bets based on the bet status, ordered by settled date.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - betStatus
              properties:
                betStatus:
                  type: string
                  enum:
                  - SETTLED
                  - VOIDED
                  - LAPSED
                  - CANCELLED
                eventTypeIds:
                  type: array
                  items:
                    type: string
                marketIds:
                  type: array
                  items:
                    type: string
                settledDateRange:
                  $ref: '#/components/schemas/TimeRange'
                fromRecord:
                  type: integer
                recordCount:
                  type: integer
      responses:
        '200':
          description: Cleared orders.
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/placeOrders/:
    post:
      operationId: placeOrders
      tags:
      - Betting
      summary: Place orders (bets)
      description: Places one or more orders on a market. On success a betId is returned per instruction. Supports LIMIT, LIMIT_ON_CLOSE, and MARKET_ON_CLOSE order types. Provide a customerRef for idempotency.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - marketId
              - instructions
              properties:
                marketId:
                  type: string
                instructions:
                  type: array
                  items:
                    $ref: '#/components/schemas/PlaceInstruction'
                customerRef:
                  type: string
                customerStrategyRef:
                  type: string
      responses:
        '200':
          description: Place execution report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaceExecutionReport'
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/cancelOrders/:
    post:
      operationId: cancelOrders
      tags:
      - Betting
      summary: Cancel orders
      description: Cancels all bets, all bets on a market, or specific bets on a market (fully or partially).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                marketId:
                  type: string
                instructions:
                  type: array
                  items:
                    type: object
                    properties:
                      betId:
                        type: string
                      sizeReduction:
                        type: number
                customerRef:
                  type: string
      responses:
        '200':
          description: Cancel execution report.
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/replaceOrders/:
    post:
      operationId: replaceOrders
      tags:
      - Betting
      summary: Replace orders
      description: Cancels and re-places existing unmatched bets at a new price in a single atomic operation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - marketId
              - instructions
              properties:
                marketId:
                  type: string
                instructions:
                  type: array
                  items:
                    type: object
                    properties:
                      betId:
                        type: string
                      newPrice:
                        type: number
                customerRef:
                  type: string
      responses:
        '200':
          description: Replace execution report.
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/BettingError'
  /betting/rest/v1.0/updateOrders/:
    post:
      operationId: updateOrders
      tags:
      - Betting
      summary: Update orders
      description: Updates non-exposure-changing fields on current orders (e.g. persistence type).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - marketId
              - instructions
              properties:
                marketId:
                  type: string
                instructions:
                  type: array
                  items:
                    type: object
                    properties:
                      betId:
                        type: string
                      newPersistenceType:
                        type: string
                        enum:
                        - LAPSE
                        - PERSIST
                        - MARKET_ON_CLOSE
                customerRef:
                  type: string
      responses:
        '200':
          description: Update execution report.
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/BettingError'
components:
  requestBodies:
    MarketFilterBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
            - filter
            properties:
              filter:
                $ref: '#/components/schemas/MarketFilter'
              locale:
                type: string
  schemas:
    PlaceInstruction:
      type: object
      required:
      - selectionId
      - side
      - orderType
      properties:
        orderType:
          type: string
          enum:
          - LIMIT
          - LIMIT_ON_CLOSE
          - MARKET_ON_CLOSE
        selectionId:
          type: integer
          format: int64
        handicap:
          type: number
        side:
          type: string
          enum:
          - BACK
          - LAY
        limitOrder:
          type: object
          properties:
            size:
              type: number
            price:
              type: number
            persistenceType:
              type: string
              enum:
              - LAPSE
              - PERSIST
              - MARKET_ON_CLOSE
    MarketBook:
      type: object
      properties:
        marketId:
          type: string
        isMarketDataDelayed:
          type: boolean
        status:
          type: string
          enum:
          - INACTIVE
          - OPEN
          - SUSPENDED
          - CLOSED
        inplay:
          type: boolean
        totalMatched:
          type: number
        runners:
          type: array
          items:
            $ref: '#/components/schemas/Runner'
    ApiError:
      type: object
      description: Betfair APINGException / AccountAPINGException envelope. In JSON-RPC the error is returned under the JSON-RPC "error" member; in REST it is the HTTP 400 body.
      properties:
        faultcode:
          type: string
        faultstring:
          type: string
        detail:
          type: object
          properties:
            APINGException:
              type: object
              properties:
                errorCode:
                  type: string
                  enum:
                  - TOO_MUCH_DATA
                  - INVALID_INPUT_DATA
                  - INVALID_SESSION_INFORMATION
                  - NO_APP_KEY
                  - NO_SESSION
                  - INVALID_APP_KEY
                  - TOO_MANY_REQUESTS
                  - SERVICE_BUSY
                  - TIMEOUT_ERROR
                  - INVALID_JSON
                  - ACCESS_DENIED
                errorDetails:
                  type: string
                requestUUID:
                  type: string
    PriceProjection:
      type: object
      properties:
        priceData:
          type: array
          items:
            type: string
            enum:
            - SP_AVAILABLE
            - SP_TRADED
            - EX_BEST_OFFERS
            - EX_ALL_OFFERS
            - EX_TRADED
        virtualise:
          type: boolean
        rolloverStakes:
          type: boolean
    PlaceExecutionReport:
      type: object
      properties:
        customerRef:
          type: string
        status:
          type: string
          enum:
          - SUCCESS
          - FAILURE
          - TIMEOUT
        errorCode:
          type: string
        marketId:
          type: string
        instructionReports:
          type: array
          items:
            type: object
            properties:
              status:
                type: string
                enum:
                - SUCCESS
                - FAILURE
                - TIMEOUT
              betId:
                type: string
              placedDate:
                type: string
                format: date-time
              averagePriceMatched:
                type: number
              sizeMatched:
                type: number
              orderStatus:
                type: string
                enum:
                - PENDING
                - EXECUTION_COMPLETE
                - EXECUTABLE
                - EXPIRED
    MarketCatalogue:
      type: object
      properties:
        marketId:
          type: string
        marketName:
          type: string
        totalMatched:
          type: number
        runners:
          type: array
          items:
            type: object
            properties:
              selectionId:
                type: integer
                format: int64
              runnerName:
                type: string
              handicap:
                type: number
              sortPriority:
                type: integer
    MarketFilter:
      type: object
      description: Filter selecting a subset of markets. All fields optional.
      properties:
        textQuery:
          type: string
        eventTypeIds:
          type: array
          items:
            type: string
        eventIds:
          type: array
          items:
            type: string
        competitionIds:
          type: array
          items:
            type: string
        marketIds:
          type: array
          items:
            type: string
        marketCountries:
          type: array
          items:
            type: string
        marketTypeCodes:
          type: array
          items:
            type: string
        marketStartTime:
          $ref: '#/components/schemas/TimeRange'
        inPlayOnly:
          type: boolean
        turnInPlayEnabled:
          type: boolean
    CurrentOrderSummaryReport:
      type: object
      properties:
        currentOrders:
          type: array
          items:
            type: object
            properties:
              betId:
                type: string
              marketId:
                type: string
              selectionId:
                type: integer
                format: int64
              side:
                type: string
                enum:
                - BACK
                - LAY
              status:
                type: string
                enum:
                - EXECUTION_COMPLETE
                - EXECUTABLE
              priceSize:
                $ref: '#/components/schemas/PriceSize'
              sizeMatched:
                type: number
              sizeRemaining:
                type: number
        moreAvailable:
          type: boolean
    EventTypeResult:
      type: object
      properties:
        eventType:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
        marketCount:
          type: integer
    Runner:
      type: object
      properties:
        selectionId:
          type: integer
          format: int64
        handicap:
          type: number
        status:
          type: string
          enum:
          - ACTIVE
          - WINNER
          - LOSER
          - REMOVED
          - REMOVED_VACANT
          - HIDDEN
        lastPriceTraded:
          type: number
        totalMatched:
          type: number
        ex:
          type: object
          properties:
            availableToBack:
              type: array
              items:
                $ref: '#/components/schemas/PriceSize'
            availableToLay:
              type: array
              items:
                $ref: '#/components/schemas/PriceSize'
            tradedVolume:
              type: array
              items:
                $ref: '#/components/schemas/PriceSize'
    TimeRange:
      type: object
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
    PriceSize:
      type: object
      properties:
        price:
          type: number
        size:
          type: number
  responses:
    BettingError:
      description: Betting API error. REST returns HTTP 400 with an APINGException whose errorCode explains the failure (e.g. INVALID_SESSION_INFORMATION, INVALID_APP_KEY, TOO_MUCH_DATA, INVALID_INPUT_DATA).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    appKey:
      type: apiKey
      in: header
      name: X-Application
      description: The developer Application Key (delayed or live).
    sessionToken:
      type: apiKey
      in: header
      name: X-Authentication
      description: The session token (ssoid) obtained from identity SSO login.