# Pwned Passwords Checker (`kawsar/pwned-passwords-checker`) Actor

Check local password breach counts securely using k-anonymity. Hashes are computed locally, sending only a 5-character prefix to check against the corpus

- **URL**: https://apify.com/kawsar/pwned-passwords-checker.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Pwned Passwords Checker

![Pwned Passwords Checker cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/pwned-passwords-checker-cover.png)

Check passwords against the Have I Been Pwned Passwords database and retrieve their reported breach counts. Passwords are hashed locally using SHA-1, and only a five-character hash prefix is used for each lookup. The results include the matching hash suffix and breach count, ready for JSON, CSV, or Excel export.

### What This Actor Does

This actor checks a list of passwords using the Pwned Passwords k-anonymity method. It calculates each SHA-1 hash locally, checks the corresponding five-character prefix, and matches the remaining suffix to retrieve its breach count.

Each successful result includes `prefix`, `suffix`, and `count`. A count of `0` means the hash was not found in the returned results. Plaintext passwords are not included in the output dataset.

### Why Use This Actor?

- **Privacy-conscious checks:** Only a five-character SHA-1 prefix is used for each lookup.
- **Structured results:** Retrieve the matching suffix and reported breach count.
- **Controlled requests:** Requests are paced, with retry handling for temporary service errors.
- **Export-ready data:** Download results in JSON, CSV, Excel, and other supported formats.

### Available Mode

- **Check Passwords (`check`):** Checks the supplied passwords and returns their matching breach counts.

### Input

Provide the passwords you want to check and configure the run.

#### Input Example

```json
{
  "mode": "check",
  "passwords": ["password", "123456"],
  "maxItems": 100,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

#### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `check` | Password checking mode. |
| `passwords` | array | `[]` | List of passwords to check. |
| `maxItems` | integer | `100` | Maximum number of successful result rows. |
| `userAgent` | string | `ActorResearch/1.0` | User-Agent used for requests. |
| `timeoutSecs` | integer | `300` | Overall run time budget in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout for an individual request. |
| `proxyConfiguration` | object | `{"useApifyProxy": false}` | Optional proxy configuration. |

### Output

Each successful result contains the five-character hash prefix, the matching suffix, and the reported breach count.

#### Output Example

```json
{
  "prefix": "5BAA6",
  "suffix": "1E4C9B93F3F0682250B6CF8331B7EE68FD8",
  "count": 9659365,
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

#### Output Fields

| Field | Description |
|---|---|
| `prefix` | First five characters of the SHA-1 password hash. |
| `suffix` | Remaining characters of the matching SHA-1 hash. |
| `count` | Number of times the matching password hash appears in the breach dataset. |
| `scrapedAt` | Timestamp when the result was collected. |

### Use Cases

- **Password Policy Audits:** Check candidate passwords against known breach counts when reviewing password policies.
- **Security Research:** Study how frequently common passwords appear in the Pwned Passwords dataset.
- **Onboarding Reviews:** Evaluate default credentials used in lab or staging environments.
- **Developer Tooling:** Incorporate breach-count results into internal password assessment workflows.
- **Compliance Preparation:** Export structured results for security reviews without including plaintext passwords in the output.

### Frequently Asked Questions

**What does the breach count mean?**

The count indicates how many times a matching password hash appears in the Pwned Passwords dataset. A count of zero means no matching suffix was found in the returned lookup results.

**What is the k-anonymity method?**

The method allows a password hash to be checked using only its first five characters. The returned hash suffixes are compared locally to identify a match.

**Can I export the results?**

Yes. Apify supports exporting dataset results in JSON, CSV, Excel, and other available formats.

**Can I schedule recurring checks?**

Yes. You can use Apify Schedules to run the actor periodically with an updated password list.

### Trademark Notice

Have I Been Pwned is a trademark of its respective owner. This actor uses the name solely to identify the data source and is not affiliated with or endorsed by Have I Been Pwned.

### Is Web Scraping Legal?

This actor retrieves publicly available password breach counts using the Pwned Passwords service. Passwords are hashed locally, and only a five-character SHA-1 prefix is used for each lookup. The actor does not bypass login screens, paywalls, or technical security measures.

- **Personal Data:** Password-related information can be sensitive. Avoid submitting passwords belonging to other people without proper authorization, and consider applicable GDPR and CCPA requirements when processing personal data.
- **Copyright and Licensing:** Pwned Passwords data is provided under CC BY 4.0. Follow its attribution requirements when redistributing or republishing the data.
- **Platform Terms and Rate Limits:** Respect Have I Been Pwned's applicable terms and request guidance. Use reasonable request volumes.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional about your specific use case.

For more information, read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

What to scrape. Check passwords hashes locally and queries only the 5-char SHA-1 prefix (k-anonymity).

## `passwords` (type: `array`):

Passwords to check. Hashed locally with SHA-1; only the 5-character prefix is sent to Have I Been Pwned.

## `userAgent` (type: `string`):

Identify your scraper

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it. The Pwned Passwords range API usually works without a proxy.

## Actor input object example

```json
{
  "mode": "check",
  "passwords": [
    "password"
  ],
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "passwords": [
        "password"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/pwned-passwords-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "passwords": ["password"] }

# Run the Actor and wait for it to finish
run = client.actor("kawsar/pwned-passwords-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "passwords": [
    "password"
  ]
}' |
apify call kawsar/pwned-passwords-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/pwned-passwords-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/T9stNidfxGcxFgTfG/builds/DgT0oIa3OiRJOnzc2/openapi.json
