Site Offline

This site has been deprecated and all functionality has been taken offline. What you're viewing now is a static HTML mirror preserved for posterity

The API endpoints are currently online, but will be removed from service later in 2017

Request Method

All requests should be placed via POST, and can be submitted in a number of ways. The best supported method, however, is in JSON format.

Every request should include the variables key and sec - your API key and security credential as well as the request action (or verb). The rest of your request should then be submitted within the variable request;

{
"key":"1234",
"sec":"789",
"action":"LD","request":
{
"game":"1"
}
}

The easiest way to build a request in PHP is to create an object and then JSON encode it, so we'd do the following

$req = new StdClass();
$req->key = '1234';
$req->sec = '789';
$req->action = 'LD';
$req->request->game = 1;
$request = json_encode($req);

All examples in this documentation have been displayed in the latter format, as it's easier to read!

 

Response Format

The API response will always be in JSON format and consists of three standard variables - status, error and response. If the request was successfully processed, error will be empty and status will be 'ok'. Otherwise, status will be 'Error' and error will contain text specific to the issue encountered.

response will contain any request specific output generated by the API.

{
"status":"ok",
"error":"",
"response":
{
"Lotto":{
"id":"1",
"Premium":"0"
}
}
}

 Or decoded into an object

$res = json_decode($response);
$res->status = "ok";
$res->error = null;
$res->response->Lotto->id = 1;
$res->response->Lotto->Premium = 0;

 

Supported Requests

At time of writing, the API supports the following request methods, for a full list of all currently supported methods (or verbs) see the Full Verb List

VerbDescription
listVerbsList all supported API verbs, along with details of expected arguments and a description of what the verb requests
GameList List all games accessible by the specified API Key
ListAllGames List all supported games, regardless of whether the current key can access them
keyCheck Check if the provided key is valid
LatestResults Get latest results for all accessible draws
LatestResult Get the latest results for the specified game
retrieveResults Retrieve all results for the specified game in the specified month

 

GameList

The GameList verb retrieves a listing of all Lotteries available to your API key. This will obviously differ depending on your subscription level.

$req->key = '1234';
$req->sec = '789';
$req->action = 'GameList';

Would give the response

$req->status = 'ok';
$req->error = null;
$req->response = object;
$req->response->Lotto->id = 1;
$req->response->Lotto->Premium = 0;
$req->response->Lotto->Since = 2011-01-01

ID is the game ID you need to use when submitting requests related to this game, Premium will be 0,1 or 2 - Free, Basic, Full/Unlimited. Since contains the date that support for the game was added, though some results may exist for dates before this

 

ListAllGames

ListAllGames works on exactly the same basis as GameList, but doesn't filter out the games that you don't have permission to access. It's particularly useful if you want to quickly check whether a game you need is available.

 

keyCheck

keyCheck allows you to check whether your key is valid without placing any other request. If the key is valid, you will receive

$res->status = 'ok';
$res->error = null;
$res->response->Status = 'Approved';

Additional information, such as when your subscription expires will be added in the near future.

 

Experimental Features

Experimental features are only available to Unlimited Subscribers, and once stable may only be available to Full and Unlimited Subscribers.

Basic testing is always undertaken before features are marked as Experimental, to ensure that the data returned is valid and accurate. There's no specific timeline for features to leave the 'experimental' state, and some methods may remain 'Experimental' for quite some time.

As the features considered Experimental can change regularly, see the Full Verb List for the current experimental features

 

Full Verb List

The nature of development means that new verbs may be added to the API before the documentation can be updated. For reference, a current up-to-date list of all supported verbs has been generated below using listVerbs

Verb Experimental Description
GameList No List all games to which your API key has access
ListAllGames No List all games, regardless of whether you can access them
keyCheck No Check that the current key is valid, and return useful information
LatestResults No Get the latest results for all accessible games
UserCheck No Check the supplied numbers against stored results to check for a win in the last 180 days. Only Game ID's 1,2 and 3 are currently supported
LatestResult No Get the latest results for the specified game
retrieveResults No Retrieve all results for a given month
listVerbs No List all supported API verbs, including a basic description of supported arguments. If experimental verbs are available to you, these will be included