APIHorseRacing

Documentation / Market & analysis

Ask your own question

GET /v1/analysis/angles

Every filter combined freely, returning the standard block.

Available on

Free key not on this plan
Live not on this plan
Archive not on this plan
Complete not on this plan
Complete + Analyst 2017 → upcoming

Send your key in the X-API-Key header, or as ?key= if your tool cannot set one. A date outside your plan's window returns 403 outside_window naming the window, never an empty array.

Parameters

NameInTypeRequiredDescription
by query string no The dimension to group the answer by. Any of the seventeen.
region query string no Jurisdiction.
course_id query string no One course.
run_type query string no Flat, Hurdle, Chase or NH Flat.
distance query string no One distance as published.
going query string no One going as published.
class query string no One race class.
field_size query string no A field size band.
sp_band query string no A price band.
draw query string no low, middle or high third.
layoff query string no A days-since-last-run band.
trainer_id query string no One trainer.
jockey_id query string no One jockey.
min_runs query integer no Drop rows with fewer runners than this. Defaults to 1; 100 is sensible for anything you intend to believe.
date_from query string no YYYY-MM-DD.
date_to query string no YYYY-MM-DD.

Request

curl https://api.apihorseracing.com/v1/analysis/angles \
  -H "X-API-Key: $AHR_KEY"

Response

200 OK application/json harvested 8 days ago
{
    "meta": {
        "request_id": "66fb147338518557",
        "data_as_of": "2026-09-12T05:10:27+00:00",
        "plan": "analyst",
        "window": "2017 → upcoming"
    },
    "data": {
        "window": {
            "from": null,
            "to": null,
            "note": "The whole archive. Your plan sets no date limit."
        },
        "filters": {
            "run_type": "Chase",
            "favourite": "1",
            "min_runners": "12"
        },
        "overall": {
            "runs": 1263,
            "priced": 1263,
            "first": 280,
            "second": 190,
            "third": 147,
            "fourth": 113,
            "win_pct": 0.2217,
            "top3_pct": 0.4885,
            "expected_wins": 257.67,
            "a_e": 1.087,
            "a_e_range": [
                0.959,
                1.214
            ],
            "a_e_beats_market": false,
            "significant": false,
            "low_sample": false,
            "pl_1pt": -252.49,
            "roi_pct": -19.99
        }
    }
}

A real response from /v1/analysis/angles?run_type=Chase&favourite=1&min_runners=12, captured by calling the live API rather than written by hand.

Response fields

Each field is described once and rendered on every endpoint that returns it, so the wording cannot drift between pages.

FieldTypeWhat it is
window string How far back and forward that plan can read.
run_type string Flat, Hurdle, Chase or NH Flat.
favourite boolean Shortest price in the race. Joint favourites are all flagged.
runs integer Rides in the slice, priced or not.
priced integer Rides carrying a starting price. A/E and the profit figures use these; runs is the wider count.
first integer Wins.
second integer Seconds. Positions are returned separately so you apply your own place terms.
third integer Thirds.
fourth integer Fourths.
win_pct number Wins over runs. The number everyone quotes and the one that tells you least.
top3_pct number First, second or third over runs. Not a place strike rate; place terms vary.
expected_wins number Wins the market implied, summed over the slice.
a_e number Actual wins over expected. Above 1.00 means winning more often than the prices said.
a_e_range array Ninety five percent interval on A/E. If it spans 1.00 the figure is not evidence of anything.
a_e_beats_market boolean True only where the whole interval sits above 1.00.
significant boolean Whether the interval excludes 1.00 in either direction.
low_sample boolean Fewer than five expected wins. Treat A/E as noise.
pl_1pt number One point on every runner, settled at starting price.
roi_pct number Level stakes return. Backing everything loses more than the book margin, because equal stakes overweight the longshots.

What varies by jurisdiction

Run type is filled in behind the results crawl

The code a race was run under lives on the horse profile rather than the race, so it arrives on a later pass. A null run_type means not yet fetched, not unclassified.

Errors this endpoint returns

CodeStatusWhen
unauthorized 401 No key, or one we do not recognise. Check the header name and that the key has not been rotated from your account page.
upgrade_required 403 The endpoint returns computed statistics and your plan does not include them. The body names every plan that does reach it, so you never have to look it up.
invalid_param 422 A date that is not YYYY-MM-DD, a by= dimension we do not have, or a cursor that did not come from us. The message names the parameter.
rate_limited 429 Past your per-minute rate. Retry-After is set, and X-RateLimit-Remaining tells you where you stand on every successful response too.
server_error 500 Ours, not yours. Every response carries a request_id; quote it and we can find the exact request.

Run it live

A real request from your browser straight to api.apihorseracing.com with your own key. Nothing is proxied and nothing is logged by this page.

Remembered in this browser so you do not paste it on every page.

What this is for

Ask your own question. Every filter in the statistics engine, combined freely, returning the standard block grouped however you like. Chase handicaps on soft ground at fourteen runners or more, grouped by draw. Whatever you can describe.

This is the endpoint the Analyst tier is really for. The rest are convenient shapes for common questions; this one is the engine underneath them with the filters exposed.

It is also the easiest way in the whole API to fool yourself, and that is worth saying plainly rather than burying. Combining seven filters until something looks significant is not analysis, it is searching for noise, and with a million and a half runner records you will always find some. Every response therefore carries the runner count and the interval, and rows under about a hundred runners are flagged low_sample.

The honest way to use it is to decide the question before you run it, and to treat anything you find by exploring as a hypothesis to test on a period you did not look at.

Common uses

Testing an idea you already had

Describe it in filters, set min_runs high, and read the interval. One query, one answer.

Out-of-sample checking

Find something on date_to of a few years ago, then rerun it on the period after. Findings that survive that are worth keeping.

Replacing a spreadsheet

Most of what people build by exporting results and pivoting is one call here, with a confidence interval attached that the spreadsheet never had.

Notes

The filters are combined with AND. There is no OR, deliberately: it makes queries whose sample size is impossible to reason about.

Related in Market & analysis