Passport API v2
Please note:
Passport API v2 simplifies and adds key functionality that wasn't previously available with Passport API v1. Because of this, it is recommended for you to use Passport API v2 moving forward.
We have not announced any deprecation or retirement timelines for v1 yet, and plan to provide more details before the end of 2024.
You can learn more about the differences between v1 and v2 via our migration guide.
The Passport API serves as a powerful tool for developers, offering access to Passport's Stamp-based score metadata using REST endpoints.
Why use the API
The API offers a simple integration; one that requires just two requests to submit and request user Passport XYZ data. This data is retrieved from the centralized Passport XYZ servers, meaning it is the most up-to-date data available for Passport XYZ users.
Example flow
An excellent use case for Passport is to protect access to a reward or governance program. To make this happen, follow these steps:
- Creating a Passport Project/Scorer and API key
- Retrieve a user's Passport score and Stamp data using the GET /v2/stamps/{scorer_id}/score/{address} endpoint.
- Find the user's Unique Humanity Score or
passing_score
within the returned data. - Compare the Unique Humanity Score against a threshold that you set, or utilize the binary
passing_score
field that uses our recommended threshold of 20.
If a user was able to build up a score greater than this threshold, they've effectively proven their humanity and you can grant access to the protected program.
Available endpoints
Endpoint action | Endpoint |
---|---|
Retrieve latest score for a single address | GET /v2/stamps/{scorer_id}/score/{address} |
Retrieve historical score for a single address | GET /v2/stamps/{scorer_id}/score/{address}/history |
Retrieve Stamps verified by a single address | GET /v2/stamps/{address} |
Retrieve all Stamps available in Passport | GET /registry/stamp-metadata |
Learn more about each of these endpoints on our API Reference page, or experiment with them using our API playground (opens in a new tab) (requires API key and Scorer/Project).