openapi: 3.1.0
info:
title: The Racing Australia Racecards 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: Racecards
paths:
/v1/racecards/free:
get:
tags:
- Racecards
summary: The Racing API Racecards Free
description: <h4>Get racecards for today and tomorrow (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 request per second</td></tr></tbody></table>
operationId: racecards_free_v1_racecards_free_get
security:
- HTTPBasic: []
parameters:
- name: day
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Day
description: Query racecards by day:<br> today, tomorrow
default: today
description: Query racecards by day:<br> today, tomorrow
- name: region_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
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>'
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_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Courses
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>.
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: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
title: Limit
default: 500
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RacecardsBasicPage'
'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/racecards/free
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/racecards/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/racecards/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/racecards/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/racecards/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/racecards/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/racecards/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/racecards/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/racecards/basic:
get:
tags:
- Racecards
summary: The Racing API Racecards Basic
description: <h4>Get racecards for today and tomorrow</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Basic</td></tr><tr><td><b>Rate Limit</b></td><td>2 requests per second</td></tr></tbody></table>
operationId: racecards_basic_v1_racecards_basic_get
security:
- HTTPBasic: []
parameters:
- name: day
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Day
description: Query racecards by day:<br> today, tomorrow
default: today
description: Query racecards by day:<br> today, tomorrow
- name: region_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
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>'
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_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Courses
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>.
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: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
title: Limit
default: 500
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RacecardsPage'
'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/racecards/basic
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/racecards/basic"
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/racecards/basic\";\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/racecards/basic?${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/racecards/basic'')
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/racecards/basic\"))\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/racecards/basic?\" + 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/racecards/basic?{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/racecards/standard:
get:
tags:
- Racecards
summary: The Racing API Racecards Standard
description: <h4>Get racecards for today and tomorrow, including runner odds for UK & Irish racing.</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Standard</td></tr><tr><td><b>Rate Limit</b></td><td>2 requests per second</td></tr></tbody></table>
operationId: racecards_standard_v1_racecards_standard_get
security:
- HTTPBasic: []
parameters:
- name: day
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Day
description: Query racecards by day:<br> today, tomorrow
default: today
description: Query racecards by day:<br> today, tomorrow
- name: region_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
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>'
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_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Courses
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>.
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: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
title: Limit
default: 500
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RacecardsOddsPage'
'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/racecards/standard
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/racecards/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/racecards/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, 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/racecards/standard?${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/racecards/standard'')
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/racecards/standard\"))\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/racecards/standard?\" + 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/racecards/standard?{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/racecards/pro:
get:
tags:
- Racecards
summary: The Racing API Racecards Pro
description: <h4>Get future and historical racecards, including runner odds for UK & Irish racing.</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Pro</td></tr><tr><td><b>Rate Limit</b></td><td>2 requests per second</td></tr></tbody></table><p>ℹ️ Historical racecards are available from 2023-01-23, when our tracking began. Future racecards are available up to 1 week in advance.</p>
operationId: racecards_pro_v1_racecards_pro_get
security:
- HTTPBasic: []
parameters:
- name: date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Date
description: Query racecards by date with format YYYY-MM-DD (e.g 2023-04-05)
description: Query racecards by date with format YYYY-MM-DD (e.g 2023-04-05)
- name: region_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
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>'
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_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Courses
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>.
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: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
title: Limit
default: 500
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RacecardsOddsProPage'
'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/racecards/pro
'
label: cURL
- lang: Python
source: 'import requests
from requests.auth import HTTPBasicAuth
url = "https://api.theracingapi.com/v1/racecards/pro"
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/racecards/pro\";\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/racecards/pro?${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/racecards/pro'')
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/racecards/pro\"))\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/racecards/pro?\" + 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/racecards/pro?{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/racecards/big-races:
get:
tags:
- Racecards
summary: The Racing API Racecards Big Races
description: <h4>Get detailed racecards for future big races and main events, such as Cheltenham, The Grand National and The Derby.</h4><table><tbody><tr><td><b>Min. Required Plan</b></td><td>Standard</td></tr><tr><td><b>Rate Limit</b></td><td>2 requests per second</td></tr></tbody></table>
operationId: racecards_big_races_v1_racecards_big_races_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>Date must be today or greater, defaults to today.</p>
title: Start Date
description: <p>Query from date with format YYYY-MM-DD, e.g. <code>2020-01-01</code></p><p>Date must be today or greater, defaults to today.</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_codes
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Regions
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>'
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_ids
in: query
required: false
schema:
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Courses
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>.
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: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
title: Limit
default: 500
- name: skip
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
- type: 'null'
title: Skip
default: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RacecardsOddsPage'
'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.the
# --- truncated at 32 KB (132 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/the-racing-api/refs/heads/main/openapi/the-racing-api-racecards-api-openapi.yml