Skip to main content

Making Your First API Call

Ready to get started? Here’s a simple example of fetching swap quotes:
This request will return quotes from all available protocols for swapping 1 BTC to USDC on Ethereum.

Common API Endpoints

Here’s a quick reference of the most commonly used endpoints:

Common Parameters

These parameters are used across multiple endpoints:

Response Time Expectations

Understanding typical response times helps you build better user experiences:

Best Practices

Follow these best practices to build robust integrations:
  1. Always validate quote_id before requesting deposit generation
  2. Poll status endpoint every 10-30 seconds, not more frequently
  3. Cache assets list for at least 20 seconds to reduce API calls
  4. Use streaming quotes for better UX with real-time updates
  5. Handle partial quote failures gracefully - some protocols may fail while others succeed
  6. Implement exponential backoff for failed requests
  7. Save transaction hashes immediately after broadcast
  8. Monitor trace IDs for debugging production issues
  9. Set reasonable slippage (1.5-3% for most swaps)
  10. Validate addresses before submitting to quote endpoint

Protocol Support by Ecosystem

Different protocols support different blockchain ecosystems:

Error Code Categories

Understanding error codes helps with debugging:
  • 400-level: Client errors (validation, parameters, quotes)
  • 403: Authentication failures
  • 404: Resources not found (quotes, traces)
  • 500-level: Server errors (internal, external API failures)

Next Steps

Now that you understand the basics, explore the detailed endpoint documentation to learn about:
  • Fetching and comparing swap quotes
  • Generating unsigned transactions
  • Tracking swap status
  • Managing multi-chain assets and balances