API Overview
The Kroko DEX provides a REST API for swap routing, price quotes, pool data, and token information. The API handles complex routing logic off-chain and returns ready-to-use transaction calldata.
Base URL
https://krokoswap.io/swap-api
https://testnet.krokoswap.io/swap-api
All endpoints below are relative to the base URL above.
Authentication
No authentication is required. The API is currently publicly accessible.
Authentication may be introduced in the future. If you are building a long-lived integration, check back here periodically for updates.
Common Patterns
GET endpoints use query parameters
POST endpoints accept JSON body with Content-Type: application/json
Successful responses return JSON directly. Error responses follow this format:
{
"error": "Human-readable error message"
}
Token Amounts
All token amounts are in raw units (wei). For a token with 18 decimals:
| Human Amount | Raw Amount |
|---|
| 1.0 | 1000000000000000000 |
| 0.5 | 500000000000000000 |
| 100 | 100000000000000000000 |
Convert with: rawAmount = humanAmount × 10^decimals
Token Addresses
Always use checksummed or lowercase ERC-20 addresses. For native KAS, use the WKAS address (not the zero address).
Endpoints
| Method | Endpoint | Description |
|---|
GET | /api/v1/quote | Get swap quote with optimal routing |
POST | /api/v1/swap | Generate Universal Router calldata |
GET | /api/v1/pools | List pools |
GET | /api/v1/tokens | List tokens |
Rate Limits
There are currently no rate limits. This may change in the future — please use reasonable request frequencies.