Finding where a yard is underrated
by=course with min_runs=30. A course row with an interval clear of 1.00 is a real finding rather than a curiosity.
/v1/trainers/{trainer_id}/stats
Strike rate, A/E and level stakes, by any dimension.
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.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| trainer_id | path | string | yes | Opaque trainer identifier. |
| by | query | string | no | A breakdown dimension: course, region, run_type, distance, going, surface, class, year, month, draw, field_size, layoff, sp_band, jockey, owner or sire. Omit for the overall block. |
| min_runs | query | integer | no | Drop breakdown rows with fewer runs than this. Defaults to 1, but 30 is a more useful floor for anything you intend to act on. |
| date_from | query | string | no | YYYY-MM-DD. Clamped to your plan's window. |
| date_to | query | string | no | YYYY-MM-DD. Clamped to your plan's window. |
curl https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats \ -H "X-API-Key: $AHR_KEY"
$ch = curl_init('https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('AHR_KEY')], ]); $data = json_decode(curl_exec($ch), true)['data'];
const res = await fetch( 'https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats', { headers: { 'X-API-Key': process.env.AHR_KEY } } ); const { meta, data } = await res.json();
import os, requests r = requests.get( "https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats", headers={"X-API-Key": os.environ["AHR_KEY"]}, ).json()
curl https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats?key=$AHR_KEY
$url = 'https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats' . '?key=$AHR_KEY'; $data = json_decode(file_get_contents($url), true)['data'];
const res = await fetch( 'https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats?key=$AHR_KEY' ); const { meta, data } = await res.json();
import os, requests r = requests.get( "https://api.apihorseracing.com/v1/trainers/tr_2QVAXT3/stats?key=$AHR_KEY", ).json()
{ "meta": { "request_id": "e9ee597f4cd58802", "data_as_of": "2026-09-12T05:10:27+00:00", "plan": "analyst", "window": "2017 → upcoming", "count": 3 }, "data": { "trainer_id": "tr_2QVAXT3", "trainer": "Ben Clarke", "window": { "from": null, "to": null, "note": "The whole archive. Your plan sets no date limit." }, "overall": { "runs": 425, "priced": 425, "first": 54, "second": 63, "third": 59, "fourth": 38, "win_pct": 0.1271, "top3_pct": 0.4141, "expected_wins": 48.39, "a_e": 1.116, "a_e_range": [ 0.818, 1.413 ], "a_e_beats_market": false, "significant": false, "low_sample": false, "pl_1pt": -90.11, "roi_pct": -21.2 }, "by": "course", "course": [ { "course": "Exeter", "runs": 57, "priced": 57, "first": 5, "second": 7, "third": 11, "fourth": 3, "win_pct": 0.0877, "top3_pct": 0.4035, "expected_wins": 6.04, "a_e": 0.827, "a_e_range": [ 0.102, 1.553 ], "a_e_beats_market": false, "significant": false, "low_sample": false, "pl_1pt": -31.18, "roi_pct": -54.7 }, { "course": "Chepstow", "runs": 52, "priced": 52, "first": 5, "second": 6, "third": 7, "fourth": 3, "win_pct": 0.0962, "top3_pct": 0.3462, "expected_wins": 4.98, "a_e": 1.003, "a_e_range": [ 0.124, 1.883 ], "a_e_beats_market": false, "significant": false, "low_sample": true, "pl_1pt": -31.02, "roi_pct": -59.66 }, "… 1 more" ] } }
A real response from /v1/trainers/tr_2QVAXT3/stats?by=course&limit=3,
captured by calling the live API rather than written by hand.
Each field is described once and rendered on every endpoint that returns it, so the wording cannot drift between pages.
| Field | Type | What it is |
|---|---|---|
| trainer_id | string | Opaque trainer identifier. |
| trainer | string | Trainer name. |
| window | string | How far back and forward that plan can read. |
| 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. |
| course | string | Course name. |
| Code | Status | When |
|---|---|---|
| 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. |
| not_found | 404 | The identifier is well formed but nothing has it. Distinct from invalid_id, which means the identifier itself is wrong. |
| invalid_id | 422 | The prefix does not match the kind of thing the path expects, or the identifier is malformed. A horse id passed where a race is wanted lands here rather than returning the wrong race. |
| 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. |
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. Forget it
The standard statistics block for a yard, split any of sixteen ways: runs, wins, places, strike rate, A/E against the market, and level stakes profit, each with a confidence interval.
A trainer is where A/E finally has enough data to mean something. A busy yard runs thousands of horses across the archive, which is the sample size a single horse can never reach, so significance is achievable here rather than theoretical.
Read A/E rather than strike rate. A yard with a 22% strike rate and an A/E of 0.93 is winning often because it runs good horses, and losing money doing it. A yard at 9% with an A/E of 1.11 is beating its prices. Only the second of those is information the market has not already priced.
Void and abandoned races are excluded, so a wet January does not quietly penalise whoever had most entries that month.
by=course with min_runs=30. A course row with an interval clear of 1.00 is a real finding rather than a curiosity.
by=month over the full archive. Most seasonal patterns evaporate once the interval is shown, which is itself worth knowing.
Same by= and same min_runs on both. Comparing a headline strike rate between yards compares their horses, not their training.
Sixteen dimensions rather than seventeen: by=trainer is meaningless here, so it is rejected with invalid_param rather than silently ignored.