{
  "openapi": "3.1.1",
  "info": {
    "title": "Internet Outage Atlas API",
    "version": "1.0.0",
    "summary": "Correlate public outage signals (IODA, RIPEstat BGP, live probe) for a country, ASN or domain.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://internetoutageatlas.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Correlate public outage signals (IODA, RIPEstat BGP, live probe) for a country, ASN or domain.",
        "description": "Builds a timeline of internet disruptions for a country, network (ASN) or domain by correlating IODA outage alerts and events (BGP, active probing, telescope, traffic signals from Georgia Tech), RIPEstat routing visibility and BGP update bursts, and a direct reachability probe of the domain. Overlapping signals from independent sources are marked as corroborated; single-signal events stay flagged as uncertain.\n\nMethodology:\n- IODA (Internet Outage Detection and Analysis, Georgia Tech) v2 API: /outages/alerts and /outages/events for entityType country or asn over the look-back window. IODA compares BGP-visible /24 blocks, active-probing responses, darknet telescope traffic and Google/Mozilla traffic against their recent history.\n- Alerts are paired per data source (non-normal alert → next \"normal\" alert) into episodes; an episode without a recovery alert is treated as ongoing.\n- For ASNs (and the ASN hosting a domain's first public IPv4/IPv6 address, via RIPEstat network-info) RIPEstat routing-status gives RIS peer visibility and announced prefixes; bgp-update-activity hours above max(3 × median, 100) updates are flagged as BGP bursts.\n- Domains are also probed directly with one HTTPS GET from this server (reachable = any HTTP response below 500).\n- Intervals from different sources that overlap (30-minute slack) are merged into incidents; ≥2 independent signals = corroborated, otherwise single-signal (could be measurement noise).",
        "tags": [
          "infrastructure"
        ],
        "x-mcp-tool": "internet_outage_atlas",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InternetOutageAtlasInput"
              },
              "examples": {
                "example1": {
                  "summary": "Pasted IODA alerts for a country (illustrative)",
                  "value": {
                    "mode": "paste",
                    "target": "IR",
                    "targetType": "country",
                    "pastedJson": "{\n \"type\": \"outages.alerts\",\n \"data\": [\n  {\n   \"datasource\": \"bgp\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791231300,\n   \"level\": \"critical\",\n   \"condition\": \"< 0.99\",\n   \"value\": 41245,\n   \"historyValue\": 41687,\n   \"method\": \"median\"\n  },\n  {\n   \"datasource\": \"ping-slash24\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791232200,\n   \"level\": \"critical\",\n   \"condition\": \"< 0.8\",\n   \"value\": 61200,\n   \"historyValue\": 88400,\n   \"method\": \"median\"\n  },\n  {\n   \"datasource\": \"ping-slash24\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791241200,\n   \"level\": \"normal\",\n   \"condition\": \"normal\",\n   \"value\": 87900,\n   \"historyValue\": 88400,\n   \"method\": \"median\"\n  },\n  {\n   \"datasource\": \"bgp\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791244200,\n   \"level\": \"normal\",\n   \"condition\": \"normal\",\n   \"value\": 41278,\n   \"historyValue\": 41687,\n   \"method\": \"median\"\n  },\n  {\n   \"datasource\": \"merit-nt\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791727500,\n   \"level\": \"warning\",\n   \"condition\": \"< 0.9\",\n   \"value\": 1800,\n   \"historyValue\": 2100,\n   \"method\": \"median\"\n  },\n  {\n   \"datasource\": \"merit-nt\",\n   \"entity\": {\n    \"code\": \"IR\",\n    \"name\": \"Iran (Islamic Republic Of)\",\n    \"type\": \"country\"\n   },\n   \"time\": 1791728400,\n   \"level\": \"normal\",\n   \"condition\": \"normal\",\n   \"value\": 2080,\n   \"historyValue\": 2100,\n   \"method\": \"median\"\n  }\n ]\n}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternetOutageAtlasResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "InternetOutageAtlasInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "title": "Mode",
            "type": "string",
            "enum": [
              "live",
              "paste"
            ],
            "default": "live"
          },
          "target": {
            "title": "Country code, ASN or domain",
            "type": "string",
            "maxLength": 253
          },
          "targetType": {
            "title": "Target type",
            "type": "string",
            "enum": [
              "auto",
              "country",
              "asn",
              "domain"
            ],
            "default": "auto"
          },
          "windowHours": {
            "title": "Look-back window",
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "default": 48,
            "x-unit": "hours"
          },
          "pastedJson": {
            "title": "IODA alerts/events JSON (paste mode)",
            "description": "Response of /v2/outages/alerts or /v2/outages/events (or {\"alerts\":…, \"events\":…}).",
            "type": "string",
            "maxLength": 500000
          }
        },
        "required": [
          "target"
        ]
      },
      "InternetOutageAtlasResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "target",
              "targetType",
              "mode",
              "window",
              "entityName",
              "asn",
              "alertCount",
              "episodes",
              "events",
              "routing",
              "probe",
              "incidents",
              "status"
            ],
            "properties": {
              "target": {
                "type": "string"
              },
              "targetType": {
                "type": "string",
                "enum": [
                  "country",
                  "asn",
                  "domain"
                ]
              },
              "mode": {
                "type": "string",
                "enum": [
                  "live",
                  "paste"
                ]
              },
              "window": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "from",
                  "until"
                ],
                "properties": {
                  "from": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "until": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "asn": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "alertCount": {
                "type": "integer"
              },
              "episodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "datasource",
                    "start",
                    "end",
                    "worstLevel",
                    "minRatio"
                  ],
                  "properties": {
                    "datasource": {
                      "type": "string"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "worstLevel": {
                      "type": "string"
                    },
                    "minRatio": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "datasource",
                    "start",
                    "durationSeconds",
                    "score"
                  ],
                  "properties": {
                    "datasource": {
                      "type": "string"
                    },
                    "start": {
                      "type": "string"
                    },
                    "durationSeconds": {
                      "type": "integer"
                    },
                    "score": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "routing": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "visibilityV4",
                  "visibilityV6",
                  "prefixesV4",
                  "prefixesV6",
                  "bgpSpikes"
                ],
                "properties": {
                  "visibilityV4": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "visibilityV6": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "prefixesV4": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "prefixesV6": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "bgpSpikes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "time",
                        "total",
                        "withdrawals"
                      ],
                      "properties": {
                        "time": {
                          "type": "string"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "withdrawals": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              },
              "probe": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "url",
                  "reachable",
                  "status",
                  "error"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "reachable": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "error": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "incidents": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "start",
                    "end",
                    "signals",
                    "confidence",
                    "detail"
                  ],
                  "properties": {
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "signals": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "confidence": {
                      "type": "string",
                      "enum": [
                        "corroborated",
                        "single-signal"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              },
              "status": {
                "type": "string",
                "enum": [
                  "disruption-ongoing",
                  "recent-disruption",
                  "no-disruption-signals",
                  "insufficient-data"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}