Lotto Predict |
|
|
LottoPredict APIThe LottoPredict API is accessible from api.bentasker.co.uk/lottopredict. Requests are made using variables in the URI (i.e. GET) and the following features are supported
Data CapturedGenerally speaking, the LottoPredict API wont store any data relating to requests. The only exception to this is when a set of numbers are submitted to the results checker. These numbers may be stored (but aren't currently) in order to help improve the statistical analysis when generating a prediction. The standard month-based checker doesn't store any data however.Any data stored is completely anonymous, only the submitted numbers and when they were submitted will be stored. Your API Key, accessing IP address etc will not be stored Things to be aware ofThe Prediction generated won't usually change between requests. The system has evaluated the options and reached what it believes to be the most probable outcome, unless new information is received that changes this, every visitor will see the same prediction every time they visit your page before the next draw. If you want to serve visitors different numbers you should use the Lucky Dip FunctionalityAPI KeyAll users are free to use the API Key 751fbf6ddfb7c3857d898c21bfdc2b22 but be aware that if it is abused access may be blocked for this key. Alternatively individual keys are available, Contact Me to have one generated (£1 per key - bargain!). Users abusing the system will be blocked, so consider use of the public API key a potential risk!Making a RequestMaking a request couldn't be simpler, simply send the request to http://api.bentasker.co.uk/lottopredict. Include the desired action (see below) as variable action, your API key as key and include any other variables required by your desired actionLucky Dip GenerationTo generate a lucky dip, useNote: For Euromillions use action=ELD instead, for Thunderball use action=TLD Latest ResultsSupports Lotto, Thunderball and Euromillions. Withe latest results for the draw date you specify.Check ResultsThe system will check results for either Lotto or Thunderball. The easiest way is to retrieve all results for a given month, keep in mind that the date format needs to be YYYY-MM.Check User NumbersThe system will check for wins against user supplied numbers (as opposed to the Check Results request which does no comparison). All draws in the last 6 months will be checked (that being the limit for claiming). It will be possible to specify a time period when the API is next updated.Please Note: For statistical purposes, some of the Content of these requests will be recorded. The submitted numbers (including when the numbers were submitted) will be stored. Other details such as the API Key, Client IP etc will not be stored. Get Game IdentifiersTo get an up-to-date list of Game ID's use action GameList or ListAllGames to retrieve a JSON encoded list of games and their ID's. The former will list only the games that your key can access, whilst the latter will list all available games.http://api.bentasker.co.uk/lottopredict/?action=GameList&key=751fbf6ddfb7c3857d898c21bfdc2b22 Example ImplementationYou could use either an AJAX request (though some browsers will limit these to the current domain) or pull the data through using PHP. To use the latter method, you need only include the following in your code//Place an API request to get results for a given month $APIKEY = "751fbf6ddfb7c3857d898c21bfdc2b22"; $results = file("http://api.bentasker.co.uk/lottopredict/?action=retrieve&month=$month&key=$APIKEY&game=1"); // Read back each of the results foreach ($results as $result){ $result = json_decode($result); // Always check for blank lines! if (empty($result->Date)){ continue; } // Output the data echo "Date: {$result->Date}, Draw ID: {$result->DrawID}" . "Balls: {$result->Ball1} {$result->Ball2} " . "{$result->Ball3} {$result->Ball4} " . "{$result->Ball5} {$result->Ball6}" . "{$result->Ball7}"; Alternatively you can use the example class provided here (doesn't include Euromillions support). Additional GamesThe next generation version of this API is now available - LotteryResultsOnline API - It supports many, many more games. It's unlikely that many (if any) new features will be added to LottoPredict, whilst the LotteryResultsOnline API is under ongoing development |
Copyright © 2012 Ben Tasker. All rights reserved. |