JavaScript · Node.js 20+
Download markets.mjsnode markets.mjs
Start with a small market dashboard. Fetch five pools on your server, show their prices and liquidity, and link each pool to its market page.
Create an account, choose a plan and create a key in your key dashboard. The examples use the pools endpoint, available to the free tier and above. Save the key as the X1_API_KEY environment variable on your server.
Keep the key out of browser code, public repositories, screenshots and URLs. Each request uses the X-API-Key header.
node markets.mjs
python3 markets.py
Both examples print the response, check its structure and stop after eight seconds. No extra packages are required. Use a local environment file or your host’s secret manager to supply X1_API_KEY.
A successful request contains a pools array. An empty array is a valid response. Handle missing prices explicitly, show when you fetched the data, and cache it according to your plan’s limits.
| Status | Next step |
|---|---|
| 401 | Check whether the key is active and copied correctly. |
| 403 | Check endpoint access and your account’s plan. |
| 429 | Wait for Retry-After before requesting again. |
| 5xx or timeout | Show the last known result as stale and retry with a bounded backoff. |
Paste this into your site. The public embed needs no API key.
<iframe src="https://x1.ninja/embed/pair/CAJeVEoSm1QQZccnCqYu9cnNF7TTD2fcUA3E5HQoxRvR" title="XNT market chart" width="100%" height="500" loading="lazy" style="border:0"></iframe>Preview the embed
Add a curated project list, compare liquidity over time, or show the markets relevant to your community. Give every value a timestamp and a source link. Share a working demo and a short explanation of what it helps people do.
Explore the community guide