Skip to main content

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
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

Request Format

  • GET endpoints use query parameters
  • POST endpoints accept JSON body with Content-Type: application/json

Response Format

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 AmountRaw Amount
1.01000000000000000000
0.5500000000000000000
100100000000000000000000
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

MethodEndpointDescription
GET/api/v1/quoteGet swap quote with optimal routing
POST/api/v1/swapGenerate Universal Router calldata
GET/api/v1/poolsList pools
GET/api/v1/tokensList tokens

Rate Limits

There are currently no rate limits. This may change in the future — please use reasonable request frequencies.