Overview · What the APIs provide

HZURA APIs

Developer Documentation

HZURA offers two APIs. The Sports API gives you sports, events and live odds. The Casino API gives you the providers and games you can offer, opens a game for your player, and handles the player's money. Your servers call them at https://api.hzura.com/api/v1 and get JSON back.

What the APIs provide

Every request goes from your server to https://api.hzura.com, and every address starts with /api/v1. Answers are always JSON.

The Sports API only reads data: you ask, it answers with the latest sports data HZURA has. The Casino API lists the providers and games you may offer, gives you a link that opens a game, and moves casino money for your players.

WhatAddress
APIhttps://api.hzura.com
API basehttps://api.hzura.com/api/v1
Playground (try it in your browser)https://www.hzura.com/api-playground
This documentationhttps://www.hzura.com/developers

Sports API

Four read-only addresses: is the API up, which sports you can use, the events of one sport, and one event with its odds. Results are shown on the same event, in each market's status.

  • GET /api/v1/health: is the API up. No key needed.
  • GET /api/v1/sports: the sports your account can use.
  • GET /api/v1/{sport}/events: the events of one sport, without odds.
  • GET /api/v1/{sport}/events/{eventId}: one event and its odds.

Casino API

The Casino API always needs your API key, because the key tells HZURA which account you are. You never send an account id yourself.

  • GET /api/v1/casino/providers: the providers you may offer, including a logo for each.
  • GET /api/v1/casino/games: the games you may offer, most popular first, one page at a time. popularity_rank 0 is the most popular.
  • POST /api/v1/casino/games/{gameId}/launch: a link that opens one game for one player.
  • POST /api/v1/casino/wallet: add money to a player's casino balance, take it back, check it, or undo a transfer. Only for the transfer wallet. With the seamless wallet, HZURA calls your own wallet instead.

Authentication

Send your API key with every request, as Authorization: Bearer YOUR_API_KEY or X-Api-Key: YOUR_API_KEY. The request must also come from a server whose IP address HZURA has added to your allow-list. Some older sports accounts use only the IP address and have no key; the Casino API always needs the key.

Errors

When something goes wrong you get { "error", "message" }. error is a short code that never changes, so your code can rely on it. message is a fixed sentence for people to read.

Getting started

  1. Ask HZURA for an API key. Tell us the public IP address of each server that will call the API, so we can add it to your allow-list.
  2. Call GET /api/v1/health to check the API answers. It needs no key.
  3. Sports: call GET /api/v1/sports, then the events of one sport, then one event. You can try these in the playground first.
  4. Casino: agree with HZURA which wallet type you use. List the providers and games, then launch one for a player. With the transfer wallet, add money to that player with the wallet route using the same player_id. With the seamless wallet, give HZURA your wallet URL and a signing secret first.
curl
curl -sS "https://api.hzura.com/api/v1/health"

curl -sS "https://api.hzura.com/api/v1/sports" \
  -H "Authorization: Bearer YOUR_API_KEY"