Privy supports multiple ways to fetch and manage users in your application.

Privy rate limits REST API endpoints that you may call from your server. If you’re looking to get information about an authenticated user, consider using identity tokens as a more secure and efficient way to access user data.

Querying users by ID

Use the getUser method to get a single user by their Privy DID:

const user = await privy.getUser('did:privy:XXXXXX');

Querying for all users

Use the getUsers method to get a list of all your users:

const users = await privy.getUsers();

The getUsers method automatically handles pagination and includes built-in exponential backoff to manage rate limits.

Querying for users by account data