Skip to content

Instantly share code, notes, and snippets.

View theracingapi's full-sized avatar

The Racing API theracingapi

View GitHub Profile
@theracingapi
theracingapi / na_data_pull.py
Last active February 20, 2024 06:51
Python script to pull North America meet entries and results data since tracking began in July 2023 (North America Data Add-On Required)
import requests
from requests.auth import HTTPBasicAuth
import json
import pandas
from datetime import datetime, timedelta
import time
user = "USERNAME"
password = "PASSWORD"
@theracingapi
theracingapi / results_pull.py
Last active February 22, 2024 16:28
Python script to efficiently extract results from the API for a given date range (Standard Plan)
import requests
from requests.auth import HTTPBasicAuth
from datetime import datetime, timedelta
import time
# Define API credentials
username = "USERNAME"
password = "PASSWORD"
@theracingapi
theracingapi / get_racecards.java
Last active April 14, 2023 10:18
Get today's advanced racecards, including UK & IRE odds, using Java (Standard Plan)
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpClient;
import java.net.URI;
import java.io.IOException;
import java.util.Base64;
class GetRacecards {
private static final String getBasicAuthenticationHeader(String username, String password) {
@theracingapi
theracingapi / racecards_first_run_gelded_report.py
Last active November 8, 2023 19:38
Python script to create a CSV report of horses on tomorrows racecards running for the first time since being gelded (Basic Plan)
import requests
from requests.auth import HTTPBasicAuth
from operator import itemgetter
import csv
from datetime import datetime, timedelta
import asyncio
import aiohttp
# API credentials
username = "<USERNAME>"
@theracingapi
theracingapi / racecard.html
Last active February 17, 2023 14:36
Racecard built with HTML, CSS and jQuery using example racecard data (Basic Plan)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
html, body {
margin: 0;
padding:0;
@theracingapi
theracingapi / uk_racecards_jockey_trainer_report.py
Last active February 16, 2023 17:00
Python script to create a CSV report of jockey/trainer analysis for each runner on today's UK racecards (Standard Plan)
import requests
from requests.auth import HTTPBasicAuth
from operator import itemgetter
import csv
from datetime import datetime
import asyncio
import aiohttp
# API credentials
username = "<USERNAME>"