{
  "openapi": "3.1.0",
  "components": {
    "schemas": {
      "IpCategory_Basic": {
        "type": "string",
        "enum": ["reputation", "anonymizers", "detected_bots", "known_bots"]
      },
      "IpCategory_Full": {
        "type": "string",
        "enum": ["reputation", "anonymizers", "detected_bots", "known_bots"]
      },
      "IpDatasetFileFormat": {
        "type": "string",
        "enum": ["mmdb", "csv", "full_csv"]
      },
      "IpDatasetFileMetadata_Basic": {
        "type": "object",
        "required": ["byteSize", "md5", "sha1", "sha256"],
        "properties": {
          "byteSize": {
            "type": "integer",
            "format": "int32"
          },
          "md5": {
            "type": "string"
          },
          "sha1": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          }
        }
      },
      "IpDatasetFileMetadata_Full": {
        "type": "object",
        "required": ["byteSize", "md5", "sha1", "sha256"],
        "properties": {
          "byteSize": {
            "type": "integer",
            "format": "int32"
          },
          "md5": {
            "type": "string"
          },
          "sha1": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          }
        }
      },
      "IpDatasetMetadata_Basic": {
        "type": "object",
        "required": ["name", "category", "version", "numEntries", "formats"],
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IpCategory_Basic"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "numEntries": {
            "type": "integer",
            "format": "int32"
          },
          "formats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/IpDatasetFileMetadata_Basic"
            }
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "IpDatasetMetadata_Full": {
        "type": "object",
        "required": ["name", "category", "version", "numEntries", "formats"],
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IpCategory_Full"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "numEntries": {
            "type": "integer",
            "format": "int32"
          },
          "formats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/IpDatasetFileMetadata_Full"
            }
          },
          "timestamp": {
            "type": "string"
          },
          "versions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/IpDatasetVersionMetadata_Full"
            }
          }
        }
      },
      "IpDatasetVersionMetadata_Full": {
        "type": "object",
        "required": ["name", "version", "numEntries", "formats"],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "numEntries": {
            "type": "integer",
            "format": "int32"
          },
          "formats": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/IpDatasetFileMetadata_Full"
            }
          },
          "timestamp": {
            "type": "string"
          },
          "expires": {
            "type": ["string", "null"]
          }
        }
      },
      "IpInfoLocation": {
        "type": "object",
        "required": [
          "country",
          "city",
          "longitude",
          "latitude",
          "timezone",
          "continent",
          "eu"
        ],
        "properties": {
          "country": {
            "type": ["string", "null"]
          },
          "city": {
            "type": ["string", "null"]
          },
          "longitude": {
            "type": ["number", "null"],
            "format": "double"
          },
          "latitude": {
            "type": ["number", "null"],
            "format": "double"
          },
          "timezone": {
            "type": ["string", "null"]
          },
          "continent": {
            "type": ["string", "null"]
          },
          "eu": {
            "type": ["boolean", "null"]
          }
        }
      },
      "IpInfoNetwork": {
        "type": "object",
        "required": ["asn", "as", "isp", "org", "networkType", "mcc", "mnc"],
        "properties": {
          "asn": {
            "type": ["integer", "null"],
            "format": "int64"
          },
          "as": {
            "type": ["string", "null"]
          },
          "isp": {
            "type": ["string", "null"]
          },
          "org": {
            "type": ["string", "null"]
          },
          "networkType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NetworkType"
              },
              {
                "type": "null"
              }
            ]
          },
          "mcc": {
            "type": ["string", "null"]
          },
          "mnc": {
            "type": ["string", "null"]
          }
        }
      },
      "IpQueryResponse": {
        "type": "object",
        "required": ["ip"],
        "properties": {
          "ip": {
            "type": "string"
          },
          "risks": {
            "type": ["object", "null"],
            "additionalProperties": {
              "type": "string"
            }
          },
          "network": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IpInfoNetwork"
              },
              {
                "type": "null"
              }
            ]
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IpInfoLocation"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "NetworkType": {
        "type": "string",
        "enum": ["Unknown", "Mobile", "WiFi"]
      },
      "RangerApiMeResponse": {
        "type": "object",
        "required": ["accountId", "apiCredits"],
        "properties": {
          "accountId": {
            "type": "integer",
            "format": "int32"
          },
          "apiCredits": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "StatsFilter": {
        "type": "object",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "description": "You need to supply a valid API Key in the `Authorization` header. The header must only contain the key, with no scheme like \"Bearer\". Requests with invalid authentication will return a `401 Unauthorized` HTTP Status.\n\nYou can manage your API keys in the <a href='https://app.ipraccoon.com/developers-settings'>Developers Settings</a> in the IP Raccoon dashboard.\n",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "info": {
    "contact": {
      "email": "tech@optickssecurity.com",
      "name": "Engineering Team",
      "url": "https://ipraccoon.com"
    },
    "description": "\n  # Overview\n  This website describes the resources that make up the official REST API. If you have any problems or requests please contact [support](mailto:tech@optickssecurity.com).\n  # Schema\n  All API access is over **HTTPS**, and accessed from `https://api.ipraccoon.com`. All data is sent and received as JSON.\n",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "IP Raccoon - API",
    "version": "1"
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/datasets": {
      "get": {
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IpDatasetMetadata_Basic"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get Datasets Info",
        "tags": ["Ip Dataset Download Controller"]
      }
    },
    "/datasets/all": {
      "get": {
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IpDatasetMetadata_Full"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get Datasets Full Info",
        "tags": ["Ip Dataset Download Controller"]
      }
    },
    "/download/{name}": {
      "get": {
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/IpDatasetFileFormat"
                },
                {
                  "type": "null"
                }
              ]
            },
            "required": true
          },
          {
            "name": "version",
            "in": "query",
            "schema": {
              "type": ["integer", "null"],
              "format": "int64"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Download File",
        "tags": ["Ip Dataset Download Controller"]
      }
    },
    "/ip/{ip}": {
      "get": {
        "parameters": [
          {
            "example": "127.0.0.1",
            "required": true,
            "name": "ip",
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IpQueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported IP address"
          },
          "401": {
            "description": "Unauthorized user"
          },
          "409": {
            "description": "API usage limits reached"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Query Ip",
        "tags": ["Ip Query Controller"]
      }
    },
    "/ip/{ip}/{fullInfo}": {
      "get": {
        "parameters": [
          {
            "name": "fullInfo",
            "in": "path",
            "required": true,
            "schema": {
              "type": ["string", "null"]
            }
          },
          {
            "example": "127.0.0.1",
            "required": true,
            "name": "ip",
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IpQueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported IP address"
          },
          "401": {
            "description": "Unauthorized user"
          },
          "409": {
            "description": "API usage limits reached"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Query Ip Full",
        "tags": ["Ip Query Controller"]
      }
    },
    "/me": {
      "get": {
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RangerApiMeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Me",
        "tags": ["Me Controller"]
      }
    }
  }
}
