Docs

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

TierRate LimitSSE ConnPrefix
Pro300/min10bzr_pro_
Partner600/min20bzr_tier__
Enterprise1000/min50bzr_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.

ParameterTypeRequiredDescription
chainIdstringNoFilter 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.

ParameterTypeRequiredDescription
fromChainstringYesSource chain ID
toChainstringYesDestination chain ID
fromTokenstringYesSource token address
toTokenstringYesDestination token address
amountstringYesAmount in wei
userAddressstringYesUser wallet address
slippagestringNoDefault: "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": { ... }
}
CodeDescription
200Success
400Invalid request parameters
404Resource not found
410Resource expired
429Rate limit exceeded
500Server 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

VersionDateChanges
1.0.02026-01-10Initial release with SSE quotes, execute endpoint