Pear API
Endpoint reference for the Pear Edge Trading API. All routes live under https://api.pear.trade.
Pear API Reference
This site is the endpoint reference for the Pear Edge Trading API. Every route exposed by pear/apps/api is documented here, auto-generated from the live OpenAPI spec at /openapi.json.
Base URLs
| Environment | URL |
|---|---|
| Production | https://api.pear.trade |
| Staging | https://api-staging.pear.trade |
| Local dev | http://localhost:3000 |
Authentication
Most endpoints require a Bearer token from Privy:
Authorization: Bearer <privy-access-token>For live POST /execute (trade placement) the token must be a wallet-auth JWT rather than the standard access token. Admin endpoints use X-Admin-Token. See each endpoint page for its exact security requirement.
Local development bypass
When the API is started with ALLOW_DEV_AUTH=true, you can skip the Privy round-trip by sending:
X-User-Id: did:privy:<your-test-user>This bypass is rejected in production regardless of the env flag.
Browse endpoints
Use the sidebar (grouped by tag — auth, events, markets, charts, social, portfolio, wallets, funding, rewards, comments, posts, notifications, etc.) to find the route you need. Each page shows the request schema, security requirement, response shapes, and an example.
Realtime
For live trades, prices, orderbooks, order lifecycle, and portfolio mark-to-market, see the WebSocket reference. One socket, multiple topics, no Redis hop.