{
  "openapi": "3.1.0",
  "info": {
    "title": "Lottery API",
    "version": "1.0.0",
    "description": "Lottery providers and historical draw results with winning numbers, jackpots and prize tiers, searchable.\n\nStructured lottery data: browse lottery providers (game format, draw schedule, number ranges, currency, country) and their historical draw results — winning main and bonus numbers, jackpot amounts, rollovers, total winners, and per-tier prize breakdowns. Filter and search draws by provider, country, date range, or a specific drawn number.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/lottery.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/lottery"
  },
  "servers": [
    {
      "url": "https://api-lottery.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Entertainment",
      "description": "Lottery API belongs to the Entertainment category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/draws/{id}": {
      "get": {
        "operationId": "getDraw",
        "summary": "Get Draw",
        "description": "Get Draw endpoint of the Lottery API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/lottery/get-draw"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "131124"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 34,
                    "providerId": 1,
                    "drawNumber": "2672",
                    "drawnAt": "2026-06-20T23:00:00Z",
                    "drawnDate": "2026-06-20",
                    "mainNumbers": [
                      31,
                      34,
                      37,
                      38,
                      43
                    ],
                    "bonusNumbers": [
                      14
                    ],
                    "multiplier": null,
                    "jackpotAmount": null,
                    "jackpotCurrency": "COP",
                    "totalWinners": null,
                    "totalPayout": null,
                    "rollover": false,
                    "providerSlug": "co-baloto",
                    "providerName": "Baloto",
                    "prizeTiers": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/providers/{slug}": {
      "get": {
        "operationId": "getProvider",
        "summary": "Get Provider",
        "description": "Get Provider endpoint of the Lottery API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/lottery/get-provider"
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "co-baloto"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1,
                    "slug": "co-baloto",
                    "name": "Baloto",
                    "countryCode": "CO",
                    "region": null,
                    "currency": "COP",
                    "timezone": "America/Bogota",
                    "website": "https://www.baloto.com",
                    "mainNumbersCount": 5,
                    "mainNumbersMax": 43,
                    "bonusNumbersCount": 1,
                    "bonusNumbersMax": 16,
                    "bonusLabel": "Súper Balota",
                    "description": "Lotería nacional. Acierta 5 números del 1 al 43 más la Súper Balota del 1 al 16. Sorteos miércoles y sábado.",
                    "isActive": true,
                    "schedule": {
                      "days": [
                        "Wed",
                        "Sat"
                      ],
                      "time": "23:00"
                    },
                    "drawsCount": 11,
                    "lastDrawnAt": "2026-06-20T23:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/draws/latest": {
      "get": {
        "operationId": "latestDraws",
        "summary": "Latest Draws",
        "description": "Latest Draws endpoint of the Lottery API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/lottery/latest-draws"
        },
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "co-baloto"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1024,
                      "providerSlug": "co-baloto",
                      "providerName": "Baloto",
                      "drawNumber": 2415,
                      "drawnAt": "2026-06-17T20:00:00Z",
                      "drawnDate": "2026-06-17",
                      "mainNumbers": [
                        4,
                        11,
                        23,
                        35,
                        42
                      ],
                      "bonusNumbers": [
                        9
                      ],
                      "jackpotAmount": 5400000000,
                      "jackpotCurrency": "COP",
                      "rollover": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/providers/{slug}/draws": {
      "get": {
        "operationId": "listDrawsByProvider",
        "summary": "List Draws by Provider",
        "description": "List Draws by Provider endpoint of the Lottery API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/lottery/list-draws-by-provider"
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "co-baloto"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2026-01-01"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "20"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-30"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1024,
                      "providerId": 1,
                      "providerSlug": "co-baloto",
                      "providerName": "Baloto",
                      "drawNumber": 2415,
                      "drawnAt": "2026-06-17T20:00:00Z",
                      "drawnDate": "2026-06-17",
                      "mainNumbers": [
                        4,
                        11,
                        23,
                        35,
                        42
                      ],
                      "bonusNumbers": [
                        9
                      ],
                      "jackpotAmount": 5400000000,
                      "jackpotCurrency": "COP",
                      "totalWinners": 0,
                      "rollover": true
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "limit": 20,
                    "total": 312
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/providers": {
      "get": {
        "operationId": "listProviders",
        "summary": "List Providers",
        "description": "List Providers endpoint of the Lottery API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/lottery/list-providers"
        },
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "true"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "CO"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "20"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "baloto"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "slug": "co-baloto",
                      "name": "Baloto",
                      "countryCode": "CO",
                      "region": null,
                      "currency": "COP",
                      "timezone": "America/Bogota",
                      "website": "https://baloto.com",
                      "mainNumbersCount": 5,
                      "mainNumbersMax": 43,
                      "bonusNumbersCount": 1,
                      "bonusNumbersMax": 16,
                      "bonusLabel": "Super Balota",
                      "schedule": {
                        "days": [
                          "Wed",
                          "Sat"
                        ]
                      },
                      "description": "National jackpot lottery: 5 main numbers plus one Super Balota.",
                      "isActive": true
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "limit": 20,
                    "total": 4
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}