Horses and people › A jockey's record
A jockey's record
Find a jockey by name, then read the career record: rides, wins and strike rate.
# A jockey's record
# needs: AHR_KEY in your environment, and jq to read the reply
ID=$(curl -s "https://api.apihorseracing.com/v1/jockeys/search?name=Townend" \
-H "X-API-Key: $AHR_KEY" | jq -r '.data[0].jockey_id')
curl -s "https://api.apihorseracing.com/v1/jockeys/$ID" \
-H "X-API-Key: $AHR_KEY" \
| jq -r '.data | "Jockey: \(.name)", "Rides: \(.record.runs)", "Wins: \(.record.wins)", "Win share: \(.record.win_pct)"'
What the reply holds
- record.runs
- Rides on file.
- record.wins
- Winners.
- record.win_pct
- Wins as a share of rides, 0 to 1.
When it says no
401no_key The key is missing or mistyped. Every sample reads it from AHR_KEY.403plan_needed Your plan does not reach this. The reply names the plan that does.429rate_limited Too fast. Wait the seconds in Retry-After, then try again.