{
  "openapi": "3.1.1",
  "info": {
    "title": "MyRecon Public Data API",
    "version": "1",
    "description": "Keyless GET access to MyRecon’s selected archive of public breach metadata and original case-file index. The archive carries attribution to Have I Been Pwned. Refer to each feed’s licence for reuse terms."
  },
  "servers": [
    {
      "url": "https://www.myrecon.xyz/data/v1"
    }
  ],
  "externalDocs": {
    "description": "Examples and attribution requirements",
    "url": "https://www.myrecon.xyz/developers.html"
  },
  "paths": {
    "/index.json": {
      "get": {
        "operationId": "getIndex",
        "summary": "Discover the public feeds and API description",
        "responses": {
          "200": {
            "description": "Discover the public feeds and API description",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Discovery"
                }
              }
            }
          }
        }
      }
    },
    "/breaches.json": {
      "get": {
        "operationId": "listBreaches",
        "summary": "Read the MyRecon breach catalogue",
        "responses": {
          "200": {
            "description": "Read the MyRecon breach catalogue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreachCatalogue"
                }
              }
            }
          }
        }
      }
    },
    "/breaches/{slug}.json": {
      "get": {
        "operationId": "getBreach",
        "summary": "Read a single incident by its catalogue slug",
        "responses": {
          "200": {
            "description": "Read a single incident by its catalogue slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreachResponse"
                }
              }
            }
          },
          "404": {
            "description": "No file exists for this slug.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Use the slug returned by the catalogue.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "example": "mckesson"
          }
        ]
      }
    },
    "/latest.json": {
      "get": {
        "operationId": "listLatestBreaches",
        "summary": "Read the most recently added catalogue entries",
        "responses": {
          "200": {
            "description": "Read the most recently added catalogue entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestBreaches"
                }
              }
            }
          }
        }
      }
    },
    "/case-files.json": {
      "get": {
        "operationId": "listCaseFiles",
        "summary": "Read the original case-file index",
        "responses": {
          "200": {
            "description": "Read the original case-file index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseFileIndex"
                }
              }
            }
          }
        }
      }
    },
    "/stats.json": {
      "get": {
        "operationId": "getStats",
        "summary": "Read aggregate archive counters",
        "responses": {
          "200": {
            "description": "Read aggregate archive counters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BreachAttribution": {
        "type": "object",
        "properties": {
          "required": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "distributor": {
            "type": "string"
          },
          "distributor_url": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string",
            "format": "uri"
          },
          "notice": {
            "type": "string"
          }
        },
        "required": [
          "required",
          "source",
          "source_url",
          "distributor",
          "distributor_url",
          "licence",
          "notice"
        ]
      },
      "CaseFileAttribution": {
        "type": "object",
        "properties": {
          "required": {
            "type": "boolean"
          },
          "author": {
            "type": "string"
          },
          "author_url": {
            "type": "string",
            "format": "uri"
          },
          "notice": {
            "type": "string"
          }
        },
        "required": [
          "required",
          "author",
          "author_url",
          "notice"
        ]
      },
      "Breach": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "breach_date": {
            "type": "string",
            "format": "date"
          },
          "added_date": {
            "type": "string",
            "format": "date-time",
            "description": "When the upstream source added the incident."
          },
          "accounts": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Upstream count for this incident. Check count_unit when present."
          },
          "severity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "MyRecon’s score based on the published data categories."
          },
          "band": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "sensitive": {
            "type": "boolean"
          },
          "stealer_log": {
            "type": "boolean"
          },
          "data_classes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "string"
          },
          "logo": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "count_unit": {
            "type": "string",
            "examples": [
              "unique_email_addresses"
            ]
          },
          "data_provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "scale_line": {
            "type": [
              "string",
              "null"
            ]
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "why": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "why"
              ]
            }
          },
          "story": {
            "type": "object",
            "properties": {
              "background": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "how": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "motive": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "outcome": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "editorial": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "background",
              "how",
              "motive",
              "outcome",
              "editorial"
            ]
          },
          "check_targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "breach_date": {
                  "type": "string",
                  "format": "date"
                },
                "match_year": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "breach_date"
              ]
            }
          }
        },
        "required": [
          "slug",
          "name",
          "title",
          "domain",
          "breach_date",
          "added_date",
          "accounts",
          "severity",
          "band",
          "verified",
          "sensitive",
          "stealer_log",
          "data_classes",
          "summary",
          "logo",
          "url"
        ]
      },
      "CaseFile": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "headline": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "occurred": {
            "type": "string",
            "description": "Editorial date label, which can be a range or approximation."
          },
          "disclosed": {
            "type": "string",
            "description": "Editorial disclosure date label."
          },
          "people_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Reported number of people, or 0 when the case file has no count."
          },
          "vector": {
            "type": "string"
          },
          "exposed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "published": {
            "type": "string",
            "format": "date"
          },
          "updated": {
            "type": "string",
            "format": "date"
          },
          "reading_minutes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "slug",
          "url",
          "headline",
          "subject",
          "description",
          "occurred",
          "disclosed",
          "people_count",
          "vector",
          "exposed",
          "published",
          "updated",
          "reading_minutes"
        ]
      },
      "BreachResponse": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/BreachAttribution"
          },
          "breach": {
            "$ref": "#/components/schemas/Breach"
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "breach"
        ]
      },
      "BreachCatalogue": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/BreachAttribution"
          },
          "count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "total_accounts": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Sum of reported counts across incidents. A person or account can appear more than once."
          },
          "breaches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Breach"
            }
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "count",
          "total_accounts",
          "breaches"
        ]
      },
      "LatestBreaches": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/BreachAttribution"
          },
          "count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "breaches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Breach"
            }
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "count",
          "breaches"
        ]
      },
      "CaseFileIndex": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/CaseFileAttribution"
          },
          "count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "case_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseFile"
            }
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "count",
          "case_files"
        ]
      },
      "Stats": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/BreachAttribution"
          },
          "breaches_tracked": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "accounts_affected": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "severe_breaches": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "stealer_log_breaches": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "verified_breaches": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "case_files": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "case_file_words": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "breaches_tracked",
          "accounts_affected",
          "severe_breaches",
          "stealer_log_breaches",
          "verified_breaches",
          "case_files",
          "case_file_words"
        ]
      },
      "Discovery": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "integer",
            "const": 1
          },
          "generated": {
            "type": "string",
            "format": "date",
            "description": "UTC date of the MyRecon build that wrote this file."
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "licence": {
            "type": "string"
          },
          "attribution": {
            "$ref": "#/components/schemas/BreachAttribution"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "embed": {
            "type": "string",
            "format": "uri"
          },
          "counts": {
            "type": "object",
            "properties": {
              "breaches": {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              },
              "case_files": {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              }
            },
            "required": [
              "breaches",
              "case_files"
            ]
          },
          "endpoints": {
            "type": "object",
            "properties": {
              "breaches": {
                "type": "string",
                "format": "uri"
              },
              "breach_by_slug": {
                "type": "string",
                "description": "URL template with a {slug} placeholder."
              },
              "latest": {
                "type": "string",
                "format": "uri"
              },
              "case_files": {
                "type": "string",
                "format": "uri"
              },
              "stats": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "breaches",
              "breach_by_slug",
              "latest",
              "case_files",
              "stats"
            ]
          }
        },
        "required": [
          "api_version",
          "generated",
          "documentation",
          "licence",
          "attribution",
          "name",
          "description",
          "openapi",
          "embed",
          "counts",
          "endpoints"
        ]
      }
    }
  }
}
