$PRIVY is live -

Skip to content
Docs

Developers

Quickstart

Make your first public and authenticated Privy API requests.

This guide takes you from no setup to a working authenticated request. You need a terminal with curl; Node.js or Python is optional.

1. Call a public endpoint

Public endpoints need no key. Fetch the current price of USDC:

cURL
curl "https://privy.ac/api/v1/tokens/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

Every successful response wraps its payload in data and includes a requestId you can quote to support.

Response
{
  "data": {
    "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "name": "USD Coin",
    "symbol": "USDC",
    "decimals": 6,
    "usdPrice": 0.9998,
    "verified": true
  },
  "requestId": "req_8f3a2c91d4e6b07f"
}

2. Get a swap quote

Quote 0.01 SOL to USDC. Amounts are raw integers in the smallest unit, so 0.01 SOL is 10,000,000 lamports.

cURL
curl "https://privy.ac/api/v1/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=10000000"

3. Create an API key

Account endpoints need a key. Sign in with your wallet, then create one on the API keys page. The key is shown once; store it as an environment variable.

Shell
export PRIVY_API_KEY="pvy_live_..."

4. Make an authenticated request

curl "https://privy.ac/api/v1/me" \
  -H "X-API-Key: $PRIVY_API_KEY"

Next steps