Memecoin data in JavaScript
Updated
Plain fetch is all it takes. Keep the key on a server in production; the browser examples are for trying it out.
Key
curl
curl -X POST https://api.crypto2api.com/v1/keys
# {"key":"c2a_…", ...} keep it: the first 100 calls every day are freeA two-line client
JavaScript
const KEY = process.env.MEMECOIN_API_KEY;
const meme = async (path, init = {}) => {
const r = await fetch("https://api.crypto2api.com/v1/memecoin" + path, { ...init, headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json", ...init.headers } });
if (!r.ok) throw new Error((await r.json()).error?.message);
return (await r.json()).data;
};Launches, graduations, one coin
JavaScript
const { launches } = await meme("/launches?limit=10");
const { graduating } = await meme("/graduating");
const coin = await meme(`/token/${launches[0].mint}`);
console.log(coin);Stream
Node 22+ has WebSocket built in.
JavaScript
const ws = new WebSocket("wss://api.crypto2api.com/v1/memecoin/stream?key=" + KEY);
ws.onopen = () => ws.send(JSON.stringify({ subscribe: "launches" }));
ws.onmessage = (m) => console.log(JSON.parse(m.data));Endpoints in this guide
- New Launches GET /memecoin/launches
- About To Graduate GET /memecoin/graduating
- Coin Overview GET /memecoin/token/:mint
- Live Stream GET /memecoin/stream
Questions
- Does it work in the browser?
- Yes, CORS is open. Do not ship your key in public front-end code; call it from your server.
- Is there an OpenAPI spec?
- Yes, at /openapi.json on the API host, so you can generate a typed client.
More guides
- The pump.fun API, without running a node
- Get every new Solana token the moment it launches
- Check a memecoin for a rug pull from code
- Build a memecoin bot: watch, filter, quote, swap
All endpoints · Pricing · Compared with other APIs · Get a key