{"id":19864145,"url":"https://github.com/sr-lab/pwned-api-wrapper","last_synced_at":"2026-05-10T12:02:00.692Z","repository":{"id":75386395,"uuid":"123177461","full_name":"sr-lab/pwned-api-wrapper","owner":"sr-lab","description":"Wraps the Pwned Passwords API offering batch queries etc. from the command line.","archived":false,"fork":false,"pushed_at":"2018-07-17T12:50:21.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-11T15:34:16.450Z","etag":null,"topics":["api","client","coq","pwned-passwords","wrapper"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sr-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-27T19:28:29.000Z","updated_at":"2018-07-17T12:50:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7ca4480-824c-48cd-99e0-2b5342cc1b23","html_url":"https://github.com/sr-lab/pwned-api-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fpwned-api-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fpwned-api-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fpwned-api-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sr-lab%2Fpwned-api-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sr-lab","download_url":"https://codeload.github.com/sr-lab/pwned-api-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241273168,"owners_count":19937096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","coq","pwned-passwords","wrapper"],"created_at":"2024-11-12T15:17:37.202Z","updated_at":"2026-05-10T12:02:00.597Z","avatar_url":"https://github.com/sr-lab.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pwned Passwords API Wrapper\nWraps the Pwned Passwords API (or, preferably, your local Pwned Passwords database) offering batch queries etc. from the command line.\n\n## Overview\nThis repository consists of several projects.\n\n### PwnedApiWrapper\nThis is the class library that can be used to query the API. Usage is very simple, add it as a reference to your project and use it like so:\n\n```csharp\nusing PwnedApiWrapper;\n\n// ...\n\n// Query API, single password.\nvar apiClient = new ApiPwnedClient(\"https://api.pwnedpasswords.com/\");\nvar apiOccurrences = apiClient.GetNumberOfAppearances(\"hunter2\");\n\n// Query local file, several passwords.\nvar localClient = new LocalFilePwnedClient(\"pwned-passwords-2.0.txt\");\nvar localOccurrences = localClient.GetNumberOfAppearances(new[] { \"matrix1\", \"password123\" });\n```\n\n### PwnedApiWrapper.Shared\nJust contains shared code used in each project in the solution (some file I/O and hashing stuff). Don't even worry about it, but make sure `PwnedApiWrapper.Shared.dll` stays alongside the compiled versions of other projects or they won't work.\n\n### PwnedApiWrapper.App\nA command-line application *\"Pwned Passwords Explorer (PPExp)\"* that offers you some of the functionality of `PwnedApiWrapper` from the command line. To get usage information from the utility itself, use the `-h` option like so:\n\n```\nppexp -h\n```\n\nThis utility can be run in three different primary modes:\n\n* `-i`: Interactive mode. Opens up a shell-like interface around a data source allowing you to grab frequencies for one password at a time.\n* `-b \u003cpasswords_file\u003e`: Batch mode. Allows you to pass in a newline-delimited list of passwords in a file and grab frequencies for them all.\n* `-c \u003cpwned_passwords_db_file\u003e`: Frequency-only mode. Allows you to perform actions involving frequencies only (no passwords).\n\n#### Interactive Mode\nAfter specifying interactive mode, pass one of the following options to specify a data source:\n\n* `-a`: Uses the official API. Use this option with consideration please.\n* `-f \u003cpwned_passwords_db_file\u003e`: Uses a local copy of Pwned Passwords. Plain text only, must not be archived.\n\nExample: Start interactive mode against the API:\n\n```\nppexp -i -a\n```\n\nExample: Start interactive mode against a local copy of Pwned Passwords:\n\n```\nppexp -i -f pwned-passwords-2.0.txt\n```\n\n#### Batch Mode\nAfter specifying batch mode, pass one of the following options to specify a data source:\n\n* `-a`: Uses the official API. Use this option with consideration please.\n* `-f \u003cpwned_passwords_db_file\u003e`: Uses a local copy of Pwned Passwords. Plain text only, must not be archived.\n\nExample: Run `passwords.txt` through the API, output in CSV format:\n\n```\nppexp -b passwords.txt -a plain\n```\n\nExample: Run `passwords.txt` through a local copy of Pwned Passwords, output in Coq format:\n\n```\nppexp -b passwords.txt -f pwned-passwords-2.0.txt coq\n```\n\n##### Formats\nBatch mode supports returning results in one of two formats:\n\n* `plain`: Used by default, results will be returned in CSV format.\n* `coq`: Results will be returned in a lookup structure compatible with the [Coq proof assistant](https://coq.inria.fr).\n\n#### Frequency-Only Mode\nAfter specifying frequency-only mode, pass one of the following options to specify a query mode:\n\n* `-l \u003climit\u003e`: Gets all frequencies above a threshold.\n* `-t \u003ccount\u003e`: Gets a number of the highest frequencies. Note that this assumes the data file is sorted by frequency.\n\nExample: Get all frequencies above 1000000:\n\n```\nppexp -c pwned-passwords-2.0.txt -l 1000000\n```\n\nExample: Get top 100 frequencies:\n\n```\nppexp -c pwned-passwords-2.0.txt -t 100\n```\n\nOutput will be printed to standard output, so can obviously be redirected to a file using `\u003e`.\n\n*Please use this utility [considerately](#responsible-use)!*\n\n## Building\nThe utility is written in C#, just build it like any other Visual Studio project.\n\n## Responsible Use\nPlease don't use this utility in batch/API mode to inconsiderately hammer the actual API with thousands and thousands of requests (it will warn you before you do this by default). Troy uses some clever architecture to give the API very high availability and fast performance with no rate limiting; but still please don't be ridiculous. If possible, torrent the database file to your machine, use this utility in batch/local mode, and go crazy with as many requests as you like.\n\n## Acknowledgements\n[Troy Hunt](https://www.troyhunt.com), creator of [Have I Been Pwned?](https://haveibeenpwned.com) maintains [Pwned Passwords](https://haveibeenpwned.com/Passwords) and its API for anyone to use free of charge. Consider [donating](https://haveibeenpwned.com/Donate) to the project to keep it just as awesome into the future. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsr-lab%2Fpwned-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsr-lab%2Fpwned-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsr-lab%2Fpwned-api-wrapper/lists"}