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

@twitterapi_io/twitterapi

v0.1.0

Published

Official TypeScript SDK + CLI for twitterapi.io — Twitter/X data API. Search tweets, fetch profiles, followers, replies, trends, and more via a single API key. No OAuth, no Twitter Developer Account required.

Readme

@kaitoinfra/twitterapi

Official TypeScript SDK + CLI for twitterapi.io — Twitter/X data API. Search tweets, fetch user profiles, followers, replies, retweeters, trends. One API key, no OAuth, no Twitter Developer Account.

npm version MIT License

Install

npm install @kaitoinfra/twitterapi
# or
pnpm add @kaitoinfra/twitterapi
# or
yarn add @kaitoinfra/twitterapi

Get an API key

Sign up at twitterapi.io — free tier available.

Quick start (SDK)

import { TwitterApiClient } from "@kaitoinfra/twitterapi";

const client = new TwitterApiClient({ apiKey: process.env.TWITTERAPI_TOKEN! });

// User profile
const user = await client.getUserInfo({ userName: "elonmusk" });
console.log(user);

// Advanced search
const tweets = await client.searchTweets({
  query: "from:elonmusk has:images since:2026-01-01",
  queryType: "Latest",
});

// Pagination
let cursor: string | undefined;
do {
  const page = await client.getUserFollowers({ userName: "elonmusk", cursor });
  // ...process page...
  cursor = (page as any).next_cursor;
} while (cursor);

CLI

export TWITTERAPI_TOKEN=your_api_key

npx twitterapi user-info elonmusk
npx twitterapi search "from:elonmusk has:images" Latest
npx twitterapi trends 1 10  # 1 = Worldwide

npx twitterapi help

All output is JSON to stdout — pipe to jq for filtering:

npx twitterapi user-info elonmusk | jq '.data.followers'

API reference

12 read endpoints (v0.1.0):

| Method | Endpoint | |---|---| | searchTweets(params) | Advanced search (Twitter operators) | | getUserInfo(params) | Basic user profile | | getUserAbout(params) | Extended "about" page | | getUserFollowers(params) | Paginated followers | | getUserFollowings(params) | Paginated followings | | getUserLastTweets(params) | Recent tweets | | getUserMentions(params) | Tweets mentioning user | | getTweetsByIds(params) | Batch fetch (≤100) | | getTweetReplies(params) | Replies to a tweet | | getTweetQuotes(params) | Quote-tweets | | getTweetRetweeters(params) | Retweeters | | getTrends(params) | Trending topics by WOEID |

Need a write or stream endpoint not exposed here? Use the low-level escape hatch.

Low-level escape hatch

For any twitterapi.io endpoint not wrapped above:

const result = await client.get("/twitter/some/new/endpoint", { foo: "bar" });

The full REST API is documented at twitterapi.io/docs.

Error handling

Failed requests throw TwitterApiError:

import { TwitterApiClient, TwitterApiError } from "@kaitoinfra/twitterapi";

try {
  await client.getUserInfo({ userName: "nonexistent_user_xyz" });
} catch (e) {
  if (e instanceof TwitterApiError) {
    console.error(`API ${e.status}: ${e.message}`);
  }
}

Automatic retry on 429 / 5xx (up to 3 attempts, exponential backoff).

MCP server (alternative)

If you're building an AI agent (Claude.ai, Claude Code, Cursor), use the hosted MCP server instead:

URL: https://mcp.twitterapi.io/mcp
Install: claude mcp add --transport http --scope user twitterapi-mcp \
  https://mcp.twitterapi.io/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Or the stdio version: @kaitoinfra/twitterapi-io-mcp-server

License

MIT