{
  "openapi": "3.1.0",
  "info": {
    "title": "IntelMap Public API",
    "version": "1.0.0-beta",
    "description": "Free, keyless read access to IntelMap's supported public intelligence endpoints. Data is informational and retains mixed-source provenance."
  },
  "servers": [{"url": "https://intelmap.watch"}],
  "externalDocs": {"description": "Developer documentation", "url": "https://intelmap.watch/developers/"},
  "paths": {
    "/api/feed/": {
      "get": {
        "summary": "Get the active intelligence snapshot",
        "responses": {"200": {"description": "Current normalized signal snapshot", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "503": {"$ref": "#/components/responses/Unavailable"}}
      }
    },
    "/api/history/": {
      "get": {
        "summary": "Query the rolling signal archive",
        "parameters": [
          {"name": "hours", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 87600, "default": 168}},
          {"name": "from", "in": "query", "schema": {"type": "string"}},
          {"name": "to", "in": "query", "schema": {"type": "string"}},
          {"name": "country", "in": "query", "schema": {"type": "string", "maxLength": 120}},
          {"name": "category", "in": "query", "schema": {"type": "string", "maxLength": 40}},
          {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500}},
          {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}},
          {"name": "id", "in": "query", "schema": {"type": "string", "pattern": "^[a-f0-9]{12}$"}},
          {"name": "mode", "in": "query", "schema": {"type": "string", "enum": ["countries", "calendar"]}},
          {"name": "month", "in": "query", "schema": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}$"}}
        ],
        "responses": {"200": {"description": "Archive query result", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "422": {"$ref": "#/components/responses/Invalid"}}
      }
    },
    "/api/network/": {
      "get": {"summary": "Get cached Internet routing observations", "responses": {"200": {"description": "RIPE RIS-derived routing snapshot", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}}}
    },
    "/api/piracy/": {
      "get": {"summary": "Get current maritime-security incidents", "responses": {"200": {"description": "Current incident FeatureCollection", "content": {"application/geo+json": {"schema": {"type": "object", "additionalProperties": true}}}}}}
    },
    "/api/popularity/": {
      "get": {
        "summary": "Get most-watched signals",
        "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 20, "default": 8}}],
        "responses": {"200": {"description": "24-hour reader-interest ranking", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}}
      }
    }
  },
  "components": {
    "responses": {
      "Invalid": {"description": "Invalid query parameter", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}},
      "Unavailable": {"description": "Snapshot temporarily unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}
    },
    "schemas": {
      "Error": {"type": "object", "required": ["error"], "properties": {"error": {"type": "string"}}}
    }
  }
}
