LotteryTracker is a cloud based service with a fully functional REST API allowing other apps to utilize for various purposes. This page is intended for developer use only. Because of high demand, to use our API's we require:
The following parameters are common across all REST requests.
Parameter Name | Location | Values | Description |
---|---|---|---|
LTToken | HTTP Header | n/a | This token is needed for all requests requiring authentication. Acquired through the Authentication service. |
ApiKey | HTTP Header | n/a | This token is needed for all requests requiring authentication. This is a secret key assigned to your application. Without this key, you may notice a forbidden response. |
Accept | HTTP Header | appication/json or appication/xml | Specifies the format of the resulting data. |
format | Query String | json or xml | Specifies the format of the result data. Overrides the Accept header. |
Content-Type | HTTP Header | appication/json | Specifies the media type of the resource. Used on POST/PUT requests. |
The authentication API allows clients to logon. Given a valid Username and Password in the basic authentication header, a LTToken is returned to the caller.
Once it is expired, the caller must issue another logon request.
A request using an expired token generates a Unauthorized response with the header LTTokenExpired set in the response to true.
After LTToken is acquired, every request requiring authentication must supply the basic authentication header. The Username should be specified as the literal LTToken
and the password is the value of your token.
The basic authentication scheme is not recommended. Use the POST method listed below to authenticate. After, pass the LTToken header on all subsequent requests.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Logon user | GET | /api/auth | Basic Auth Scheme |
Logs on the requested user, using Basic Auth and returns a LTToken on success. https://www.lotterytracker.ca/api/auth |
Logon user | POST | /api/auth | Header: Content-Type: application/json; charset=utf-8 Body: {"UserName":"m@m.com", "Password" : "pword"} |
Logs on the requested user and returns a LTToken on success. https://www.lotterytracker.ca/api/auth |
Ping user | GET | /api/ping | [none] |
Returns 201 OK if user credentials are valid or Unauthorized. https://www.lotterytracker.ca/api/ping |
These APIs will display all games available in the system. For example a game is 6/49 or Encore. Draws are per game and by date. A draw is the date and time a game is played. Authentication is not required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get all games | GET | /api/game | provinceCode=null onlyCreatableGames=false |
Returns a list of all the games in the system. The provinceCode parameter is optional. If supplied it will filter the list of games. If onlyCreatableGames is set to true, then only primary games that should be created are listed. https://www.lotterytracker.ca/api/game |
Get specific game | GET | /api/game/[id] | [none] |
Returns details about a game in the system. https://www.lotterytracker.ca/api/game/1 |
Get specific draw | GET | /api/draw/[id] | [none] |
Returns details of a draw in the system. https://www.lotterytracker.ca/api/draw/4 |
Get lottery draws by date | GET | /api/draw | day month year |
Returns all the lottery draws the system recognized on a given date. https://www.lotterytracker.ca/api/draw?day=1&month=2&year=2014 |
Get lottery draws by month and game | GET | /api/draw | month year gamesId |
Returns all the lottery draws the system recognized on a given month. https://www.lotterytracker.ca/api/draw?month=2&year=2014&gamesId=1 |
These APIs will display all winning numbers for various games in the system. Winning number's are the result of a game played on a particular date. Authentication is not required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get winning numbers by date and game | GET | /api/winningNumbers | gamesId day month year |
Returns the winning numbers for a game on a given date. Returns 204 if no results are found. https://www.lotterytracker.ca/api/winningNumbers?gamesId=1&day=1&month=2&year=2014 |
Get all winning numbers by date | GET | /api/winningNumbers | day month year |
Returns winning numbers for all games on a given date. Returns 204 if no results are found. https://www.lotterytracker.ca/api/winningNumbers?day=1&month=2&year=2014 |
Get all winning numbers by month and game | GET | /api/winningNumbers | gamesId month year |
Returns all winning numbers for the specified game and month. Returns 204 if no results are found. https://www.lotterytracker.ca/api/winningNumbers?gamesId=1&month=2&year=2019 |
Get all winning numbers by drawId | GET | /api/winningNumbers | drawId |
Returns winning numbers for all games on a given date (a drawId defines a game, date and draw). Returns 204 if no results are found. https://www.lotterytracker.ca/api/winningNumbers?drawId=1 |
Get all most recent winning numbers | GET | /api/winningNumbers |
recent=true provinceCode filterByGameIds |
Returns recent winning numbers for all games. Optionally filtered by province code.
recent must be equal to true provinceCode can be one of: AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT filterByGameIds can be any valid comma separated list of gameId's Returns 204 if no results are found. https://www.lotterytracker.ca/api/winningNumbers/recent?provinceCode=ON |
Get the next winning numbers result if it exists | GET | /api/winningNumbers/[winningNumbersId] |
prevCurrentNext |
Returns next winning numbers for a specific game. winningNumbersId is the unique ID returned by any winning number result call. prevCurrentNext is negative, zero, or positive. Set -1 for a previous result, or 1 for a future result. https://www.lotterytracker.ca/api/winningNumbers/1?prevCurrentNext=-1 |
Get next jackpots for lotteries | GET | /api/jackpot |
provinceCode=ON |
Returns future jackpot information by draw. The provinceCode parameter filters the list of draws/games. https://www.lotterytracker.ca/api/jackpot?provinceCode=ON |
The User API allows access to user profile data. Authentication and HTTPS are required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get user profile user | GET | /api/user | [none] |
Returns the logged on users profile details. https://www.lotterytracker.ca/api/user |
Update user profile | PUT | /api/user |
Header: Content-Type: application/json; charset=utf-8 Body: { "EmailAddress":"abc@def.com", "FirstName":"FN", "LastName":"LN", "MonthOfBirth":11, "DayOfBirth":17, "YearOfBirth":1976, "ProvinceCode":"ON", "SendEmailUpdates":true } |
Returns OK on success 400: Incorrect data or Generic Error https://www.lotterytracker.ca/api/user |
Register user | Post | /api/register | Header: Content-Type: application/json; charset=utf-8 Body: {"EmailAddress":"m@m.com", "Password" : "pword", "FirstName" : "Dave", "LastName" : "Smith" } |
Returns the created users profile. 201: Created 400: Incorrect data or Generic Error https://www.lotterytracker.ca/api/register |
Initiate password reset | Post | /api/forgotPassword | Header: Content-Type: application/json; charset=utf-8 Body: {"EmailAddress":"m@m.com"} |
Initiates a password reset request. Send email to user. 202: Accepted 400: Incorrect data or Generic Error https://www.lotterytracker.ca/api/forgotPassword |
Update password | Put | /api/changePassword | Header: Content-Type: application/json; charset=utf-8 Body: {"Password":"bla","NewPassword":"new1","ValidateNewPassword":"new1"} |
Changes a logged in users password. 202: Accepted 400: Incorrect data or Generic Error https://www.lotterytracker.ca/api/changePassword |
Get alerts | GET | /api/alert | [none] |
Returns all lottery jackpot notifications the user enabled. A jackpot over this value will result in a user notification/email. https://www.lotterytracker.ca/api/alert |
Update an alert setting | PUT | /api/alert |
Header: Content-Type: application/json; charset=utf-8 Body: {"Type":"LottoPrizeAlert1","AlertValue":50000000} |
Possible types are: LottoPrizeAlert2 (LottoMax), LottoPrizeAlert1 (Lotto 6/49) Returns OK on success 400: Incorrect data or Generic Error https://www.lotterytracker.ca/api/alert |
The Group API allows access to groups and group information for the authenticated user. Groups and be created and updated. Authentication is required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get all user groups | GET | /api/group | [none] |
Returns a list of groups the user belongs to. https://www.lotterytracker.ca/api/group |
Get a group by id | GET | /api/group/[id] | [none] |
Returns the details for a specific group. The logged on user must belong to the group. https://www.lotterytracker.ca/api/group/1 |
Add a group | POST | /api/group |
Header: Content-Type: application/json; charset=utf-8 Body: {"Name":"group1"} |
Returns Created on success. https://www.lotterytracker.ca/api/group/1 |
Update a group name | PUT | /api/group |
Header: Content-Type: application/json; charset=utf-8 Body: {"Name":"New Name","Id":1} |
Returns OK on success. https://www.lotterytracker.ca/api/group |
Delete a group by id | DELETE | /api/group/[id] | [none] |
Deletes a specific group. The user must be the group captain. https://www.lotterytracker.ca/api/group/1 |
The Member API allows operations on users in a group such as adding, removing and sequencing users in a group. Authentication is required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get all group members | GET | /api/member | groupId = 1 |
Returns a list of all members in the specified groupId. https://www.lotterytracker.ca/api/member?groupId=1 |
Add member to a group | POST | /api/member |
Header: Content-Type: application/json; charset=utf-8 Body: {"GroupId":1,"EmailAddress":"user@mail.com", "SendNotifications":true} |
Adds a member to the specified group by email address and sets the user to the last member in the group. Returns Created on success. https://www.lotterytracker.ca/api/member |
Update member sequence in a group | PUT | /api/member |
Header: Content-Type: application/json; charset=utf-8 Body: {"GroupId":1,"Action":"setSequence", "UpdateSequence" : [ {"EmailAddress" : "user@mail.com", "Sequence" : 1}] } |
Updates the list of members and sets their sequence as specified.
Only a captain can complete this action. Returns NoContent on success. https://www.lotterytracker.ca/api/member |
Update and deactivate member in a group | PUT | /api/member |
Header: Content-Type: application/json; charset=utf-8 Body: {"EmailAddress" : "user@mail.com", "GroupId":1,"Action":"deactivateUser"} Action can be one of: deactivateUser, activateUser, removeUser |
Only a captain can complete this action. Returns NoContent on success. https://www.lotterytracker.ca/api/member |
Update and make member a captain in a group | PUT | /api/member |
Header: Content-Type: application/json; charset=utf-8 Body: {"EmailAddress" : "user@mail.com", "GroupId":1,"Action":"setCaptain"} Action can be one of: setCaptain, setNotCaptain |
Only a captain can complete this action. Returns NoContent on success. https://www.lotterytracker.ca/api/member |
Update member notification preference in a group | PUT | /api/member |
Header: Content-Type: application/json; charset=utf-8 Body: {"GroupId":1, "EmailAddress":"user@mail.com", "Action":"setNotification", "SendNotifications" : false} |
Only a captain can complete this action. Disables or enables email notifications for this user. Returns NoContent on success. https://www.lotterytracker.ca/api/member |
A group wall contains a series of ticket results and commnets posted by group members, by date. This set of APIs will allow you to view a batch of posts to the wall and possibly page through results. The API also enabled posting a comment the dashboard. Authentication is required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get wall messages | GET | /api/wall |
groupId = 1 pageNumber = 0 typeOfMessage = 0 (0 returns only text messages, 1 returns non-text messages such as tickets and 2 returns all message types) |
Returns messages on the group wall. https://www.lotterytracker.ca/api/wall?groupId=1 |
Posts a message to the wall | POST | /api/wall |
Header: Content-Type: application/json; charset=utf-8 Body: {"GroupId":1,"modifiedMessage":"This is my post msg", "emailNotifyGroup":true} |
Returns Created on success. https://www.lotterytracker.ca/api/member |
This set of APIs will allow you to view tickets entered into the system (physical ticket). Tickets do not contain result calculations unless the parameter showTicketResultDraw is set to true. A ticket may participate in multiple draws, and have multiple results. To check if a ticket result is calculated, check the ticket result properties ResultsRegularComplete and ResultsEncoreComplete. Authentication is required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get a ticket by id | GET | /api/ticket/[id] | showTicketResultDraw = false |
Returns details of a ticket in the system. If specified, the ticket results will be shown if calculated. https://www.lotterytracker.ca/api/ticket/1 |
Get all tickets decending by draw end date | GET | /api/ticket |
groupId = 1 pageNumber = 0 pageSize = 10 (10 maximum) showTicketResultDraw = false |
Returns details of all tickets for the group. https://www.lotterytracker.ca/api/ticket?groupId=1&pageNumber=0&pageSize=10 |
Get all tickets by draw date | GET | /api/ticket |
groupId = 1 pageNumber = 0 pageSize = 10 (10 maximum) drawDay = 1 drawMonth = 1 drawYear = 2016 showTicketResultDraw = false |
Returns details of all group tickets played for a specific date. https://www.lotterytracker.ca/api/ticket?groupId=1&drawDay=1&drawMonth=1&drawYear=2016 |
Get all tickets between a set of draw dates | GET | /api/ticket |
groupId = 1 pageNumber = 0 pageSize = 10 (10 maximum) startDrawDay = 1 startDrawMonth = 1 startDrawYear = 2016 endDrawDay = 12 endDrawMonth = 12 endDrawYear = 2016 showTicketResultDraw = false |
Returns details of all group tickets played between a specific date range. https://www.lotterytracker.ca/api/ticket?groupId=1&startDrawDay=1&startDrawMonth=1&startDrawYear=2016&endDrawDay=1&endDrawMonth=1&endDrawYear=2016 |
Get all tickets by status | GET | /api/ticketbystatus |
groupId = 1 pageNumber = 0 pageSize = 10 (10 maximum) showTicketResultDraw = false status = 1 |
Returns tickets for a group based on status (0: all, 1: active, 2: historical, 3: recent). https://www.lotterytracker.ca/api/ticketbystatus?groupId=1&status=1 |
Delete a ticket by id | DELETE | /api/ticket |
Header: Content-Type: application/json; charset=utf-8
Body: {"GroupId":1,"TicketId":2} |
Deletes a ticket in the system. A user can only delete a ticket if they are the group captain that owns the ticket and
the ticket does not have any calculated results. https://www.lotterytracker.ca/api/ticket |
Create a single draw 6/49 ticket | POST | /api/ticket |
Header: Content-Type: application/json; charset=utf-8
Body: {
"GroupId":1,
"GameId":1,
"StartDate":"2016-11-02",
"EndDateVerify":"2016-11-02",
"NumberOfDraws":1,
"EncoreGameId":5,
"Notes":"Group tikcet 1",
"ProvinceStateCode":"ON",
"LottoPicks":["01 02 03 04 05 06","10 11 12 13 14 15"],
"EncorePick":["2424234","3222333","3434343"],
"GuarLottoPick":"42342423"
} |
Creates a ticket in the system. The ticket belongs to a specific group. The dates must be valid for the specified gameId. LottoPicks are an array of 2 digit numbers, possibly separated by spaces.
the ticket does not have any calculated results. https://www.lotterytracker.ca/api/ticket |
Create a multi draw LottoMax ticket | POST | /api/ticket |
Header: Content-Type: application/json; charset=utf-8
Body: {
"GroupId":1,
"GameId":2,
"StartDate":"2016-11-04",
"EndDateVerify":"2016-11-18",
"NumberOfDraws":3,
"EncoreGameId":5,
"Notes":"Group tikcet 1",
"ProvinceStateCode":"ON",
"LottoPicks":["01 02 03 04 05 06 07"],
"ExLottoPicks":["21 22 23 24 25 26 27","10 11 12 13 14 15 16"],
"EncorePick":["2424234","3222333","3434343"]
} |
Creates a ticket in the system. The ticket belongs to a specific group. The dates must be valid for the specified gameId. LottoPicks are an array of 2 digit numbers, possibly separated by spaces.
the ticket does not have any calculated results. https://www.lotterytracker.ca/api/ticket |
Create a multi draw BC LottoMax ticket | POST | /api/ticket |
Header: Content-Type: application/json; charset=utf-8
Body: {
"GroupId":1,
"GameId":2,
"StartDate":"2016-11-04",
"EndDateVerify":"2016-11-18",
"NumberOfDraws":3,
"EncoreGameId":6,
"Notes":"Group tikcet 1",
"ProvinceStateCode":"BC",
"LottoPicks":["01 02 03 04 05 06 07"],
"ExLottoPicks":["21 22 23 24 25 26 27","10 11 12 13 14 15 16"],
"EncorePick":["45-45-45-44","34-36-38-29","34-23-21-33"]
} |
Creates a ticket in the system. The ticket belongs to a specific group. The dates must be valid for the specified gameId. LottoPicks are an array of 2 digit numbers, possibly separated by spaces.
the ticket does not have any calculated results. https://www.lotterytracker.ca/api/ticket |
The Ticket Result API will allow you to view ticket results for a group. Only tickets with calculated results are returned. Authentication is required.
Action | HTTP method | Relative URI | Parameters | Description |
---|---|---|---|---|
Get all tickets between a set of draw dates | GET | /api/ticketResult |
groupId = 1 pageNumber = 0 pageSize = 10 (10 maximum) |
Returns details of all group tickets played between a specific date range. https://www.lotterytracker.ca/api/ticketResult?groupId=1&pageNumber=0 |
The following are simply examples of how to use the API's listed above. Examples are in CURL format.
// Authenticate using a data payload curl --location --request POST 'https://www.lotterytracker.ca/api/auth' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{"UserName":"login@email.com","Password":"password"}'
// Authenticate using basic auth curl --location --request GET 'https://www.lotterytracker.ca/api/auth' \ --header 'Accept: application/json' \ --header 'Authorization: Basic c29tZUBlbWFpbC5jb206cGFzc3dvcmQ='
// Authentication response { "Username": "login@email.com", "LTToken": "6E0AAD1568BEB17543BA3D3BCC298A63C91" }
// Get all games curl --location --request GET 'https://www.lotterytracker.ca/api/game' \ --header 'ApiKey: input-your-key-here' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json'
// Get a CSV containing all winning numbers for GameId 10 curl --location --request GET 'https://www.lotterytracker.ca/api/bulkWinningNumbers/10' \ --header 'ApiKey: input-your-key-here' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json'