npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cookin-fun

v0.1.0

Published

Node.js SDK for the Cookin API — Pump.fun and Solana memecoin data (REST + WebSocket).

Downloads

127

Readme

cookin-fun

Node.js SDK for the Cookin API — real-time Pump.fun and Solana memecoin data. REST + WebSocket over the same pipeline that powers the cookin.fun UI. Quality scores, bundle detection, trader behavioral stats, live trade frames.

  • Free during beta. No credit card.
  • Docs: https://cookin.fun/api
  • Discord: https://cookin.fun/discord

Install

npm install cookin-fun

On Node 22+ this is the only dependency you need. On Node 18-21, also install ws:

npm install cookin-fun ws

Quickstart

Mint an API key at cookin.fun/account/api-keys and set it as COOKIN_API_KEY.

import { Cookin } from 'cookin-fun';

const cookin = new Cookin({ apiKey: process.env.COOKIN_API_KEY! });

// Full snapshot for one token
const { data } = await cookin.tokens.get('BgNrWZKAaZAa...');
console.log(data.score?.value, data.holders?.count);

That's it. Every endpoint returns a typed Envelope<T> with the same shape as the wire format: { data, meta }.

REST

Every REST method returns Promise<Envelope<T>>.

// Token feeds. All four return TokenCard[].
await cookin.tokens.new();          // recently deployed
await cookin.tokens.pumps();        // currently pumping
await cookin.tokens.graduated();    // recently on Raydium / PumpSwap
await cookin.tokens.survivors();    // 3-24h post deploy, still alive

// One token, one call. Filter to the field groups you actually need.
await cookin.tokens.get(mint, { fields: ['meta', 'market', 'score'] });

// Most recent trades for a token, enriched with per-trade trader context.
await cookin.tokens.trades(mint);

// Full behavioral profile for a wallet.
await cookin.traders.get(walletAddress);

WebSocket

Two channels, both multiplexed on one socket connection. Subscribe with .onTokens / .onFrames.

const socket = cookin.connect();

// Token lifecycle events: created, graduated, DEX-paid, metadata,
// duplication flags flipped.
socket.onTokens((event) => {
  if (event.type === 'token_created') {
    console.log('new token:', event.data.symbol, event.data.score);
  }
});

// Every enriched trade, ~1s off Solana block time. One message per
// {signature, mint} unit, so multi-hop swaps arrive grouped.
socket.onFrames((frame) => {
  for (const trade of frame.trades) {
    console.log(trade.signature, trade.user_address, trade.sol_amount);
  }
});

// When you're done
socket.close();

The SDK handles the Phoenix Channels v2 wire protocol (join, heartbeat, event dispatch) internally. Reconnect and back-pressure are left to callers on purpose so the SDK stays predictable. Wrap .connect() in your own reconnect loop when running long-lived processes.

Examples

Two runnable scripts in examples/:

  • lifecycle_events.ts — subscribes to tokens:live and prints one line per event type (token_created, token_metadata_retrieved, token_graduated, token_dex_paid, token_duplication_status_updated).
  • wallet_watcher.ts — streams frames:live filtered to a list of wallets.
COOKIN_API_KEY=sk_live_... npx tsx examples/lifecycle_events.ts

Errors

Non-2xx responses throw a typed CookinError:

import { CookinError } from 'cookin-fun';

try {
  await cookin.tokens.get(mint);
} catch (err) {
  if (err instanceof CookinError) {
    console.error(err.status, err.code, err.requestId);
  }
}

Every response carries a request_id in meta (and on errors, on the CookinError). Quote it when reporting issues.

Rate limits

60 requests per minute per key. X-RateLimit-* headers on every response. See Rate limits for details.

Full reference

Every endpoint, every field, every WebSocket event: cookin.fun/api.

Contributing

Bug reports and feature requests: Discord.

License

MIT