---
title: "X/Twitter SDKs & CLI"
description: "Install TwexAPI SDKs and CLI tools for tweet search, follower exports, MCP handoff, and public X data reads."
---

Official TwexAPI SDKs wrap the REST API with generated request types, response models, retries, pagination helpers, and consistent Bearer authentication. Use this page to choose the right SDK, CLI, or MCP handoff for tweet search, follower scraping, and agent workflows.

:::info
  Public docs focus on API-key reads. Read-only calls need only the TwexAPI API key.
:::

<CardGroup cols={2}>
  <Card title="TypeScript / Node.js" icon="braces" href="/sdks/typescript">
    Use typed REST calls for Node.js, Bun, Next.js route handlers, and tweet search.
  </Card>

  <Card title="Python" icon="bot" href="/sdks/python">
    Build sync or async jobs for tweet search, follower exports, and scheduled REST automation.
  </Card>

  <Card title="Go" icon="terminal" href="/sdks/go">
    Add tweet search and follower workers to Go services with context-aware calls.
  </Card>

  <Card title="Java" icon="coffee" href="/sdks/java">
    Use Maven or Gradle to add the Java SDK to Spring, worker, and JVM backend applications.
  </Card>

  <Card title="Kotlin" icon="blocks" href="/sdks/kotlin">
    Use idiomatic Kotlin types, nullable values, and suspend-friendly client methods.
  </Card>

  <Card title="C# / .NET" icon="hash" href="/sdks/csharp">
    Install from NuGet for .NET services and worker applications.
  </Card>

  <Card title="Ruby" icon="gem" href="/sdks/ruby">
    Use the Ruby gem with typed request objects, retries, and connection pooling.
  </Card>

  <Card title="PHP" icon="file-code" href="/sdks/php">
    Add the Composer package to PHP 8.1+ applications with named parameters and typed exceptions.
  </Card>

  <Card title="CLI" icon="square-terminal" href="/sdks/cli">
    Run terminal workflows for tweet search, JSON output, and scripted API calls.
  </Card>

  <Card title="Terraform provider" icon="boxes" href="/sdks/terraform">
    Use data sources for profile and tweet reads with an API key.
  </Card>
</CardGroup>

## Choose an SDK

<CardGroup cols={2}>
  <Card title="TypeScript / Node.js" icon="braces">
    Install with `npm install @twexapi-dev/x-api-scraper`; source:
    [twexapi-dev/x-api-scraper-typescript](https://github.com/twexapi-dev/x-api-scraper-typescript).
    Open the [TypeScript SDK guide](/sdks/typescript).
  </Card>

  <Card title="Python" icon="bot">
    Install with `pip install x_api_scraper`; source:
    [twexapi-dev/x-api-scraper-python](https://github.com/twexapi-dev/x-api-scraper-python).
    Open the [Python SDK guide](/sdks/python).
  </Card>

  <Card title="Go" icon="terminal">
    Install with `go get github.com/twexapi-dev/x-api-scraper-go`; source:
    [twexapi-dev/x-api-scraper-go](https://github.com/twexapi-dev/x-api-scraper-go).
    Open the [Go SDK guide](/sdks/go).
  </Card>

  <Card title="Java" icon="coffee">
    Maven Central publication is pending. Build from source at
    [twexapi-dev/x-api-scraper-java](https://github.com/twexapi-dev/x-api-scraper-java).
    Open the [Java SDK guide](/sdks/java).
  </Card>

  <Card title="Kotlin" icon="blocks">
    Maven Central publication is pending. Build from source at
    [twexapi-dev/x-api-scraper-kotlin](https://github.com/twexapi-dev/x-api-scraper-kotlin).
    Open the [Kotlin SDK guide](/sdks/kotlin).
  </Card>

  <Card title="C# / .NET" icon="hash">
    Install with `dotnet add package XapiScraper`; source:
    [twexapi-dev/x-api-scraper-csharp](https://github.com/twexapi-dev/x-api-scraper-csharp).
    Open the [C# SDK guide](/sdks/csharp).
  </Card>

  <Card title="Ruby" icon="gem">
    Install with `gem "x_api_scraper"`; source:
    [twexapi-dev/x-api-scraper-ruby](https://github.com/twexapi-dev/x-api-scraper-ruby).
    Open the [Ruby SDK guide](/sdks/ruby).
  </Card>

  <Card title="PHP" icon="file-code">
    Install with `composer require twexapi/x-api-scraper`; source:
    [twexapi-dev/x-api-scraper-php](https://github.com/twexapi-dev/x-api-scraper-php).
    Open the [PHP SDK guide](/sdks/php).
  </Card>

  <Card title="CLI" icon="square-terminal">
    Install with
    `npm install -g @twexapi-dev/x-api-scraper-cli`; source:
    [twexapi-dev/x-api-scraper-cli](https://github.com/twexapi-dev/x-api-scraper-cli).
    Open the [CLI guide](/sdks/cli).
  </Card>

  <Card title="Terraform provider" icon="boxes">
    Install `twexapi-dev/x-api-scraper` from the Terraform Registry when published.
    Open the [Terraform guide](/sdks/terraform).
  </Card>
</CardGroup>

## Choose by job

<CardGroup cols={2}>
  <Card title="Tweet search exports" icon="search">
    Start with [TypeScript](/sdks/typescript), [Python](/sdks/python),
    [Go](/sdks/go), or [CLI](/sdks/cli) plus
    [Advanced Twitter Search](/api-reference/search-endpoints/get-data-page-twitter-advanced-search-page-post). Hand off
    tweet rows, `has_next_page`, `next_cursor`, and JSON Lines files for downstream CSV or XLSX.
  </Card>

  <Card title="Follower & following lists" icon="users">
    Start with [TypeScript](/sdks/typescript), [Python](/sdks/python), [Go](/sdks/go), or
    [CLI](/sdks/cli). Call v3 follower and following endpoints, paginate with cursors, and store
    `username`, `user_id`, and `next_cursor` for resumable exports.
  </Card>

  <Card title="Global trending tweets" icon="radio">
    Start with [Get Global Trending Tweets](/api-reference/trending-endpoints/get-global-trending-tweets-api-twitter-global-trending-tweets-get)
    through [TypeScript](/sdks/typescript), [Python](/sdks/python), or [CLI](/sdks/cli).
    Filter by country, topic, and content tag.
  </Card>

  <Card title="Agent handoff" icon="bot">
    Use the [MCP Server](/mcp/overview) for tool calls, or SDKs for direct
    code. Return JSON objects with the endpoint path, request parameters, result
    fields, pagination cursor, and credit balance.
  </Card>
</CardGroup>

## Authentication

All SDKs accept the same API credentials as the REST API:

```bash
export X_API_SCRAPER_KEY="YOUR_API_KEY"
```

Bearer tokens are supported where the generated SDK exposes `bearerAuth` or `bearer_auth`. See [Authentication](/authentication) for REST header details.

## Common workflows

* Search tweets through [Advanced Twitter Search](/api-reference/search-endpoints/get-data-page-twitter-advanced-search-page-post). Keep JSON Lines or language-specific export files as the downstream handoff.
* Inspect threads through [Get Tweet Thread by ID](/api-reference/tweets-endpoints/tweet-thread-by-id-twitter-tweets-thread-by-id-post) and reply pages.
* Look up profiles and relationships through [Get Twitter User About](/api-reference/twitter-user-about-endpoints/get-twitter-user-about-by-screen-name-api-twitter-screen-name-about-get), [Get Followers (v3)](/api-reference/followers-following-endpoints/followers-v3-api-v3-twitter-users-followers-post), and [Get Following (v3)](/api-reference/followers-following-endpoints/following-v3-api-v3-twitter-users-following-post).
* Connect agents through the [MCP Server](/mcp/overview) when you need tool use instead of direct SDK calls.

## Error handling & pagination

Generated SDKs map HTTP errors into language-native exception or error types. Check each language page for idiomatic handling patterns.

Paginated endpoints return a page object with a next-page marker such as `has_next_page`, `hasNextPage`, or `HasNextPage` depending on language casing. Use the SDK's generated pagination helpers when available, or pass the cursor fields documented on each endpoint.

See [Error Handling](/guides/error-handling) and [Rate Limits](/guides/rate-limits) for retry and backoff patterns.
