Skip to main content
This guide walks you through your first Pro API calls from scratch. By the end, you’ll have fetched a live token price for WETH on Ethereum, explored its top liquidity pools, drilled into a specific pool’s swap transactions, run a batch price lookup, and searched across the platform — a complete pattern you can adapt to any token on any supported chain.

Prerequisites

Before you begin, make sure you have:
  • A DexUtils account with an active Premium plan or Pro API subscription
  • A Pro API key ready to use (see Authentication if you haven’t generated one yet)
  • curl available in your terminal, or your preferred HTTP client
1

Set your API key as an environment variable

Store your API key in an environment variable so you don’t have to paste it into every command. Run the following in your terminal — replace the placeholder with your actual key:
Set API Key
All subsequent curl commands in this guide reference $DEXUTILS_API_KEY automatically. For persistent storage across shell sessions, add this line to your ~/.bashrc, ~/.zshrc, or equivalent shell profile.
2

Fetch all supported networks

Start by listing every chain the Pro API supports. This call also confirms that your key is valid and your environment is configured correctly.
Fetch Networks
A successful response returns an array of network objects. You’ll use the id field (for example, "ethereum") to scope subsequent requests to a specific chain.
Response
If you receive a 401 or 403 error here, double-check that your key is set correctly and review the Authentication page.
3

List DEX protocols on a network

Before looking up pools, fetch the DEX protocols available on Ethereum. This lets you filter pools by DEX in the next step.
Fetch DEXes
The response lists each DEX with its identifier, which you can pass as a filter to pool queries:
Response
4

Look up a token by contract address

With a network ID in hand, fetch token data by passing the contract address in the URL path. This example uses WETH on Ethereum — a reliable token to test with because it always has deep liquidity and a current USD price.
Fetch Token
The response includes price, valuation metrics, and a summary of the token’s trading activity in the last 24 hours:
Response
Key fields to note:
5

List and filter liquidity pools

Fetch all pools on Ethereum that include WETH, sorted by liquidity. Pass the token address as a filter and cap the result with limit — useful when a popular token like WETH has thousands of pools.
Fetch Pools
The response returns a paginated list of pool objects. Each pool includes the paired token, DEX, and key liquidity metrics:
Response
Copy the pool id from the response — you’ll use it in the next two steps.
6

Get details for a specific pool

Use the pool address you retrieved above to fetch its full statistics, including reserve balances and fee data.
Fetch Pool Details
Response
7

Fetch swap transactions for the pool

Retrieve the most recent swap events for the WETH/USDC pool. Use the limit and page parameters to paginate through the full history.
Fetch Transactions
Each transaction record includes the swap direction, amounts, USD value, and the wallet that executed the trade:
Response
8

Batch look up multiple token prices

When you need prices for several tokens at once — for example, to update a portfolio dashboard — use the POST /tokens/batch endpoint instead of making one call per token.
Batch Token Lookup
The response returns a result for each requested token in the same order:
Response
9

Search for tokens, pools, and DEXes

Use the GET /search endpoint to find any resource by name, symbol, or contract address in one unified call. This is the fastest way to discover a contract address before making targeted lookups.
Search
The response groups results by type so you can see matching tokens, pools, and DEXes in a single response:
Response
10

Explore the full Endpoints Reference

You’ve now walked through every major resource in the API: networks, DEXes, tokens, pools, transactions, batch lookups, and search. The same patterns — discover, resolve, and drill down — apply across all supported chains.Head to the Endpoints Reference to explore the complete request and response schemas, all available query parameters, and pagination behaviour for each endpoint.

Next Steps

If any API call returns an unexpected error code, the Error Codes reference documents every possible response, what triggers it, and how to handle it in your application.
For large result sets, review the Pagination guide to understand how to use page, limit, and cursor-based navigation across all list endpoints.