openapi: 3.1.0
info:
title: The Racing Australia Horses API
version: 1.4.3
x-logo:
url: https://www.theracingapi.com/static/images/logo_padded.png
description: High performance API for horse racing statistical modelling, application development and web content. Complete coverage of UK, Irish and Hong Kong horse racing.
contact:
url: https://www.theracingapi.com/
x-generated-from: official-openapi-spec
servers:
- url: https://api.theracingapi.com
description: Production server
tags:
- name: Horses
paths:
/v1/horses/search:
get:
tags:
- Horses
summary: The Racing API Horse Search
description: <h4>Search horses by name</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Standard</td></tr><tr><td><b>Rate Limit</b></td><td>5 requests per second</td></tr></tbody></table>
operationId: horse_search_v1_horses_search_get
security:
- HTTPBasic: []
parameters:
- name: name
in: query
required: true
schema:
type: string
title: Name
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Horses'
'404':
description: Not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-codeSamples:
- lang: Shell
source: 'curl -u USERNAME:PASSWORD https://api.theracingapi.com/v1/horses/search
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/horses/search"
params = {}
response = requests.request("GET", url, auth=HTTPBasicAuth(''USERNAME'',''PASSWORD''), params=params)
print(response.json())'
label: Python3
- lang: PHP
source: "<?php\n$username = 'USERNAME';\n$password = 'PASSWORD';\n$url = \"https://api.theracingapi.com/v1/horses/search\";\n\n$params = http_build_query([ ]);\n\n$ch = curl_init(\"$url?$params\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\ncurl_setopt($ch, CURLOPT_USERPWD, \"$username:$password\");\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n} else {\n echo $response;\n}\n\ncurl_close($ch);\n?>"
label: PHP
- lang: JavaScript
source: "const username = 'USERNAME';\nconst password = 'PASSWORD';\nconst credentials = btoa(`${username}:${password}`);\n\nconst params = new URLSearchParams({});\nconst url = `https://api.theracingapi.com/v1/horses/search?${params}`;\n\nfetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Basic ${credentials}`\n }\n})\n.then(response => response.json())\n.then(data => console.log(data))\n.catch(error => console.error('Error:', error));"
label: Node.js
- lang: Ruby
source: 'require ''net/http''
require ''uri''
require ''json''
params = {}
uri = URI(''https://api.theracingapi.com/v1/horses/search'')
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request.basic_auth(''USERNAME'', ''PASSWORD'')
response = http.request(request)
puts JSON.parse(response.body)'
label: Ruby
- lang: Java
source: "import java.net.http.*;\nimport java.util.Base64;\nimport java.util.Map;\n\nMap<String, String> params = Map.of();\nString credentials = Base64.getEncoder()\n .encodeToString(\"USERNAME:PASSWORD\".getBytes());\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(\"https://api.theracingapi.com/v1/horses/search\"))\n .header(\"Authorization\", \"Basic \" + credentials)\n .build();\n\nHttpResponse<String> response = client.send(\n request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());"
label: Java
- lang: Go
source: "package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"net/url\"\n)\n\nfunc main() {\n params := url.Values{}\n url := \"https://api.theracingapi.com/v1/horses/search?\" + params.Encode()\n\n client := &http.Client{}\n req, _ := http.NewRequest(\"GET\", url, nil)\n req.SetBasicAuth(\"USERNAME\", \"PASSWORD\")\n\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n body, _ := io.ReadAll(resp.Body)\n fmt.Println(string(body))\n}"
label: Go
- lang: C#
source: "using System.Net.Http.Headers;\nusing System.Text;\nusing System.Web;\n\nvar params_ = HttpUtility.ParseQueryString(string.Empty);\nvar url = $\"https://api.theracingapi.com/v1/horses/search?{params_}\";\n\nvar client = new HttpClient();\nvar credentials = Convert.ToBase64String(\n Encoding.ASCII.GetBytes(\"USERNAME:PASSWORD\"));\nclient.DefaultRequestHeaders.Authorization =\n new AuthenticationHeaderValue(\"Basic\", credentials);\n\nvar response = await client.GetAsync(url);\nvar content = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(content);"
label: .NET
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v1/horses/{horse_id}/results:
get:
tags:
- Horses
summary: The Racing API Horse Results
description: <h4>Get full historical results for a horse</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Pro</td></tr><tr><td><b>Rate Limit</b></td><td>5 requests per second</td></tr></tbody></table>
operationId: horse_results_v1_horses__horse_id__results_get
security:
- HTTPBasic: []
parameters:
- name: horse_id
in: path
required: true
schema:
type: string
title: Horse Id
- name: start_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
title: Start Date
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
- name: end_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: <p>Query to date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
title: End Date
description: <p>Query to date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
- name: region
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by region codes. Get the full list <a href=''https://api.theracingapi.com/documentation#tag/Courses/operation/list_regions_v1_courses_regions_get''>here</a>.</p><p>Note: If the course query parameter is specified, this will be ignored.</p>'
title: Region
description: '<p>Query by region codes. Get the full list <a href=''https://api.theracingapi.com/documentation#tag/Courses/operation/list_regions_v1_courses_regions_get''>here</a>.</p><p>Note: If the course query parameter is specified, this will be ignored.</p>'
- name: course
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: Query by course ids. Get the full list <a href='https://api.theracingapi.com/documentation#tag/Courses/operation/list_courses_v1_courses_get'>here</a>.
title: Course
description: Query by course ids. Get the full list <a href='https://api.theracingapi.com/documentation#tag/Courses/operation/list_courses_v1_courses_get'>here</a>.
- name: type
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by race type</p><p>Options: <code>chase</code>, <code>flat</code>, <code>hurdle</code>, <code>nh_flat</code></p>'
title: Type
description: '<p>Query by race type</p><p>Options: <code>chase</code>, <code>flat</code>, <code>hurdle</code>, <code>nh_flat</code></p>'
- name: going
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by going</p><p>Options: <code>fast</code>, <code>firm</code>, <code>good</code>, <code>good_to_firm</code>, <code>good_to_soft</code>, <code>good_to_yielding</code>, <code>hard</code>, <code>heavy</code>, <code>holding</code>, <code>muddy</code>, <code>sloppy</code>, <code>slow</code>, <code>soft</code>, <code>soft_to_heavy</code>, <code>standard</code>, <code>standard_to_fast</code>, <code>standard_to_slow</code>, <code>very_soft</code>, <code>yielding</code>, <code>yielding_to_soft</code></p>'
title: Going
description: '<p>Query by going</p><p>Options: <code>fast</code>, <code>firm</code>, <code>good</code>, <code>good_to_firm</code>, <code>good_to_soft</code>, <code>good_to_yielding</code>, <code>hard</code>, <code>heavy</code>, <code>holding</code>, <code>muddy</code>, <code>sloppy</code>, <code>slow</code>, <code>soft</code>, <code>soft_to_heavy</code>, <code>standard</code>, <code>standard_to_fast</code>, <code>standard_to_slow</code>, <code>very_soft</code>, <code>yielding</code>, <code>yielding_to_soft</code></p>'
- name: race_class
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by class</p><p>Options: <code>class_1</code>, <code>class_2</code>, <code>class_3</code>, <code>class_4</code>, <code>class_5</code>, <code>class_6</code>, <code>class_7</code></p>'
title: Race Class
description: '<p>Query by class</p><p>Options: <code>class_1</code>, <code>class_2</code>, <code>class_3</code>, <code>class_4</code>, <code>class_5</code>, <code>class_6</code>, <code>class_7</code></p>'
- name: min_distance_y
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
description: <p>Query by minimum race distance (yards)</p>
title: Min Distance Y
description: <p>Query by minimum race distance (yards)</p>
- name: max_distance_y
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
description: <p>Query by maximum race distance (yards)</p>
title: Max Distance Y
description: <p>Query by maximum race distance (yards)</p>
- name: age_band
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by age band</p><p>Options: <code>10yo+</code>, <code>2-3yo</code>, <code>2yo</code>, <code>2yo+</code>, <code>3-4yo</code>, <code>3-5yo</code>, <code>3-6yo</code>, <code>3yo</code>, <code>3yo+</code>, <code>4-5yo</code>, <code>4-6yo</code>, <code>4-7yo</code>, <code>4-8yo</code>, <code>4yo</code>, <code>4yo+</code>, <code>5-6yo</code>, <code>5-7yo</code>, <code>5-8yo</code>, <code>5yo</code>, <code>5yo+</code>, <code>6-7yo</code>, <code>6yo</code>, <code>6yo+</code>, <code>7yo+</code>, <code>8yo+</code>, <code>9yo+</code></p>'
title: Age Band
description: '<p>Query by age band</p><p>Options: <code>10yo+</code>, <code>2-3yo</code>, <code>2yo</code>, <code>2yo+</code>, <code>3-4yo</code>, <code>3-5yo</code>, <code>3-6yo</code>, <code>3yo</code>, <code>3yo+</code>, <code>4-5yo</code>, <code>4-6yo</code>, <code>4-7yo</code>, <code>4-8yo</code>, <code>4yo</code>, <code>4yo+</code>, <code>5-6yo</code>, <code>5-7yo</code>, <code>5-8yo</code>, <code>5yo</code>, <code>5yo+</code>, <code>6-7yo</code>, <code>6yo</code>, <code>6yo+</code>, <code>7yo+</code>, <code>8yo+</code>, <code>9yo+</code></p>'
- name: sex_restriction
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by sex restriction</p><p>Options: <code>c&f</code>, <code>c&g</code>, <code>f</code>, <code>f&m</code>, <code>m</code>, <code>m&g</code></p>'
title: Sex Restriction
description: '<p>Query by sex restriction</p><p>Options: <code>c&f</code>, <code>c&g</code>, <code>f</code>, <code>f&m</code>, <code>m</code>, <code>m&g</code></p>'
- name: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 100
minimum: 1
- type: 'null'
title: Limit
default: 50
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 20000
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ResultsStandardPage'
'404':
description: Not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-codeSamples:
- lang: Shell
source: 'curl -u USERNAME:PASSWORD https://api.theracingapi.com/v1/horses/{horse_id}/results
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/horses/{horse_id}/results"
params = {}
response = requests.request("GET", url, auth=HTTPBasicAuth(''USERNAME'',''PASSWORD''), params=params)
print(response.json())'
label: Python3
- lang: PHP
source: "<?php\n$username = 'USERNAME';\n$password = 'PASSWORD';\n$url = \"https://api.theracingapi.com/v1/horses/{horse_id}/results\";\n\n$params = http_build_query([ ]);\n\n$ch = curl_init(\"$url?$params\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\ncurl_setopt($ch, CURLOPT_USERPWD, \"$username:$password\");\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n} else {\n echo $response;\n}\n\ncurl_close($ch);\n?>"
label: PHP
- lang: JavaScript
source: "const username = 'USERNAME';\nconst password = 'PASSWORD';\nconst credentials = btoa(`${username}:${password}`);\n\nconst params = new URLSearchParams({});\nconst url = `https://api.theracingapi.com/v1/horses/{horse_id}/results?${params}`;\n\nfetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Basic ${credentials}`\n }\n})\n.then(response => response.json())\n.then(data => console.log(data))\n.catch(error => console.error('Error:', error));"
label: Node.js
- lang: Ruby
source: 'require ''net/http''
require ''uri''
require ''json''
params = {}
uri = URI(''https://api.theracingapi.com/v1/horses/{horse_id}/results'')
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request.basic_auth(''USERNAME'', ''PASSWORD'')
response = http.request(request)
puts JSON.parse(response.body)'
label: Ruby
- lang: Java
source: "import java.net.http.*;\nimport java.util.Base64;\nimport java.util.Map;\n\nMap<String, String> params = Map.of();\nString credentials = Base64.getEncoder()\n .encodeToString(\"USERNAME:PASSWORD\".getBytes());\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(\"https://api.theracingapi.com/v1/horses/{horse_id}/results\"))\n .header(\"Authorization\", \"Basic \" + credentials)\n .build();\n\nHttpResponse<String> response = client.send(\n request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());"
label: Java
- lang: Go
source: "package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"net/url\"\n)\n\nfunc main() {\n params := url.Values{}\n url := \"https://api.theracingapi.com/v1/horses/{horse_id}/results?\" + params.Encode()\n\n client := &http.Client{}\n req, _ := http.NewRequest(\"GET\", url, nil)\n req.SetBasicAuth(\"USERNAME\", \"PASSWORD\")\n\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n body, _ := io.ReadAll(resp.Body)\n fmt.Println(string(body))\n}"
label: Go
- lang: C#
source: "using System.Net.Http.Headers;\nusing System.Text;\nusing System.Web;\n\nvar params_ = HttpUtility.ParseQueryString(string.Empty);\nvar url = $\"https://api.theracingapi.com/v1/horses/{horse_id}/results?{params_}\";\n\nvar client = new HttpClient();\nvar credentials = Convert.ToBase64String(\n Encoding.ASCII.GetBytes(\"USERNAME:PASSWORD\"));\nclient.DefaultRequestHeaders.Authorization =\n new AuthenticationHeaderValue(\"Basic\", credentials);\n\nvar response = await client.GetAsync(url);\nvar content = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(content);"
label: .NET
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v1/horses/{horse_id}/analysis/distance-times:
get:
tags:
- Horses
summary: The Racing API Horse Distance Time Analysis
description: <h4>Get horse statistics by race distance, with breakdowns of times.</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Basic</td></tr><tr><td><b>Rate Limit</b></td><td>5 requests per second</td></tr></tbody></table>
operationId: horse_distance_time_analysis_v1_horses__horse_id__analysis_distance_times_get
security:
- HTTPBasic: []
parameters:
- name: horse_id
in: path
required: true
schema:
type: string
title: Horse Id
- name: start_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
title: Start Date
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
- name: end_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: <p>Query to date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
title: End Date
description: <p>Query to date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p>
- name: region
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by region codes. Get the full list <a href=''https://api.theracingapi.com/documentation#tag/Courses/operation/list_regions_v1_courses_regions_get''>here</a>.</p><p>Note: If the course query parameter is specified, this will be ignored.</p>'
title: Region
description: '<p>Query by region codes. Get the full list <a href=''https://api.theracingapi.com/documentation#tag/Courses/operation/list_regions_v1_courses_regions_get''>here</a>.</p><p>Note: If the course query parameter is specified, this will be ignored.</p>'
- name: course
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: Query by course ids. Get the full list <a href='https://api.theracingapi.com/documentation#tag/Courses/operation/list_courses_v1_courses_get'>here</a>.
title: Course
description: Query by course ids. Get the full list <a href='https://api.theracingapi.com/documentation#tag/Courses/operation/list_courses_v1_courses_get'>here</a>.
- name: type
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by race type</p><p>Options: <code>chase</code>, <code>flat</code>, <code>hurdle</code>, <code>nh_flat</code></p>'
title: Type
description: '<p>Query by race type</p><p>Options: <code>chase</code>, <code>flat</code>, <code>hurdle</code>, <code>nh_flat</code></p>'
- name: going
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by going</p><p>Options: <code>fast</code>, <code>firm</code>, <code>good</code>, <code>good_to_firm</code>, <code>good_to_soft</code>, <code>good_to_yielding</code>, <code>hard</code>, <code>heavy</code>, <code>holding</code>, <code>muddy</code>, <code>sloppy</code>, <code>slow</code>, <code>soft</code>, <code>soft_to_heavy</code>, <code>standard</code>, <code>standard_to_fast</code>, <code>standard_to_slow</code>, <code>very_soft</code>, <code>yielding</code>, <code>yielding_to_soft</code></p>'
title: Going
description: '<p>Query by going</p><p>Options: <code>fast</code>, <code>firm</code>, <code>good</code>, <code>good_to_firm</code>, <code>good_to_soft</code>, <code>good_to_yielding</code>, <code>hard</code>, <code>heavy</code>, <code>holding</code>, <code>muddy</code>, <code>sloppy</code>, <code>slow</code>, <code>soft</code>, <code>soft_to_heavy</code>, <code>standard</code>, <code>standard_to_fast</code>, <code>standard_to_slow</code>, <code>very_soft</code>, <code>yielding</code>, <code>yielding_to_soft</code></p>'
- name: race_class
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by class</p><p>Options: <code>class_1</code>, <code>class_2</code>, <code>class_3</code>, <code>class_4</code>, <code>class_5</code>, <code>class_6</code>, <code>class_7</code></p>'
title: Race Class
description: '<p>Query by class</p><p>Options: <code>class_1</code>, <code>class_2</code>, <code>class_3</code>, <code>class_4</code>, <code>class_5</code>, <code>class_6</code>, <code>class_7</code></p>'
- name: min_distance_y
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
description: <p>Query by minimum race distance (yards)</p>
title: Min Distance Y
description: <p>Query by minimum race distance (yards)</p>
- name: max_distance_y
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
description: <p>Query by maximum race distance (yards)</p>
title: Max Distance Y
description: <p>Query by maximum race distance (yards)</p>
- name: age_band
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by age band</p><p>Options: <code>10yo+</code>, <code>2-3yo</code>, <code>2yo</code>, <code>2yo+</code>, <code>3-4yo</code>, <code>3-5yo</code>, <code>3-6yo</code>, <code>3yo</code>, <code>3yo+</code>, <code>4-5yo</code>, <code>4-6yo</code>, <code>4-7yo</code>, <code>4-8yo</code>, <code>4yo</code>, <code>4yo+</code>, <code>5-6yo</code>, <code>5-7yo</code>, <code>5-8yo</code>, <code>5yo</code>, <code>5yo+</code>, <code>6-7yo</code>, <code>6yo</code>, <code>6yo+</code>, <code>7yo+</code>, <code>8yo+</code>, <code>9yo+</code></p>'
title: Age Band
description: '<p>Query by age band</p><p>Options: <code>10yo+</code>, <code>2-3yo</code>, <code>2yo</code>, <code>2yo+</code>, <code>3-4yo</code>, <code>3-5yo</code>, <code>3-6yo</code>, <code>3yo</code>, <code>3yo+</code>, <code>4-5yo</code>, <code>4-6yo</code>, <code>4-7yo</code>, <code>4-8yo</code>, <code>4yo</code>, <code>4yo+</code>, <code>5-6yo</code>, <code>5-7yo</code>, <code>5-8yo</code>, <code>5yo</code>, <code>5yo+</code>, <code>6-7yo</code>, <code>6yo</code>, <code>6yo+</code>, <code>7yo+</code>, <code>8yo+</code>, <code>9yo+</code></p>'
- name: sex_restriction
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: '<p>Query by sex restriction</p><p>Options: <code>c&f</code>, <code>c&g</code>, <code>f</code>, <code>f&m</code>, <code>m</code>, <code>m&g</code></p>'
title: Sex Restriction
description: '<p>Query by sex restriction</p><p>Options: <code>c&f</code>, <code>c&g</code>, <code>f</code>, <code>f&m</code>, <code>m</code>, <code>m&g</code></p>'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/HorseDistanceTimeAnalysis'
'404':
description: Not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-codeSamples:
- lang: Shell
source: 'curl -u USERNAME:PASSWORD https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times"
params = {}
response = requests.request("GET", url, auth=HTTPBasicAuth(''USERNAME'',''PASSWORD''), params=params)
print(response.json())'
label: Python3
- lang: PHP
source: "<?php\n$username = 'USERNAME';\n$password = 'PASSWORD';\n$url = \"https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times\";\n\n$params = http_build_query([ ]);\n\n$ch = curl_init(\"$url?$params\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\ncurl_setopt($ch, CURLOPT_USERPWD, \"$username:$password\");\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n} else {\n echo $response;\n}\n\ncurl_close($ch);\n?>"
label: PHP
- lang: JavaScript
source: "const username = 'USERNAME';\nconst password = 'PASSWORD';\nconst credentials = btoa(`${username}:${password}`);\n\nconst params = new URLSearchParams({});\nconst url = `https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times?${params}`;\n\nfetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Basic ${credentials}`\n }\n})\n.then(response => response.json())\n.then(data => console.log(data))\n.catch(error => console.error('Error:', error));"
label: Node.js
- lang: Ruby
source: 'require ''net/http''
require ''uri''
require ''json''
params = {}
uri = URI(''https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times'')
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request.basic_auth(''USERNAME'', ''PASSWORD'')
response = http.request(request)
puts JSON.parse(response.body)'
label: Ruby
- lang: Java
source: "import java.net.http.*;\nimport java.util.Base64;\nimport java.util.Map;\n\nMap<String, String> params = Map.of();\nString credentials = Base64.getEncoder()\n .encodeToString(\"USERNAME:PASSWORD\".getBytes());\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(\"https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times\"))\n .header(\"Authorization\", \"Basic \" + credentials)\n .build();\n\nHttpResponse<String> response = client.send(\n request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());"
label: Java
- lang: Go
source: "package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"net/url\"\n)\n\nfunc main() {\n params := url.Values{}\n url := \"https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times?\" + params.Encode()\n\n client := &http.Client{}\n req, _ := http.NewRequest(\"GET\", url, nil)\n req.SetBasicAuth(\"USERNAME\", \"PASSWORD\")\n\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n body, _ := io.ReadAll(resp.Body)\n fmt.Println(string(body))\n}"
label: Go
- lang: C#
source: "using System.Net.Http.Headers;\nusing System.Text;\nusing System.Web;\n\nvar params_ = HttpUtility.ParseQueryString(string.Empty);\nvar url = $\"https://api.theracingapi.com/v1/horses/{horse_id}/analysis/distance-times?{params_}\";\n\nvar client = new HttpClient();\nvar credentials = Convert.ToBase64String(\n Encoding.ASCII.GetBytes(\"USERNAME:PASSWORD\"));\nclient.DefaultRequestHeaders.Authorization =\n new AuthenticationHeaderValue(\"Basic\", credentials);\n\nvar response = await client.GetAsync(url);\nvar content = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(content);"
label: .NET
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v1/horses/{horse_id}/standard:
get:
tags:
- Horses
summary: The Racing API Horse Standard
description: <h4>Get a basic horse profile</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Standard</td></tr><tr><td><b>Rate Limit</b></td><td>5 requests per second</td></tr></tbody></table><p>ℹ️ You may also get profiles for a sire/dam/damsire using this endpoint by replacing their id prefix with 'hrs_'</p>
operationId: horse_standard_v1_horses__horse_id__standard_get
security:
- HTTPBasic: []
parameters:
- name: horse_id
in: path
required: true
schema:
type: string
title: Horse Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Horse'
'404':
description: Not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
x-codeSamples:
- lang: Shell
source: 'curl -u USERNAME:PASSWORD https://api.theracingapi.com/v1/horses/{horse_id}/standard
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/horses/{horse_id}/standard"
params = {}
response = requests.request("GET", url, auth=HTTPBasicAuth(''USERNAME'',''PASSWORD''), params=params)
print(response.json())'
label: Python3
- lang: PHP
source: "<?php\n$username = 'USERNAME';\n$password = 'PASSWORD';\n$url = \"https://api.theracingapi.com/v1/horses/{horse_id}/standard\";\n\n$params = http_build_query([ ]);\n\n$ch = curl_init(\"$url?$params\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\ncurl_setopt($ch, CURL
# --- truncated at 32 KB (59 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/the-racing-api/refs/heads/main/openapi/the-racing-api-horses-api-openapi.yml