Bazaar API Documentation
Meta-DEX Aggregator API for cross-chain swap quotes and execution.
Base URL https://bazaar-web.onrender.com
Authentication
Protected endpoints require an API key in the X-API-Key header.
bash
curl -H "X-API-Key: bzr_tier__your_key_here" \ https://bazaar-web.onrender.com/events/market?...
API Key Tiers
| Tier | Rate Limit | SSE Conn | Prefix |
|---|---|---|---|
| Pro | 300/min | 10 | bzr_pro_ |
| Partner | 600/min | 20 | bzr_tier__ |
| Enterprise | 1000/min | 50 | bzr_enterprise_ |
For now, API keys are distributed upon request.
Rate Limiting
Rate limits are enforced per API key (or per IP for unauthenticated requests).
Response Headers
http
X-RateLimit-Limit: 600 X-RateLimit-Remaining: 599 X-RateLimit-Reset: 1704931200
Exceeded Limit Response
json
{
"error": "Too many requests",
"retryAfter": 30
}Endpoints
Health Check
GET /health
Returns service health status.
json
{
"status": "healthy",
"timestamp": "2026-01-10T19:23:26.377Z"
}List Chains
GET /chains
Returns all supported blockchain networks.
json
{
"chains": [
{
"chainId": "1",
"chainName": "Ethereum",
"chainType": "evm",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
}
}
]
}List Tokens
GET /tokens
Returns supported tokens, optionally filtered by chain.
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainId | string | No | Filter tokens by chain ID |
json
{
"tokens": [
{
"chainId": "1",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"logoURI": "https://..."
}
]
}Get Quotes (SSE)
GET /events/market
Stream real-time swap quotes from multiple aggregators.
| Parameter | Type | Required | Description |
|---|---|---|---|
| fromChain | string | Yes | Source chain ID |
| toChain | string | Yes | Destination chain ID |
| fromToken | string | Yes | Source token address |
| toToken | string | Yes | Destination token address |
| amount | string | Yes | Amount in wei |
| userAddress | string | Yes | User wallet address |
| slippage | string | No | Default: "1" |
bash
curl -N -H "X-API-Key: bzr_tier__xxx" \ "https://bazaar-web.onrender.com/events/market?\ fromChain=1&\ toChain=42161&\ fromToken=0xA0b...&\ toToken=0xFd0...&\ amount=1000000000&\ userAddress=0xd8d..."
Event Data Model
json
{
"quoteId": "abc123",
"merchantName": "SquidRouter",
"inAmountUSD": 1000.00,
"outAmountUSD": 998.50,
"tollCostUSD": 2.50,
"estimatedArrivalSeconds": 120,
"tx": {
"to": "0x...",
"data": "0x...",
"value": "0"
}
}Execute Swap
POST /execute
Retrieves transaction data for executing a previously quoted swap.
json
// Request
{
"quoteId": "abc123"
}
// Response
{
"txData": {
"to": "0x...",
"data": "0x...",
"value": "0"
}
}Error Handling
json
{
"error": "Invalid parameters",
"details": { ... }
}| Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid request parameters |
| 404 | Resource not found |
| 410 | Resource expired |
| 429 | Rate limit exceeded |
| 500 | Server error |
Security
All responses include strict security headers:
http
X-Content-Type-Options: nosniff X-Frame-Options: DENY X-XSS-Protection: 1; mode=block Strict-Transport-Security: max-age=31536000; includeSubDomains
Code Examples
TypeScript / Node.js
typescript
const API_KEY = 'bzr_tier__your_key';
const BASE_URL = 'https://bazaar-web.onrender.com';
const params = new URLSearchParams({
fromChain: '1',
toChain: '42161',
fromToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
toToken: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
amount: '1000000000',
userAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
});
const eventSource = new EventSource(
`${BASE_URL}/events/market?${params}`,
{ headers: { 'X-API-Key': API_KEY } }
);
eventSource.addEventListener('quote', (event) => {
const quote = JSON.parse(event.data);
console.log('Received quote:', quote.merchantName, quote.outAmount);
});Python
python
import requests
import sseclient
API_KEY = 'bzr_tier__your_key'
BASE_URL = 'https://bazaar-web.onrender.com'
headers = {'X-API-Key': API_KEY}
# Stream quotes
response = requests.get(
f'{BASE_URL}/events/market',
params={...},
headers=headers,
stream=True
)
client = sseclient.SSEClient(response)
for event in client.events():
if event.event == 'quote':
print(f'Quote: {event.data}')Changelog
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-01-10 | Initial release with SSE quotes, execute endpoint |