X1.NinjaX1.Ninja
Developer API

Build your first X1 tool

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.

1. Activate a key

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.

2. Run a sample

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.

3. Check the response

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.

StatusNext step
401Check whether the key is active and copied correctly.
403Check endpoint access and your account’s plan.
429Wait for Retry-After before requesting again.
5xx or timeoutShow the last known result as stale and retry with a bounded backoff.

4. Embed a chart

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

Make it useful for the community

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