{
  "openapi": "3.0.3",
  "info": {
    "title": "GeoIPy API",
    "version": "1.0.0",
    "description": "Public IP lookup. Usage resets each UTC calendar month. Prefer the X-API-Key header; keys belong on your server."
  },
  "servers": [
    {
      "url": "https://www.geoipy.com"
    }
  ],
  "paths": {
    "/api/IPsInfo": {
      "get": {
        "operationId": "lookupIp",
        "summary": "Look up a public IPv4 or IPv6 address",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "LegacyQueryKey": []
          }
        ],
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 45
            },
            "example": "8.8.8.8"
          }
        ],
        "responses": {
          "200": {
            "description": "IP data; fields may be null or unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Data-Fetched-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ip"
                  ],
                  "properties": {
                    "ip": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "LegacyQueryKey": {
        "type": "apiKey",
        "in": "query",
        "name": "key",
        "description": "Compatibility only. Avoid credentials in URLs and access logs."
      }
    },
    "responses": {
      "Error": {
        "description": "Request failed. Honor Retry-After for temporary errors when present.",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Seconds until a retry is appropriate."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "success",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "type",
              "info"
            ],
            "properties": {
              "code": {
                "type": "integer"
              },
              "type": {
                "type": "string"
              },
              "info": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
