openapi: 3.1.0
info:
title: The Racing Australia Results 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: Results
paths:
/v1/results:
get:
tags:
- Results
summary: The Racing API Results
description: '<h4>Get historic results for all races in the last 12 months</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><tr><td><b>Add-ons</b></td><td><b>[Optional] Core database historical results add-on</b>: users on the Pro Plan can pay a one-time fee of £499 to remove the 12 month restriction and access over 30 years of results from this endpoint. Contact <a href=''mailto:support@theracingapi.com''>support@theracingapi.com</a> for information.</td></tr></tbody></table><h4>Efficiently querying and exporting results data</h4><p>While the parameters for this endpoint allow for a wide date range to be set (utilising ''start_date'' and ''end_date''), the necessary use of ''skip'' to access all results for a wide date range query will reduce perfomance the larger that range is.</p><p>ℹ️ The most efficient way to query results data over time is to build a list of dates within your date range, then make queries for each date in that list. A sample python script outlining this method can be viewed here: <a href=''https://gist.github.com/theracingapi/4d492dbdba58c2072fe4f98ee090126f'' target=''_blank''>https://gist.github.com/theracingapi/4d492dbdba58c2072fe4f98ee090126f</a></p>'
operationId: results_v1_results_get
security:
- HTTPBasic: []
parameters:
- 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><p><b>Default:</b> 365 days ago. Limited to up to 365 days in the past; pro plan users can purchase the historical results add-on to remove this limitation and query back to 1988-01-01.</p>
title: Start Date
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p><p><b>Default:</b> 365 days ago. Limited to up to 365 days in the past; pro plan users can purchase the historical results add-on to remove this limitation and query back to 1988-01-01.</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><p><b>Default:</b> Today's date. Maximum range between start and end date is 365 days.</p>
title: End Date
description: <p>Query to date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p><p><b>Default:</b> Today's date. Maximum range between start and end date is 365 days.</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/results
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/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/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/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/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/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/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/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/results/today:
get:
tags:
- Results
summary: The Racing API Results Today
description: <h4>Get today's results</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: results_today_v1_results_today_get
security:
- HTTPBasic: []
parameters:
- name: region
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: <p>Query results 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>
title: Region
description: <p>Query results 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>
- 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
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ResultsBasicPage'
'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/results/today
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/results/today"
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/results/today\";\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/results/today?${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/results/today'')
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/results/today\"))\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/results/today?\" + 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/results/today?{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/results/today/free:
get:
tags:
- Results
summary: The Racing API Results Today Free
description: <h4>Get today's results (basic data only)</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Free</td></tr><tr><td><b>Rate Limit</b></td><td>1 requests per second</td></tr></tbody></table>
operationId: results_today_free_v1_results_today_free_get
security:
- HTTPBasic: []
parameters:
- name: region
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: <p>Query results 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>
title: Region
description: <p>Query results 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>
- 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
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ResultsFreePage'
'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/results/today/free
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/results/today/free"
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/results/today/free\";\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/results/today/free?${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/results/today/free'')
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/results/today/free\"))\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/results/today/free?\" + 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/results/today/free?{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/results/{race_id}:
get:
tags:
- Results
summary: The Racing API Result
description: <h4>Get a result</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: result_v1_results__race_id__get
security:
- HTTPBasic: []
parameters:
- name: race_id
in: path
required: true
schema:
type: string
title: Race Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ResultStandard'
'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/results/{race_id}
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/results/{race_id}"
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/results/{race_id}\";\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/results/{race_id}?${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/results/{race_id}'')
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/results/{race_id}\"))\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/results/{race_id}?\" + 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/results/{race_id}?{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
components:
schemas:
ResultsFreePage:
properties:
results:
anyOf:
- items:
$ref: '#/components/schemas/ResultFree'
type: array
- type: 'null'
title: Results
total:
type: integer
title: Total
limit:
type: integer
title: Limit
skip:
type: integer
title: Skip
query:
items:
items: {}
type: array
type: array
title: Query
type: object
required:
- results
- total
- limit
- skip
- query
title: ResultsFreePage
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
typ
# --- truncated at 32 KB (57 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/the-racing-api/refs/heads/main/openapi/the-racing-api-results-api-openapi.yml