{"openapi":"3.0.3","info":{"title":"breached.co.za API","version":"1.0.0","description":"Read-only JSON API for the published entries on breached.co.za. Pending, rejected and anonymous-tip items are never exposed. Each entry links to its original source; please use with attribution. No warranty.","license":{"name":"Use with attribution to breached.co.za; entries link to third-party sources"}},"servers":[{"url":"https://breached.co.za/api/v1"}],"paths":{"/breaches":{"get":{"summary":"List published breaches (newest reported first)","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"date_reported on or after this date (YYYY-MM-DD)"},{"name":"published_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"published_at strictly after this timestamp. Alias: added_since. Use this to poll for new entries."},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"updated_at strictly after this timestamp (new or corrected entries)"},{"name":"company","in":"query","schema":{"type":"string"},"description":"case-insensitive substring of the company name"},{"name":"sector","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"},"description":"case-insensitive substring of source_name"},{"name":"country","in":"query","schema":{"type":"string"},"description":"ISO-2, e.g. ZA"},{"name":"year","in":"query","schema":{"type":"integer"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["reported","published"],"default":"reported"},"description":"reported = by date_reported; published = by published_at, newest first"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"object","properties":{"total":{"type":"integer"},"count":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"next_offset":{"type":"integer","nullable":true},"generated_at":{"type":"string","format":"date-time"}}},"data":{"type":"array","items":{"$ref":"#/components/schemas/Breach"}}}}}}},"400":{"description":"Bad parameter"},"429":{"description":"Rate limited"}}}},"/breaches/{id}":{"get":{"summary":"One published breach","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breach"}}}},"404":{"description":"Not found, or not published"}}}},"/stats":{"get":{"summary":"Counts per year, month and sector (published only)","responses":{"200":{"description":"OK"}}}},"/feed.xml":{"get":{"summary":"Atom feed of the 50 most recently published entries","responses":{"200":{"description":"Atom 1.0","content":{"application/atom+xml":{}}}}}},"/openapi.json":{"get":{"summary":"This document","responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Breach":{"type":"object","properties":{"id":{"type":"string"},"company":{"type":"string"},"sector":{"type":"string"},"date_reported":{"type":"string","format":"date","description":"date the source reported it"},"summary":{"type":"string"},"source_name":{"type":"string"},"source_url":{"type":"string","format":"uri"},"country":{"type":"string"},"published_at":{"type":"string","format":"date-time","description":"when the entry went live on the site (stable)"},"updated_at":{"type":"string","format":"date-time","description":"last edit or publish time"}}}}}}