{
 "openapi": "3.1.0",
 "info": {
  "title": "Tutu eSIM plans",
  "version": "1.0",
  "description": "Live prepaid travel eSIM data plans and prices from tutuesim.com. Read only, no key. Give the user the buy_url."
 },
 "servers": [
  {
   "url": "https://tutuesim.com"
  }
 ],
 "paths": {
  "/api/gpt/plans": {
   "get": {
    "operationId": "searchPlans",
    "summary": "eSIM data plans for a country or a region",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "ISO code (EG) or name (Egypt, Єгипет)"
     },
     {
      "name": "region",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "global",
        "europe",
        "asia",
        "southeast-asia",
        "north-america",
        "latin-america",
        "middle-east",
        "balkans",
        "caribbean",
        "africa",
        "oceania"
       ]
      }
     },
     {
      "name": "gb",
      "in": "query",
      "schema": {
       "type": "number"
      },
      "description": "at least this much data"
     },
     {
      "name": "days",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "at least this many days"
     },
     {
      "name": "unlimited",
      "in": "query",
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "en",
        "uk",
        "ru"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "plans sorted by price",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Plans"
        }
       }
      }
     }
    }
   }
  },
  "/api/gpt/country": {
   "get": {
    "operationId": "getCountry",
    "summary": "networks, 5G and fair use in a country",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "en",
        "uk",
        "ru"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "coverage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/gpt/compare": {
   "get": {
    "operationId": "comparePrices",
    "summary": "honest eSIM and roaming price comparison for a trip from Ukraine (Tutu, Airalo, Yesim, Saily, Nomad, Holafly; Kyivstar, Vodafone, lifecell), each price with its check date",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "ISO code or name"
     },
     {
      "name": "gb",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1",
        "3",
        "5",
        "10",
        "20",
        "unl"
       ]
      }
     },
     {
      "name": "days",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "only plans valid at least this many days"
     }
    ],
    "responses": {
     "200": {
      "description": "the comparison",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Plans": {
    "type": "object",
    "properties": {
     "destination": {
      "type": "string"
     },
     "currency": {
      "type": "string"
     },
     "all_plans_url": {
      "type": "string"
     },
     "notes": {
      "type": "string"
     },
     "plans": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "plan_id": {
         "type": "string"
        },
        "type": {
         "type": "string",
         "enum": [
          "data",
          "unlimited"
         ]
        },
        "data": {
         "type": "string"
        },
        "days": {
         "type": "integer"
        },
        "price_usd": {
         "type": "number"
        },
        "price_uah_approx": {
         "type": "integer"
        },
        "buy_url": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}