APIHorseRacing

Documentation / Guides

Using it from an assistant

Connect Claude, ChatGPT or any MCP client and ask in plain English.

Point Claude, ChatGPT or any Model Context Protocol client at the archive and ask questions in plain English. No code, no client library, and the same key you already have.

It is the fastest way to find out whether this data answers your question, because you can ask it before writing anything. The MCP server page has the setup block and the full tool list.

What it is

MCP is a standard way for an assistant to call an external service. You add one address to your client's configuration, and from then on the model can reach our tools whenever a question needs them. It decides which tool to call; you just ask.

The server runs here rather than on your machine. Nothing is installed and nothing is running locally.

Connecting

"mcpServers": {
  "horseracing": {
    "url": "https://apihorseracing.com/mcp-server",
    "headers": {
      "Authorization": "Bearer ahr_your_key_here"
    }
  }
}

Restart the client and ask it something about a race. If your client wants an API key header rather than a bearer token, send X-API-Key instead; both are accepted, because clients differ and being fussy about which one reads to a user as broken.

Fourteen tools, not sixty

We publish sixty endpoints and expose fourteen tools. That is deliberate rather than unfinished.

A model given forty near-identical options picks the first plausible one rather than the right one, and every tool costs context on every turn of every conversation. A short list it uses well beats a complete one it uses badly.

Four tools work on a free key: describe_coverage, search_racing, get_race and get_results. Eight more need any paid plan, and the two statistics tools need Complete + Analyst.

Identifiers come from search

Every tool that names a horse, trainer, jockey or course takes an identifier rather than a name, and identifiers are opaque. The model is told not to guess them, so a question about a named horse becomes two calls: search_racing to get the identifier, then the tool that uses it.

You do not have to do anything about this. It is worth knowing because it explains why a simple question sometimes shows two tool calls.

Your plan applies exactly as it does elsewhere

Tool calls are forwarded to the same public API with your own key. The window your plan reads, its rate limit, its monthly quota and its scope all apply here in exactly the same way, because there is only one set of rules and this is not a second copy of them.

Refusals are reworded for someone reading them inside an assistant rather than in a response body:

What happenedWhat the assistant is told
rate_limitedThat it is a pace limit rather than an outage, it clears within the minute, and to prefer one broad call over several narrow ones.
quota_exceededThat retrying will not help until the month resets, and where to see the reset date.
upgrade_requiredWhich plan the tool needs, and that an upgrade widens the existing key immediately with nothing to reissue.
outside_windowThe exact window the key reads, and that today and older history both fall outside a free one.

The rate limit note matters more here than anywhere else. An assistant can fire five tool calls answering a question where a person would make one, so a limit you would never trip by hand is reachable in a single conversation.

What comes back

The whole envelope, not just the data. That means the model can see data_as_of and the plan it is reading on, so it says "as of this morning, on a free key" rather than implying a figure is live.

What it will not do

There are no tips, no selections and no predictions in this data, and the server says so to the model before it sees a single tool. Every figure it can reach describes races that have already happened.

It is also a conversation rather than a download. For bulk work, use the API directly and read pulling a lot of data.

Questions worth asking it

  • Is there a draw bias at Chester over five furlongs?
  • How has this trainer done at Ascot on soft ground?
  • Have these two horses ever met?
  • What won at Newbury yesterday?
  • Does backing the favourite pay at Southwell?
  • What does this API actually hold?

The last one is worth trying first. It calls describe_coverage and tells you in one answer what is here and what your key reaches.