Getting Started

Getting Started

The PirateCrew Blockchain API is one HTTP surface for every on-chain action across the ecosystem — pool creation, fee claiming, airdrops, staking, NFT mints, gold locking, swaps, token creation, and direct transaction submission.

Everything ships under /v2. Production host: https://api.piratecrew.fun.

What you can do

ResourcePathUse case
Pools/v2/poolsCreate + list + read DBC and DAMM v2 pools (one polymorphic type)
Fee claims/v2/pools/{address}/fee-claimsClaim DBC + DAMM v2, withdraw surplus, atomic split — one route, kind discriminator
Airdrops/v2/airdropsInit, list, read; claim and admin-withdraw sub-routes
Merkle trees/v2/merkle-treesFirst-class trees + /proofs/{wallet} lookup
Stakes/v2/stakesPOST to stake, DELETE /v2/stakes/{asset} to unstake
NFTs/v2/nftsMint via POST, burn via DELETE /v2/nfts/{asset}
Gold locks/v2/gold-locksLock via POST, unlock via DELETE /v2/gold-locks/{user}
Tokens/v2/tokensSPL + Metaplex metadata in one tx; read + revoke-authority
Transactions/v2/transactionsSubmit, simulate; GET /v2/transactions/{signature} for status
Swaps/v2/swaps + /v2/swap-quotesJupiter quote + swap
PDAs/v2/pdas/{kind}Each PDA kind is its own typed sub-resource
Accounts/v2/accountsRaw account read, batch read
Webhook subscriptions/v2/webhook-subscriptionsCRUD for subscriptions
Webhook event types/v2/webhook-event-typesCatalog of every event we can fire

The full schema for every endpoint is in /v2/openapi.json — explore it interactively at /v2/docs.

1. Get an API key

Head to developer.piratecrew.fun, sign in with Google, and click Generate Key. The full key is shown once — copy it before closing the dialog. Each key has its own per-minute / per-day rate limits and an optional list of scopes gating server-signing endpoints.

2. Confirm the service is live

curl https://api.piratecrew.fun/v2/health
{
  "data": {
    "status": "healthy",
    "service": "PirateCrew Blockchain API",
    "version": "v2"
  },
  "meta": {
    "request_id": "req_01HXYZABC123",
    "timestamp": "2026-05-18T19:42:11.000Z"
  }
}

Notice the { data, meta } envelope — every response uses it. meta.request_id is the value to give support when reporting an issue.

3. Your first authenticated call

Derive a Pirates-program PDA — pure compute, no chain query, no signing. PDAs are typed sub-resources:

curl -X POST https://api.piratecrew.fun/v2/pdas/platform \
  -H "Authorization: Bearer $PIRATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform_id": "pirate-crew" }'
{
  "data": {
    "address": "8mP3…",
    "bump": 254,
    "kind": "platform"
  },
  "meta": { "request_id": "req_01HXYZABC456" }
}

4. Read on-chain state

GET /v2/pools/{address} is polymorphic — the same route returns either a DBC or DAMM v2 pool, with a type discriminator telling you which:

curl https://api.piratecrew.fun/v2/pools/$POOL_ADDRESS \
  -H "Authorization: Bearer $PIRATE_API_KEY"
{
  "data": {
    "address": "POOL…",
    "type": "dbc",
    "status": "live",
    "base_mint": "…",
    "quote_mint": "…",
    "migration_progress_bps": 4321,
    "partner_fees_quote": "12345678",
    "partner_fees_base": "0"
  },
  "meta": { "request_id": "req_01HXYZABC789" }
}

status: "live" is the lifecycle field — every long-lived resource carries one. See Resource lifecycles for the full state machines and the webhook events that fire on each transition.

5. Build a transaction

Every write endpoint takes a mode field: unsigned (default) returns a base64 VersionedTransaction your client signs and submits; signed has the server sign + broadcast via Privy (requires a scope on the key).

Claim partner fees and atomically split them to multiple recipients via the unified fee-claim route with a kind discriminator:

curl -X POST https://api.piratecrew.fun/v2/pools/$POOL_ADDRESS/fee-claims \
  -H "Authorization: Bearer $PIRATE_API_KEY" \
  -H "Idempotency-Key: 5f3e2c8a-…" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "split",
    "payer": "YOUR_WALLET_PUBKEY",
    "splits": [
      { "recipient": "CREATOR_PUBKEY", "bps": 5000 },
      { "recipient": "KOL_PUBKEY",     "bps": 3000 },
      { "recipient": "TREASURY_PUBKEY","bps": 2000 }
    ],
    "mode": "unsigned",
    "metadata": { "invoice_id": "inv_42" }
  }'

Response shape (mode=unsigned):

{
  "data": {
    "mode": "unsigned",
    "transaction": "AQABAo...",
    "required_signers": [],
    "estimated_quote": "1234567"
  },
  "meta": {
    "request_id": "req_01HXYZABCABC",
    "metadata": { "invoice_id": "inv_42" }
  }
}

Sign the transaction with your wallet keypair, then submit it via the unified transactions resource:

curl -X POST https://api.piratecrew.fun/v2/transactions \
  -H "Authorization: Bearer $PIRATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "transaction": "<base64 signed tx>" }'

Poll status by signature:

curl https://api.piratecrew.fun/v2/transactions/$SIGNATURE \
  -H "Authorization: Bearer $PIRATE_API_KEY"

6. Where to go next

  • Transaction Modes — when to use unsigned vs signed, and which endpoints support which.
  • Resource lifecycles — the explicit state machine for every long-lived resource.
  • Pagination & limits — cursor-based pagination for every list endpoint.
  • Webhooks — subscribe to lifecycle transitions instead of polling.
  • Errors & Retries — the error envelope, status codes, retry policy.
  • Authentication — Bearer auth, rate limits, scopes, idempotency.
  • SDK Quickstart — same API, one-line install, no manual signing.
  • Endpoint reference — open /v2/docs for the live Swagger UI.