Tutorial overview
Efficiently fetch real-time prices for up to 10 tokens in a single API request using the DexPaprika multi-asset endpoint. This guide shows you why batching matters and how to implement it effectively.The multi-asset endpoint is optimized for efficiency. Learn why batching is critical for sustainable API usage and how to structure your requests.
Why Batch Requests? The Math Behind It
Single Request vs. Batching
Let’s say you need to monitor prices for 50 tokens on Ethereum. Scenario 1: Individual Requests (❌ Inefficient)Real-World Impact
| Use Case | Tokens to Monitor | Individual Requests | Batched Requests | Reduction | 
|---|---|---|---|---|
| Portfolio tracker | 20 tokens | 20 calls | 2 calls | 90% | 
| DeFi aggregator | 100 tokens | 100 calls | 10 calls | 90% | 
| Trading bot (30s updates) | 50 tokens/day | ~2,880 calls/day | ~288 calls/day | 90% | 
| Real-time dashboard | 35 tokens | 35 calls | 4 calls | 88.6% | 
The Key Insight: Using the multi-asset endpoint instead of individual token calls reduces your request count by up to 90%. This means you can monitor more tokens, update more frequently, and stay well within rate limits.
Understanding Rate Limits
The DexPaprika API is public with no formal limits currently enforced. Best practices like batching ensure sustainable usage as the service matures.
- ✅ Reduce server load — Fewer HTTP connections
- ✅ Improve latency — Single network round-trip for multiple tokens
- ✅ Future-proof your app — When rate limits are introduced, you’re already optimized
- ✅ Scale effortlessly — Monitor hundreds of tokens without performance degradation
Step 1: Understanding the Endpoint
The multi-asset pricing endpoint accepts:- Network (path parameter): e.g., ethereum,solana,base
- Tokens (query parameter): Comma-separated list of up to 10 token addresses
- Constraint: Maximum 10 tokens per request, 2000 character limit
Step 2: Simple Batch Request
Fetch prices for 3 tokens on Ethereum in a single request:Response
Duplicate input addresses may produce duplicate entries in the response. Dedupe client-side if required.
Step 3: Batching Larger Token Lists in Node.js
If you need to monitor more than 10 tokens, split them into chunks:Axios variant (Node.js)
Key Observation: 12 tokens require only 2 API calls instead of 12! This is an 83% reduction in network requests.
Step 4: Python Implementation with Real-Time Monitoring
Build a simple price monitor that updates every 30 seconds:Step 5: Error Handling & Edge Cases
Handling Invalid or Unpriced Tokens
Some tokens may not have prices. The endpoint returns only valid tokens:Edge-case requests
Best Practice: Always validate the response. Check that the number of returned tokens matches your expectations. Handle missing tokens gracefully in your application.
Step 6: Comparison: Single vs. Batch Requests
Request 100 tokens for a dashboard
❌ Without Batching:- 90% fewer requests ✅
- 10x faster execution (single network round-trip per batch vs. 100 individual calls) ✅
- Lower latency for your users ✅
- Future-proof against rate limits ✅
Performance Metrics
Benchmark: Fetching prices for 50 tokens on Ethereum| Metric | Single Requests | Batched (5 calls) | 
|---|---|---|
| API Calls | 50 | 5 | 
| Total Network Round-trips | 50 | 5 | 
| Estimated Time (assuming 100ms/call) | 5,000ms | 500ms | 
| Bandwidth Used | ~50KB | ~5KB | 
| Server Load | High | Low | 
Result: Batching achieves 10x faster responses while reducing server load and bandwidth by 90%.
Next Steps
API Reference
Explore the complete multi-asset endpoint documentation.
Fetch Single Token Prices
Learn how to fetch detailed data for individual tokens.
Best Practices Summary
- Always batch — Use the multi-asset endpoint instead of individual calls
- Chunk large lists — Split more than 10 tokens into multiple batches (max 10 per call)
- Validate responses — Not all requested tokens may have prices; handle missing data
- Cache results — Store prices and update on a schedule instead of on every request
- Handle errors gracefully — Network timeouts and invalid tokens are normal; retry with backoff
- Monitor performance — Track API call counts to measure your optimization improvements
Get Support
Join Discord
Connect with our community and get real-time support.
Give Feedback
Share your experience and help us improve.
FAQs
What's the maximum number of tokens per request?
What's the maximum number of tokens per request?
10 tokens per request. Requests with more than 10 tokens will return HTTP 400.
What about duplicate token addresses?
What about duplicate token addresses?
Duplicate inputs may yield duplicate entries in the response. Dedupe client-side if needed.
What happens if a token doesn't have a price?
What happens if a token doesn't have a price?
Tokens without prices are silently omitted from the response. Only priced tokens are returned.
Is the order of results guaranteed?
Is the order of results guaranteed?
No. The response order is not guaranteed to match your input order. Use the 
id field to identify each token.Can I batch requests from multiple networks?
Can I batch requests from multiple networks?
No. Each batch must be for a single network. Use separate calls for different networks.
How often should I update prices?
How often should I update prices?
It depends on your use case. For dashboards, every 30-60 seconds is common. For trading bots, every 1-5 seconds. Batching enables frequent updates without excessive API calls.
Do I still need individual token endpoint?
Do I still need individual token endpoint?
Yes. The single token endpoint (
GET /networks/{network}/tokens/{token_address}) provides detailed metadata like liquidity, volume, and holdings. Use it for deep analysis; use multi-asset for just prices.Can I pass 0 tokens?
Can I pass 0 tokens?
No. At least one valid token is required. The endpoint returns HTTP 400 if the tokens list is empty.