{"id":13808930,"url":"https://github.com/techgaun/ex_pwned","last_synced_at":"2025-06-16T04:11:30.640Z","repository":{"id":57500881,"uuid":"76103254","full_name":"techgaun/ex_pwned","owner":"techgaun","description":"Elixir client for haveibeenpwned.com","archived":false,"fork":false,"pushed_at":"2020-04-05T21:37:45.000Z","size":31,"stargazers_count":26,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T01:01:43.356Z","etag":null,"topics":["breaches","elixir-client","hacktoberfest","haveibeenpwned","hex"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techgaun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-10T09:31:13.000Z","updated_at":"2025-01-02T02:46:53.000Z","dependencies_parsed_at":"2022-08-31T11:03:04.739Z","dependency_job_id":null,"html_url":"https://github.com/techgaun/ex_pwned","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techgaun/ex_pwned","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_pwned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_pwned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_pwned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_pwned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techgaun","download_url":"https://codeload.github.com/techgaun/ex_pwned/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_pwned/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260093724,"owners_count":22957726,"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":["breaches","elixir-client","hacktoberfest","haveibeenpwned","hex"],"created_at":"2024-08-04T01:01:55.370Z","updated_at":"2025-06-16T04:11:30.618Z","avatar_url":"https://github.com/techgaun.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"# ExPwned\n\n[![Hex version](https://img.shields.io/hexpm/v/ex_pwned.svg \"Hex version\")](https://hex.pm/packages/ex_pwned) ![Hex downloads](https://img.shields.io/hexpm/dt/ex_pwned.svg \"Hex downloads\")\n\n\u003e Elixir client for haveibeenpwned.com\n\n## Installation\n\nThe package can be installed as:\n\n1. Add `ex_pwned` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:ex_pwned, \"~\u003e 0.1.0\"}]\nend\n```\n\n2. Ensure `ex_pwned` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:ex_pwned]]\nend\n```\n\n## Configuration\n\nYou can set the user agent for ExPwned (defaults to `ExPwned Elixir Client`) by specifying user agent in config.\n\n```elixir\nconfig :ex_pwned,\n  user_agent: \"ExMustang Slackbot\"\n```\n\nYou can configure the json library to use for decoding body. By default, it is set to Jason.\nThe json library is supposed to have implemented `decode!/1`.\n\n```elixir\nconfig :ex_pwned,\n  json_library: Poison\n```\n\n## Usage\n\nUsing `ExPwned` is simple.\n\n#### Check if an account is breached or not\n\n```elixir\niex\u003e ExPwned.breached?(\"abc@example.com\")\ntrue\n```\n\n#### Check if a password is breached, and how many times\n```elixir\n# True/False Check\niex\u003e ExPwned.password_breached?(\"password123\")\ntrue\n\n# Returns # of times password was seen in a breach. Zero if none.\niex\u003e ExPwned.password_breach_count(\"password123\")\n5032\n```\n\n#### Check the breaches for an account\n\n```elixir\niex\u003e ExPwned.Breaches.breachedaccount(\"abc@example.com\")\n{:ok,\n [%{\"AddedDate\" =\u003e \"2015-10-26T23:35:45Z\", \"BreachDate\" =\u003e \"2015-03-01\",\n    \"DataClasses\" =\u003e [\"Email addresses\", \"IP addresses\", \"Names\", \"Passwords\"],\n    \"Description\" =\u003e \"In approximately March 2015, the free web hosting provider \u003ca href=\\\"http://www.troyhunt.com/2015/10/breaches-traders-plain-text-passwords.html\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"\u003e000webhost suffered a major data breach\u003c/a\u003e that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords.\",\n    \"Domain\" =\u003e \"000webhost.com\", \"IsActive\" =\u003e true, \"IsRetired\" =\u003e false,\n    \"IsSensitive\" =\u003e false, \"IsSpamList\" =\u003e false, \"IsVerified\" =\u003e true,\n    \"LogoType\" =\u003e \"png\", \"Name\" =\u003e \"000webhost\", \"PwnCount\" =\u003e 13545468,\n    \"Title\" =\u003e \"000webhost\"}], [retry_after: 0]}\n\niex\u003e ExPwned.Breaches.breachedaccount(\"abc@example.com\", [truncateResponse: true, domain: \"adobe.com\"])\n{:ok, [%{\"Name\" =\u003e \"000webhost\"}], [retry_after: 0]}\n```\n\n#### Get all available breaches\n\n```elixir\niex\u003e ExPwned.Breaches.breaches\n{:ok,\n[%{\"AddedDate\" =\u003e \"2015-10-26T23:35:45Z\", \"BreachDate\" =\u003e \"2015-03-01\",\n    \"DataClasses\" =\u003e [\"Email addresses\", \"IP addresses\", \"Names\", \"Passwords\"],\n    \"Description\" =\u003e \"In approximately March 2015, the free web hosting provider \u003ca href=\\\"http://www.troyhunt.com/2015/10/breaches-traders-plain-text-passwords.html\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"\u003e000webhost suffered a major data breach\u003c/a\u003e that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords.\",\n    \"Domain\" =\u003e \"000webhost.com\", \"IsActive\" =\u003e true, \"IsRetired\" =\u003e false,\n    \"IsSensitive\" =\u003e false, \"IsSpamList\" =\u003e false, \"IsVerified\" =\u003e true,\n    \"LogoType\" =\u003e \"png\", \"Name\" =\u003e \"000webhost\", \"PwnCount\" =\u003e 13545468,\n    \"Title\" =\u003e \"000webhost\"},\n  [retry_after: 0]\n}\n\n# or breaches for specific domain\niex\u003e ExPwned.Breaches.breaches(\"000webhost.com\")\n{:ok,\n [%{\"AddedDate\" =\u003e \"2015-10-26T23:35:45Z\", \"BreachDate\" =\u003e \"2015-03-01\",\n    \"DataClasses\" =\u003e [\"Email addresses\", \"IP addresses\", \"Names\", \"Passwords\"],\n    \"Description\" =\u003e \"In approximately March 2015, the free web hosting provider \u003ca href=\\\"http://www.troyhunt.com/2015/10/breaches-traders-plain-text-passwords.html\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"\u003e000webhost suffered a major data breach\u003c/a\u003e that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords.\",\n    \"Domain\" =\u003e \"000webhost.com\", \"IsActive\" =\u003e true, \"IsRetired\" =\u003e false,\n    \"IsSensitive\" =\u003e false, \"IsSpamList\" =\u003e false, \"IsVerified\" =\u003e true,\n    \"LogoType\" =\u003e \"png\", \"Name\" =\u003e \"000webhost\", \"PwnCount\" =\u003e 13545468,\n    \"Title\" =\u003e \"000webhost\"}], [retry_after: 0]}\n```\n\n#### Get specific breach detail\n\n```elixir\niex\u003e ExPwned.Breaches.breach(\"000webhost\")\n{:ok,\n %{\"AddedDate\" =\u003e \"2015-10-26T23:35:45Z\", \"BreachDate\" =\u003e \"2015-03-01\",\n   \"DataClasses\" =\u003e [\"Email addresses\", \"IP addresses\", \"Names\", \"Passwords\"],\n   \"Description\" =\u003e \"In approximately March 2015, the free web hosting provider \u003ca href=\\\"http://www.troyhunt.com/2015/10/breaches-traders-plain-text-passwords.html\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\"\u003e000webhost suffered a major data breach\u003c/a\u003e that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords.\",\n   \"Domain\" =\u003e \"000webhost.com\", \"IsActive\" =\u003e true, \"IsRetired\" =\u003e false,\n   \"IsSensitive\" =\u003e false, \"IsSpamList\" =\u003e false, \"IsVerified\" =\u003e true,\n   \"LogoType\" =\u003e \"png\", \"Name\" =\u003e \"000webhost\", \"PwnCount\" =\u003e 13545468,\n   \"Title\" =\u003e \"000webhost\"}, [retry_after: 0]}\n```\n\n#### Get all data classes for breaches\n\n```elixir\niex\u003e ExPwned.Breaches.dataclasses\n{:ok,\n [\"Account balances\", \"Age groups\", \"Astrological signs\", \"Avatars\",\n  \"Bank account numbers\", \"Banking PINs\", \"Beauty ratings\", \"Biometric data\",\n  \"Browser user agent details\", \"Car ownership statuses\", \"Career levels\",\n  \"Chat logs\", \"Credit card CVV\", \"Credit cards\", \"Credit status information\",\n  \"Customer feedback\", \"Customer interactions\", \"Dates of birth\",\n  \"Deceased date\", \"Device information\", \"Device usage tracking data\",\n  \"Drinking habits\", \"Drug habits\", \"Education levels\", \"Email addresses\",\n  \"Email messages\", \"Employers\", \"Ethnicities\", \"Family members' names\",\n  \"Family plans\", \"Family structure\", \"Financial transactions\",\n  \"Fitness levels\", \"Genders\", \"Geographic locations\", \"Government issued IDs\",\n  \"Historical passwords\", \"Home ownership statuses\", \"Homepage URLs\",\n  \"Income levels\", \"Instant messenger identities\", \"IP addresses\", \"Job titles\",\n  \"MAC addresses\", \"Marital statuses\", \"Names\", \"Nicknames\", \"Parenting plans\",\n  ...], [retry_after: 0]}\n```\n\n#### Get the pastes for an account\n\n```elixir\niex\u003e ExPwned.Pastes.pasteaccount(\"abc@example.com\")\n{:ok,\n [%{\"Date\" =\u003e nil, \"EmailCount\" =\u003e 4788657,\n    \"Id\" =\u003e \"https://pred.me/gmail.html\", \"Source\" =\u003e \"AdHocUrl\",\n    \"Title\" =\u003e \"pred.me\"}], [retry_after: 0]}\n```\n\n### Response\n\nThe response follows following patterns:\n\n```elixir\n# result found\n{:ok, result, [retry_after: seconds_value]}\n\n# no breach\n{:ok, %{msg: \"no breach was found for given input\"}, [retry_after: seconds_value]}\n\n# for errors, the third arg is status code instead\n\n# 400 bad request\n{:error, \"bad request - the parameter does not comply with an acceptable format\", 400}\n\n# 403 forbidden\n{:error, \"no user agent has been specified in the request\", 403}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fex_pwned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechgaun%2Fex_pwned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fex_pwned/lists"}