New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

tweetapi-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tweetapi-sdk

TypeScript client for the tweetapi.dev API: read-only X (Twitter) profiles, tweets, threads, search.

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
466
Maintainers
1
Weekly downloads
 
Created
Source

tweetapi-sdk

Typed TypeScript client for tweetapi.dev, the read-only X (Twitter) data API. Generated from the API's OpenAPI document, so every endpoint, parameter and response type is here.

npm install tweetapi-sdk
import { tweetapi } from 'tweetapi-sdk';

const api = tweetapi({ apiKey: process.env.TWEETAPI_KEY! });

const { data: profile } = await api.getUser({ path: { handle: 'x' } });
console.log(profile?.data?.followers, profile?.credits_charged);

const { data: page } = await api.searchTweets({ query: { q: 'from:x since:2026-09-01', count: 20 } });
for (const t of page?.data ?? []) console.log(t.id, t.text);

const { data: many } = await api.getUsers({ body: { handles: ['x', 'github', 'vercel'] } });
console.log(many?.items, many?.errors);

Every call returns { data, error, response }. On a non-2xx status data is undefined and error holds the API error with its code (no_credits, not_found, rate_limited, ...). Works in Node 18+, Bun, Deno, browsers and edge runtimes; it uses fetch.

Methods: getMe, listPacks, createCheckout, getUser, getUsers, getUserTweets, getFollowers, getFollowing, searchTweets, getTweet, getTweets, getThread, getReplies, getQuotes, getRetweeters. Pagination: pass next_cursor from a page back as query.cursor.

Docs: https://tweetapi.dev/docs. API reference: https://tweetapi.dev/reference.

Keywords

twitter

FAQs

Package last updated on 20 Sep 2026

Related posts