Building with Passport
Passport API v2
Overview

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:

  1. Creating a Passport Project/Scorer and API key
  2. Retrieve a user's Passport score and Stamp data using the GET /v2/stamps/{scorer_id}/score/{address} endpoint.
  3. Find the user's Unique Humanity Score or passing_score within the returned data.
  4. 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 actionEndpoint
Retrieve latest score for a single addressGET /v2/stamps/{scorer_id}/score/{address}
Retrieve historical score for a single addressGET /v2/stamps/{scorer_id}/score/{address}/history
Retrieve Stamps verified by a single addressGET /v2/stamps/{address}
Retrieve all Stamps available in PassportGET /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).

Next steps