API Overview
QsnDEX exposes a comprehensive REST API that powers all frontend interactions and is available for third-party integrations.
Base URLs
| Environment | URL |
|---|---|
| Production | https://api.qsndex.xyz |
| Local Development | http://localhost:8080 |
Interactive Documentation
Swagger UI is available for exploring and testing all endpoints:
- Production: https://api.qsndex.xyz/swagger-ui/
- Local: http://localhost:8080/swagger-ui/
Response Format
All API responses are returned as JSON. A typical successful response follows this structure:
{
"success": true,
"data": { ... }
}
Error responses include a descriptive message:
{
"success": false,
"error": "Description of the error"
}
Chain Selection
QsnDEX supports multiple chains. Specify the target chain using the chain_id query parameter:
| Chain | Chain ID |
|---|---|
| Taiko | 167000 |
| Arbitrum | 42161 |
Example:
GET /api/tokens?chain_id=167000
If chain_id is omitted, the API defaults to the primary supported chain.
Rate Limiting
Rate limiting is enforced per-endpoint using Redis. Limits vary by resource intensity:
| Endpoint Group | Rate Limit |
|---|---|
| AI Chat / Analysis | 10 requests per hour |
| Autopilot | 5 requests per hour |
| Safety (Anti-Rug Shield) | 20 requests per hour |
| General endpoints | No strict limit (fair use) |
Exceeding the rate limit returns HTTP 429 with a Retry-After header.
Endpoint Groups
The API provides 50+ endpoints organized into the following groups:
| Group | Prefix | Description |
|---|---|---|
| Tokens | /api/tokens, /api/prices | Token listings, search, details, price data, OHLC history |
| Pools | /api/pools, /api/il | Liquidity pool listings, details, charts, LP positions, IL simulation |
| Swap | /api/swap | Swap quotes, optimal multi-hop routing |
| Portfolio | /api/portfolio, /api/history | Wallet portfolio aggregation, swap history |
| AI Endpoints | /api/ai, /api/safety, /api/entry-signal, /api/autopilot | AI chat, token/pool analysis, anti-rug checks, entry signals, autopilot |
| Staking | /api/staking | QSN staking info, staking pools, user positions |
| Launchpad | /api/launchpad | Token sales, contributions |
| Alerts | /api/alerts | Price alert creation and management |
| Orders | /api/orders | Limit order placement and tracking |
| Batch | /api/batch | Batched multi-call requests |