How is API integration?
Get your Soroswap API integration running in under 5 minutes. This guide is for developers who want to integrate quickly.
📚 Documentation Hierarchy
Choose your path:
🐶 New to blockchain/Stellar? → Start with
beginner-guide.md🎮 Want to see it working? → Try
beginner-example.html⚡ Experienced developer? → Continue with this Quick Start
📖 Full API reference? → See api.soroswap.finance/docs
Prerequisites
JavaScript/TypeScript experience
Wallet integration knowledge (Freighter/StellarWalletsKit)
API integration experience
3-5 minutes of your time
🚀 Step 1: Get Your API Key (1 minute)
Generate API key (starts with
sk_)Copy and store securely
⚠️ Authentication Format
🔧 Step 2: Environment Setup (2 minutes)
Quick Testnet Setup
💱 Step 3: Core Integration (2 minutes)
Essential API Flow
4-step process: Quote → Build → Sign → Send
Working Examples
📂 Complete examples available:
beginner-example.html- Full interactive tutorial with Freighter integrationindex.html- Minimal working example
📤 Advanced Options
Gasless Transactions
Custom Transaction Submission
Request Parameters
Quote Request
Build Request
Send Request
❓ Common Issues & Solutions
"403 Forbidden" errors
API key starts with
sk_Using
Authorization: Bearer <key>headerUsing correct base URL (staging vs production)
API key hasn't been revoked
"Insufficient liquidity"
Reduce trade amount
Check if pool exists at app.soroswap.finance
Try different token pairs
Network mismatch
Expected Response Times
/quote: 1-3 seconds/build: 2-5 seconds/send: 3-10 seconds
🚨 Production Considerations
Security
Never expose API keys in frontend code for production
Use environment variables for sensitive data
Implement proper error handling and retry logic
Performance
Add request timeouts (30s recommended)
Implement exponential backoff for retries
Cache quotes for better UX (but respect freshness)
Monitoring
Track transaction success rates
Monitor API response times
Log error patterns for debugging
🎯 Next Steps
Explore full API: api.soroswap.finance/docs
Add error handling: Implement retry logic and user feedback
Production optimization: Proper state management and caching
Multi-token support: Beyond just XLM→USDC swaps
📚 Additional Resources
🔗 API Documentation: api.soroswap.finance/docs
🌍 Stellar Expert (Testnet): https://stellar.expert/explorer/testnet
🏦 Soroswap Interface: https://app.soroswap.finance
💬 Discord Support: https://discord.gg/soroswap
🎉 Ready to build? You now have everything needed for a production-ready Soroswap integration!
Last updated