Skip to main content
Use the TypeScript SDK when you want typed request parameters, response models, retries, and autocomplete for TwexAPI REST workflows in Node.js, Bun, or server-side TypeScript.

Install

Source: twexapi-dev/x-api-scraper-typescript

Authenticate

Basic example

Search tweets and look up a profile:

Workflow: search tweets to JSON Lines

Paginate advanced search and write durable handoff rows:
Store tweet_id, next_cursor, and page_index so a worker can resume from the last saved cursor.

Workflow: post a tweet

Write actions need a Twitter cookie or auth_token on the request input:
Use --dry-run in the CLI first when testing write payloads.

Error handling

The client retries connection errors with exponential backoff by default. Override per request with a retries option.

Pi coding agent package

Install bundled TwexAPI Skills from npm:

References