Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: Have I Been Pwned API v3 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:
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'
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.
Unauthorized:
description: The `hibp-api-key` header is missing or invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
AccountPath:
name: account
in: path
required: true
description: URL-encoded email address to search.
schema:
type: string
format: email
schemas:
Error:
type: object
description: Standard HIBP error payload.
properties:
statusCode:
type: integer
message:
type: string
required:
- statusCode
- message
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
- 'null'
description: Title of the paste, if available.
Date:
type:
- string
- 'null'
format: date-time
description: When the paste was published.
EmailCount:
type: integer
description: Number of email addresses found in the paste.
required:
- Source
- Id
- EmailCount
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.
'