openapi: 3.1.0
info:
title: The Racing Australia Courses 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: Courses
paths:
/v1/courses/regions:
get:
tags:
- Courses
summary: The Racing API Regions
description: <h4>Get a list of regions, with region codes.</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: regions_v1_courses_regions_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/Region'
type: array
title: Response Regions V1 Courses Regions Get
'404':
description: Not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBasic: []
x-codeSamples:
- lang: Shell
source: 'curl -u USERNAME:PASSWORD https://api.theracingapi.com/v1/courses/regions
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/courses/regions"
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/courses/regions\";\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/courses/regions?${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/courses/regions'')
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/courses/regions\"))\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/courses/regions?\" + 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/courses/regions?{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/courses:
get:
tags:
- Courses
summary: The Racing API Courses
description: <h4>Get a list of courses, with course ids and regions.</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: courses_v1_courses_get
security:
- HTTPBasic: []
parameters:
- name: region_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
description: Filter courses 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>.
examples:
- gb
- ire
description: Filter courses 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>.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CoursesPage'
'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/courses
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/courses"
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/courses\";\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/courses?${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/courses'')
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/courses\"))\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/courses?\" + 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/courses?{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:
Region:
properties:
region:
type: string
title: Region
region_code:
type: string
title: Region Code
type: object
required:
- region
- region_code
title: Region
example:
region: Great Britain
region_code: gb
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:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
app__models__courses__Course:
properties:
id:
type: string
title: Id
course:
type: string
title: Course
region_code:
type: string
title: Region Code
region:
type: string
title: Region
type: object
required:
- id
- course
- region_code
- region
title: Course
example:
course: Ascot
id: crs_52
region: Great Britain
region_code: gb
CoursesPage:
properties:
courses:
items:
$ref: '#/components/schemas/app__models__courses__Course'
type: array
title: Courses
total:
type: integer
title: Total
type: object
required:
- courses
- total
title: CoursesPage
securitySchemes:
HTTPBasic:
type: http
scheme: basic
x-tagGroups:
- name: Get Started
tags:
- Introduction
- Authentication
- Endpoint Overview
- Rate Limits
- Changelog
- name: Core API
tags:
- Courses
- Dams
- Damsires
- Horses
- Jockeys
- Odds
- Owners
- Racecards
- Results
- Sires
- Trainers
- name: Core API (by plan level)
tags:
- Free Plan
- Basic Plan
- Standard Plan
- Pro Plan
- name: Regional APIs
tags:
- Australia
- North America