API Documentation

Welcome to the Resultsza API documentation. Here you will find all the information needed to use our API effectively.

Available Endpoints

1. Get Latest Results

This endpoint retrieves the latest results for all lottery games in a single API call. The response includes division details and winnings per division for each game. If the optional date parameter is used, the results will show all games that had a draw on the specified date.

GET /api/get_latest_results?api_key=YOUR_API_KEY

Optional Parameters:

Example Request:

curl -i "https://resultsZA.co.za/api/get_latest_results?api_key=YOUR_API_KEY&date=2024-12-10"

Response Format:

The response will contain the following fields:

Example JSON Response:


{
    "status": "success",
    "results": {
        "daily_lotto_results": {
            "date": "2024-12-10T20:00:00Z",
            "draw_id": 2098,
            "draw_machine": "RNG2",
            "game_type": "Daily Lotto",
            "total_pool_size": 1633997.5,
            "total_sales": 3262896.0,
            "winning_numbers": [5, 11, 20, 28, 35],
            "bonus_ball": null,
            "next_draw_date": "2024-12-11T20:00:00Z",
            "divisions": [
                {"division": "DIV 1", "winners": 6, "winning_amount": 96799.2},
                {"division": "DIV 2", "winners": 466, "winning_amount": 287.1},
                {"division": "DIV 3", "winners": 13571, "winning_amount": 19.7},
                {"division": "DIV 4", "winners": 130413, "winning_amount": 5.0}
            ]
        },
        "lotto_results": {
            "date": "2024-12-07T20:00:00Z",
            "draw_id": 2497,
            "draw_machine": "RNG2",
            "game_type": "Lotto",
            "total_pool_size": 16460059.56,
            "total_sales": 16554055.0,
            "winning_numbers": [10, 20, 30, 47, 49, 50],
            "bonus_ball": 21,
            "next_draw_date": "2024-12-11T20:00:00Z",
            "divisions": [
                {"division": "DIV 1", "winners": 0, "winning_amount": 0.0},
                {"division": "DIV 2", "winners": 1, "winning_amount": 104016.2},
                {"division": "DIV 3", "winners": 104, "winning_amount": 1739.4},
                {"division": "DIV 4", "winners": 113, "winning_amount": 2001.1},
                {"division": "DIV 5", "winners": 3442, "winning_amount": 110.3},
                {"division": "DIV 6", "winners": 3083, "winning_amount": 107.1},
                {"division": "DIV 7", "winners": 45524, "winning_amount": 50.0},
                {"division": "DIV 8", "winners": 32534, "winning_amount": 20.0}
            ]
        }
    }
}
        

Note: The structure will include results for all game types drawn on the specified date if the date parameter is used.

2. Get Results by Game

Retrieve draw results for a specific game type.

GET /api/get_results_by_game?api_key=YOUR_API_KEY&game=GAME_NAME

Optional Parameters:

Example Requests:

curl -i "https://resultsZA.co.za/api/get_results_by_game?api_key=YOUR_API_KEY&game=Lotto"
curl -i "https://resultsZA.co.za/api/get_results_by_game?api_key=YOUR_API_KEY&game=Lotto&date=2024-11-16"

Response Format:

{
    "status": "success",
    "results": [
        {
            "draw_id": 123,
            "draw_date": "2023-03-20T20:00:00Z",
            "winning_numbers": [1, 5, 7, 9, 10],
            "bonus_ball": 22
        }
    ]
}

Note: The "get_results_by_game" endpoint only provides the winning numbers and does not include the division and winnings info.

3. Generate Random Numbers

Generate random numbers for any game type. (The numbers generated will be in accordance to each game type's rules)

GET /api/generate_random_numbers?api_key=YOUR_API_KEY&game=GAME_NAME&lines=NUMBER_OF_LINES

Parameters:

Example Requests:

curl -i "https://resultsZA.co.za/api/generate_random_numbers?api_key=YOUR_API_KEY&game=Lotto"
curl -i "https://resultsZA.co.za/api/generate_random_numbers?api_key=YOUR_API_KEY&game=Lotto&lines=5"

Response Format:

{
    "status": "success",
    "game": "Lotto",
    "lines": 5,
    "random_numbers": [
        [1, 2, 3, 4, 5, 6],
        [7, 8, 9, 10, 11, 12],
        ...
    ]
}

4. Get Hot and Cold Numbers

Retrieve hot (most frequently drawn) and cold (least frequently drawn) numbers for a game.

GET /api/get_hot_cold_numbers_stats?api_key=YOUR_API_KEY&product=GAME_NAME

Example Request:

curl -i "https://resultsZA.co.za/api/get_hot_cold_numbers_stats?api_key=YOUR_API_KEY&product=Lotto"

Response Format:

{
    "status": "success",
    "product": "Lotto",
    "hot": [5, 12, 19, ...],
    "cold": [45, 23, 7, ...]
}

5. Get Number Frequencies

Fetch the frequency of numbers drawn for a specific game type.

GET /api/get_number_frequencies?api_key=YOUR_API_KEY&product=GAME_NAME

Example Request:

curl -i "https://resultsZA.co.za/api/get_number_frequencies?api_key=YOUR_API_KEY&product=Powerball Plus"

Response Format:

{
    "status": "success",
    "product": "Lotto",
    "statistics": [
        {"number": 5, "frequency": 20, "last_drawn": "2023-03-15"},
        ...
    ]
}

6. Get Number Pairs

Fetch the most common number pairs that are drawn together for a game type. (Top 10 number pairs will be returned)

GET /api/get_number_pairs?api_key=YOUR_API_KEY&product=GAME_NAME

Example Request:

curl -i "https://resultsZA.co.za/api/get_number_pairs?api_key=YOUR_API_KEY&product=Lotto"

Response Format:

{
    "status": "success",
    "product": "Lotto",
    "pairs": [
        {"number1": 5, "number2": 7, "frequency": 15, "last_drawn": "2023-03-10"},
        ...
    ]
}

7. Winning Number Checker

This endpoint allows you to submit played numbers and check them against the winning numbers of a specific game type and draw date. The response includes match details, division, and winnings.

Note: This endpoint allows you to check up to 10 lines of played numbers per game type.

POST /api/check_played_numbers?api_key=YOUR_API_KEY&game=GAME_NAME&date=YYYY-MM-DD

Request Body Format:

The request body must be in JSON format and include the following for multiple lines of numbers played:

{
    "played_numbers": [
        [10, 20, 30, 40, 50, 5],
        [1, 6, 29, 11, 15, 17]
    ]
}
Or for a single line played
{
    "played_numbers": [1, 6, 29, 11, 15, 17]
}

Notes:

Example API Call:

curl -X POST "https://resultsZA.co.za/api/check_played_numbers?api_key=YOUR_API_KEY&game=Lotto Plus 1&date=2024-12-07" \
-H "Content-Type: application/json" \
-d '{
    "played_numbers": [
        [10, 20, 30, 40, 50, 5],
        [1, 6, 29, 11, 15, 17]
    ]
}'

Response Format:

{
    "status": "success",
    "game": "Lotto",
    "draw_date": "2024-12-07",
    "results": {
        "line1_results": {
            "played_numbers": [10, 20, 21, 30, 40, 50],
            "winning_numbers": [10, 20, 30, 47, 49, 50],
            "bonus_ball": 21,
            "matches": {
                "main_matches": 4,
                "bonus_match": true
            },
            "division": "DIV 4",
            "winning_amount": "2001.10"
        },
        "line2_results": {
            "played_numbers": [1, 6, 29, 11, 15, 17],
            "winning_numbers": [10, 20, 30, 47, 49, 50],
            "bonus_ball": 21,
            "matches": {
                "main_matches": 0,
                "bonus_match": false
            },
            "division": null,
            "winning_amount": null
        }
    }
}

Response Fields:

8. Bulk Number Checker

This endpoint allows you to check a larger set of played numbers against the winning numbers of a specific game type and draw date. It supports up to 500 lines of played numbers in a single request and deducts tokens based on the number of lines checked.

POST /api/bulk_check_numbers?api_key=YOUR_API_KEY&game=GAME_NAME&date=YYYY-MM-DD

Token Consumption:

Request Body Format:

The request body must be in JSON format:

{
    "played_numbers": [
        [10, 20, 30, 40, 50, 5],
        [1, 6, 29, 11, 15, 17],
        ...
    ]
}

Notes:

Example API Call:

curl -X POST "https://resultsZA.co.za/api/bulk_check_numbers?api_key=YOUR_API_KEY&game=Lotto Plus 1&date=2024-12-11" \
-H "Content-Type: application/json" \
-d '{
    "played_numbers": [
        [10, 20, 30, 40, 50, 5],
        [1, 6, 29, 11, 15, 17],
        ...
    ]
}'

Response Format:

{
    "status": "success",
    "game": "Lotto Plus 1",
    "draw_date": "2024-12-11",
    "lines_checked": 50,
    "results": {
        "line1_results": {
            "played_numbers": [10, 20, 30, 40, 50, 5],
            "winning_numbers": [10, 20, 30, 47, 49, 50],
            "bonus_ball": 21,
            "matches": {
                "main_matches": 4,
                "bonus_match": true
            },
            "division": "DIV 4",
            "winning_amount": "2001.10"
        },
        ...
    }
}

Note: Ensure your API key has sufficient tokens before submitting a bulk check request.

9. Text-to-Lucky Numbers

Have you ever wondered what lottery numbers your name, a favorite quote, or any text could generate? This endpoint takes your input text and converts it into a hash, using a clever algorithm to generate a unique line of lucky numbers for your chosen game type, while strictly adhering to the game rules (number counts and ranges).

POST /api/text_to_lucky_numbers?api_key=YOUR_API_KEY&game=GAME_NAME

How It Works:

Request Parameters:

Request Body Format:

The request body must be in JSON format:

{
    "text": "Your custom input text",
    "game_type": "Lotto"
}

Example API Call:

curl -X POST "https://resultsZA.co.za/api/text_to_lucky_numbers?api_key=YOUR_API_KEY&game=Powerball" \
-H "Content-Type: application/json" \
-d '{
    "text": "John Doe"
}'

Response Format:

{
    "status": "success",
    "text": "John Doe",
    "game_type": "Powerball",
    "lucky_numbers": [7, 22, 33, 41, 50],
    "powerball": 18
}

Token Consumption:

Use Cases:

10. Check API Token Balance

Check the remaining API token balance for your account. This call does not consume any API tokens.

GET /check_api_key_balance?api_key=YOUR_API_KEY

Example Request:

curl -i "https://resultsZA.co.za/check_api_key_balance?api_key=YOUR_API_KEY"

Response Format:

{
    "status": "success",
    "tokens_remaining": 25,
    "is_paying_customer": true
}

Note: This endpoint does not deduct any tokens from your remaining balance.

Please replace YOUR_API_KEY with your actual API key and GAME_NAME with the name of the lottery game (e.g., "Lotto", "Powerball"). Ensure the date format is YYYY-MM-DD for date-specific queries.

Supported Game Types