Ruby Quick Start

Get an API Key and Secret

If you haven’t already, sign up for a free trial.

Include the PasswordPing Library

The compiled library is available as a Ruby gem:

gem install passwordping

Try Out Our Example Code

We’ve made calling the API dead simple. This sample code snippet shows you examples of calling the four supported APIs:

require 'passwordping'

# Create a new PasswordPing instance - this is our primary interface for making API calls
passwordping = YOUR_API_KEY, secret: YOUR_API_SECRET)

# Check whether a password has been compromised
if passwordping.check_password("password-to-test")
    puts("Password is compromised")
    puts("Password is not compromised")

# Check whether a specific set of credentials are compromised
if passwordping.check_credentials("", "password-to-test")
    puts("Credentials are compromised")
    puts("Credentials are not compromised")

# get all exposures for a given user
exposures = passwordping.get_exposures_for_user("")
puts(exposures.count.to_s + " exposures found for")

# now get the full details for the first exposure found
details = passwordping.get_exposure_details(exposures.exposures[0])
puts("First exposure for was " + details.title)

Learn More

That should get you started. Check out the Github project page for more details.