Betfair Heartbeat API

HeartbeatAPING - dead man's switch that cancels unmatched bets.

Operations 1

POST /heartbeat/rest/v1.0/heartbeat/ Heartbeat (dead man's switch) #

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-heartbeat-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-heartbeat-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Betfair Exchange API (API-NG) Heartbeat 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: Heartbeat
  description: HeartbeatAPING - dead man's switch that cancels unmatched bets.
paths:
  /heartbeat/rest/v1.0/heartbeat/:
    post:
      operationId: heartbeat
      tags:
      - Heartbeat
      summary: Heartbeat (dead man's switch)
      description: Registers a heartbeat with a preferred timeout (seconds). If Betfair does not receive a subsequent heartbeat within the timeout it will cancel the customer's unmatched bets. Preferred timeout is clamped between 10 and 300 seconds; a value of 0 disables the switch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - preferredTimeoutSeconds
              properties:
                preferredTimeoutSeconds:
                  type: integer
                  minimum: 0
                  maximum: 300
      responses:
        '200':
          description: Heartbeat report.
          content:
            application/json:
              schema:
                type: object
                properties:
                  actionPerformed:
                    type: string
                    enum:
                    - NONE
                    - CANCELLATION_REQUEST_SUBMITTED
                    - ALL_BETS_CANCELLED
                    - SOME_BETS_NOT_CANCELLED
                    - BETS_CANCELLATION_FAILED
                  actualTimeoutSeconds:
                    type: integer
        default:
          $ref: '#/components/responses/BettingError'
components:
  schemas:
    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
  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.