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

xdataapi

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

xdataapi

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

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

xdataapi

Typed TypeScript client for xdataapi.io, 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 xdataapi
import { xdataapi } from 'xdataapi';

const api = xdataapi({ apiKey: process.env.XDATAAPI_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://xdataapi.io/docs. API reference: https://xdataapi.io/reference.

Keywords

twitter

FAQs

Package last updated on 22 Sep 2026

Related posts