Lottery Number Generator API Documentation

Get Recommended Lottery Tickets

Our Lottery Tickets API provides you with the recommended lottery tickets for the next draw. These tickets are generated from the recommended pool of lottery numbers based on the same algorithm as our award-winning & proven lottery software. As such, these recommended tickets can significantly improve your chances of winning!

Our recommended lottery tickets are only available in JSON format and easily accessible through a simple API request. Secure HTTPS connections must be used.

Please note that the API key shown in the examples below is not valid. You must replace the API key value with your API key or please sign up for an API account if you do not have one.

If you like to generate your tickets, you can use our lottery numbers API to retrieve the pool of lottery numbers from which you can then generate your tickets.

Recommended Lottery Tickets API Request

The base URL for our recommended lottery tickets API is:

https://www.magayo.com/api/tickets.php

Request Parameters

Parameter

Description

Valid Values

api_key

Your assigned API key. This parameter is required.

Your assigned API key value.

game

The lottery game for which you would like to retrieve the recommended numbers. This parameter is required.

Please refer to the list of supported games and values to use.

tickets

The number of tickets to generate. This parameter is required.

1 to 100
Example: 10

Examples:

To retrieve 30 recommended tickets for USA Powerball game:

https://www.magayo.com/api/tickets.php?api_key=hXJDjsp8I6RY&game=us_powerball&tickets=30

View sample PHP snippets on how to use our lottery tickets APIs

Recommended Lottery Tickets API Response

Element

Description

Value

error

Error code. Value greater than zero indicates an error.

The list of error codes are listed below.

number

The number of tickts generated. This can be less than the number of tickets passed in the API request parameter because the number of tickets genreated is dependent on the recommended pool of lottery numbers.

Example: 10

tickets

The array of tickets generated.

- ticket

The ticket generated. Any bonus ball in the ticket is preceded by a "+" sign.

Example: 10,23,28,35,39,+03

For Bosnia and Herzegovina SuperLOTO, bonus ball "01" = "BLACK" and "02" = "RED".

For Jamaica Cash Pot, bonus ball "01" = "GOLD" and "02" = "WHITE".

Example of response in JSON format:

{
"error" : 0,
"number" : 5,
"tickets" : [{
"ticket" : "01,08,21,42,61,+26",
"ticket" : "28,31,37,38,63,+19",
"ticket" : "11,18,28,40,69,+02",
"ticket" : "17,40,43,46,66,+11",
"ticket" : "12,14,39,41,64,+11} ]
}

List of Error Codes

Error Code

Description

Action or Resolution

0

No error.

Proceed to process the recommended numbers retrieved.

100

API key not provided.

Please add the api_key parameter in your API request.

101

Invalid API key.

Please check & correct the value of the api_key parameter in your API request.

102

API key not found.

Please check & correct the value of the api_key parameter in your API request.

200

Game not provided.

Please add the game parameter in your API request.

201

Invalid game.

Please check & correct the value of the game parameter in your API request.

202

Game not found.

Please check & correct the value of the game parameter in your API request.

203

Number of tickets not provided.

Please add the tickets parameter in your API request.

204

Invalid number of tickets.

Please check & correct the value of the tickets parameter in your API request.

300

Account suspended.

You have violated our terms of use.

303

API limit reached.

You may like to consider upgrading your API plan.

Jackpot Lottery Winner

Mexico Chispazo winning Jackpot lottery ticket

"I played the recommendation... and I won the first prize!"

magayo Lotto software user

See the winning lottery tickets of magayo Lotto users

Download magayo Lotto software

magayo Lotto is also available as an Android app

Easily generate lottery tickets with our lottery API!

magayo.com is verified safe by Google Safe Browsing

magayo.com is verified safe by Norton Safe Web