Introduction
The Deserialize API provides comprehensive endpoints for token swaps, market data, and account information on the 0G blockchain. Whether you're building a DEX, wallet, or trading interface, our API offers everything you need.
Getting Started
Base URL
https://evm-api.deserialize.xyz/:networkIdFollow these steps to integrate with our API:
1. Get Token Information
Use the token list endpoints to discover available tokens and their details.
2. Request a Quote
Get optimal swap routes and expected output amounts before executing trades.
3. Execute Swaps
Use the quote to execute transactions with your preferred slippage tolerance.
Quick Example
Here's a complete example showing how to swap native token for W0G:
1. Get Token Details
/tokenListWithDetails{
"result": [
{
"address": "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c",
"decimals": 18,
"symbol": "W0G",
"name": "Wrapped 0G"
}
]
}2. Get Swap Quote
/quote{
"tokenA": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenB": "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c",
"dexId": "ALL",
"amountIn": "1000000000000000000"
}3. Execute Swap
/swap{
"publicKey": "0xe0918C56A2C7a216644B6d890c80d164417A70E3",
"quote": { /* quote from step 2 */ },
"slippage": 1
}Available Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /quote | POST | Get swap quote with optimal routing |
| /swap | POST | Execute swap transaction |
| /tokenList | GET | Get list of available token addresses |
| /tokenListWithDetails | GET | Get tokens with full metadata |
| /tokenDetails/:address | GET | Get detailed token information |
| /tokenPrice/:address | GET | Get current token price in USD |
Key Concepts
Token Addresses
Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE to represent the native token (0G) in swap operations.
Amount Format
All amounts are specified in wei (the smallest unit). For example, 1 0G = 1000000000000000000 wei.
Slippage Tolerance
Specify slippage as a percentage (e.g., 1 = 1%). This protects against price movements during transaction confirmation.
DEX Support
Use "ALL" for dexId to automatically find the best route across all supported DEXs.
Need help? Contact support or visit our developer community.