Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GreyhoundAPI SDKs

Official client libraries for the GreyhoundAPI — a REST + WebSocket API for greyhound racing in Great Britain and Australia: racecards, results, sectionals, starting prices and Betfair markets, plus dogs, trainers, owners, tracks and breeding.

Language Package Directory
JavaScript / TypeScript @greyhoundapi/sdk (npm) javascript/
Python greyhoundapi (PyPI) python/
PHP greyhoundapi/sdk (Composer) php/
Go github.com/greyhoundapi/greyhoundapi-go go/

All four cover the same 35 REST endpoints, share the same { meta, data } envelope and cursor pagination, and have zero third-party dependencies.

Getting an API key

The API is authenticated with a key sent in the X-API-Key header. To get one:

  1. Go to greyhoundapi.com and click Get a free key (top-right).
  2. Sign in to create your account.
  3. Open Account → API keys and click Create key.
  4. Copy the key — it's shown only once. Sandbox keys start gapi_test_; live keys start gapi_live_.

Free sandbox key — no card required: the race & track endpoints over a rolling 7-day window (ending a few hours ago), 500 requests/day, one active key. Ideal for building and evaluating.

Live plan ($99/month) — every endpoint, the full historical archive, live-day data and the WebSocket results stream, 250,000 requests/month, and up to 5 active keys. See pricing for the full comparison.

Keep your key secret. Load it from an environment variable (e.g. GREYHOUNDAPI_KEY) rather than committing it. In browser code the key is visible to users — use a sandbox key for public demos, or proxy requests through your own server.

Quick starts

JavaScript / TypeScript

npm install @greyhoundapi/sdk
import { GreyhoundAPI } from "@greyhoundapi/sdk";

const gapi = new GreyhoundAPI({ apiKey: process.env.GREYHOUNDAPI_KEY });
const race = await gapi.races.get(1229082);
console.log(race.data.runners[0].dog_name);

Python

pip install greyhoundapi
from greyhoundapi import GreyhoundAPI

gapi = GreyhoundAPI(api_key="gapi_live_...")
race = gapi.race(1229082)
print(race["data"]["runners"][0]["dog_name"])

PHP

composer require greyhoundapi/sdk
$gapi = new \GreyhoundApi\Client(getenv('GREYHOUNDAPI_KEY'));
$race = $gapi->race(1229082);
echo $race['data']['runners'][0]['dog_name'];

Go

go get github.com/greyhoundapi/greyhoundapi-go
gapi := greyhoundapi.New(os.Getenv("GREYHOUNDAPI_KEY"))
race, err := gapi.Race(1229082)

Full guides → JavaScript · Python · PHP · Go

About the API

  • Base URLhttps://api.greyhoundapi.com/v1
  • AuthX-API-Key header
  • Envelope{ "meta": { "request_id", "data_as_of" }, "data": … }
  • Pagination — opaque cursor in meta.next_cursor
  • Tiers — a free sandbox key (race & track endpoints, rolling 7-day window, 500/day) or the live plan (every endpoint, full archive, results stream, 250k/month)

Read the docs at greyhoundapi.com/documentation.

Contributing

Issues and pull requests are welcome. Please keep changes focused and preserve the zero-dependency, build-step-free design of each client.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages