HaveIBeenPwned Pastes API

Lookup pastes referencing an email address.

Documentation

Specifications

Schemas & Data

Other Resources

🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-breaches-for-account-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-breaches-by-range-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-list-breaches-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-breach-by-name-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-latest-breach-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-list-data-classes-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-pastes-for-account-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-stealer-logs-by-email-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-stealer-logs-by-website-domain-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-stealer-logs-by-email-domain-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-breached-domain-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-list-subscribed-domains-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-get-subscription-status-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/hibp-generate-dns-token-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/haveibeenpwned/refs/heads/main/examples/pwned-passwords-search-range-example.json
🔗
SDKs
https://github.com/HaveIBeenPwned/PwnedPasswordsAzureFunction
🔗
SDKs
https://github.com/HaveIBeenPwned/PwnedPasswordsCloudflareWorker
🔗
Tools
https://github.com/HaveIBeenPwned/PwnedPasswordsDownloader

OpenAPI Specification

haveibeenpwned-pastes-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Have I Been Pwned API v3 Breached Accounts Pastes API
  description: 'The Have I Been Pwned (HIBP) API allows the list of pwned accounts (email addresses, domains,

    passwords, and stealer log entries) to be quickly searched via REST. Authenticated endpoints

    require an `hibp-api-key` header. All requests must send a `user-agent` header that accurately

    identifies the consuming application. Subscriptions range from Pwned 1 to Pwned 5.

    '
  version: 3.0.0
  contact:
    name: Have I Been Pwned
    url: https://haveibeenpwned.com/API/v3
  license:
    name: Creative Commons Attribution 4.0
    url: https://creativecommons.org/licenses/by/4.0/
servers:
- url: https://haveibeenpwned.com/api/v3
  description: HIBP Production API
security:
- ApiKeyAuth: []
tags:
- name: Pastes
  description: Lookup pastes referencing an email address.
paths:
  /pasteaccount/{account}:
    get:
      tags:
      - Pastes
      summary: Get Pastes For An Account
      description: Returns all pastes referencing the supplied email address, sorted chronologically (newest first).
      operationId: getPastesForAccount
      parameters:
      - $ref: '#/components/parameters/AccountPath'
      responses:
        '200':
          description: A list of pastes referencing the account.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Paste'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  responses:
    Unauthorized:
      description: The `hibp-api-key` header is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: 'Rate limit exceeded. Inspect the `retry-after` header to determine when to retry.

        '
      headers:
        retry-after:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No record matched the supplied identifier.
    Forbidden:
      description: 'The request is forbidden. Common causes include a missing `user-agent` header,

        querying an unverified domain, or a feature not included in the calling subscription.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Paste:
      type: object
      description: A paste referencing an email address.
      properties:
        Source:
          type: string
          description: Paste source service (e.g. Pastebin, Pastie, Slexy, Ghostbin).
        Id:
          type: string
          description: Source-specific identifier of the paste.
        Title:
          type: string
          nullable: true
          description: Title of the paste, if available.
        Date:
          type: string
          format: date-time
          nullable: true
          description: When the paste was published.
        EmailCount:
          type: integer
          description: Number of email addresses found in the paste.
      required:
      - Source
      - Id
      - EmailCount
    Error:
      type: object
      description: Standard HIBP error payload.
      properties:
        statusCode:
          type: integer
        message:
          type: string
      required:
      - statusCode
      - message
  parameters:
    AccountPath:
      name: account
      in: path
      required: true
      description: URL-encoded email address to search.
      schema:
        type: string
        format: email
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: hibp-api-key
      description: '32-character hexadecimal API key issued at https://haveibeenpwned.com/API/Key.

        Required for all account, paste, stealer log, domain search, and subscription endpoints.

        '