> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XDKs

> Official client libraries for the X API v2 in Python, TypeScript, Java, and C#.

The X Developer Kits (XDKs) are X's client libraries for the X API v2, generated from the [X API OpenAPI spec](https://api.x.com/2/openapi.json).

> [card] [Python](https://docs.x.com/xdks/python/overview.md)
>
> `pip install xdk` · Python 3.8+

> [card] [TypeScript](https://docs.x.com/xdks/typescript/overview.md)
>
> `npm install @xdevplatform/xdk` · Node.js 18+

> [card] [Java](https://docs.x.com/xdks/java/overview.md)
>
> `com.x:xdk` · Java 17+

> [card] [C# / .NET](https://docs.x.com/xdks/csharp/overview.md)
>
> `dotnet add package XDevPlatform.Xdk` · .NET 8+

***

## Packages

| Language | Package | Runtime | Registry | Repository |
| :- | :- | :- | :- | :- |
| **Python** | `xdk` | Python 3.8+ | [PyPI](https://pypi.org/project/xdk/) | [xdk-python](https://github.com/xdevplatform/xdk-python) |
| **TypeScript / JS** | `@xdevplatform/xdk` | Node.js 18+ | [npm](https://www.npmjs.com/package/@xdevplatform/xdk) | [xdk-typescript](https://github.com/xdevplatform/xdk-typescript) |
| **Java** | `com.x:xdk:0.1.2` | Java 17+ | [Maven Central](https://central.sonatype.com/artifact/com.x/xdk) | [xdk-java](https://github.com/xdevplatform/xdk-java) |
| **C# / .NET** | `XDevPlatform.Xdk` | .NET 8.0+ | [NuGet](https://www.nuget.org/packages/XDevPlatform.Xdk) | [xdk-csharp](https://github.com/xdevplatform/xdk-csharp) |

***

## Quickstart

Look up `@XDevelopers` with a Bearer Token:

> [tab] Python
>
> ```bash theme={null}
> pip install xdk
> ```
>
> ```python theme={null}
> import os
> from xdk import Client
>
> client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
> response = client.users.get_by_username(
>     username="XDevelopers",
>     user_fields=["created_at", "public_metrics"],
> )
> print(response.data)
> ```

> [tab] TypeScript
>
> ```bash theme={null}
> npm install @xdevplatform/xdk
> ```
>
> ```typescript theme={null}
> import { Client } from "@xdevplatform/xdk";
>
> const client = new Client({ bearerToken: process.env.X_BEARER_TOKEN });
> const response = await client.users.getByUsername("XDevelopers", {
>   userFields: ["created_at", "public_metrics"],
> });
> console.log(response.data);
> ```

> [tab] Java
>
> ```xml theme={null}
> <dependency>
>   <groupId>com.x</groupId>
>   <artifactId>xdk</artifactId>
>   <version>0.1.2</version>
> </dependency>
> ```
>
> ```java theme={null}
> import com.x.xdk.XClient;
> import com.x.xdk.clients.UsersClient;
> import java.util.List;
>
> XClient client = XClient.builder()
>     .bearerToken(System.getenv("X_BEARER_TOKEN"))
>     .build();
>
> var response = client.users().getByUsername(
>     "XDevelopers",
>     UsersClient.GetByUsernameOptions.builder()
>         .userFields(List.of("created_at", "public_metrics"))
> );
> System.out.println(response.getData());
> ```

> [tab] C#
>
> ```bash theme={null}
> dotnet add package XDevPlatform.Xdk
> ```
>
> ```csharp theme={null}
> using System;
> using System.Collections.Generic;
> using Xdk;
> using Xdk.Clients;
>
> using var client = new XClient(new XClientOptions
> {
>     BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
> });
>
> var response = await client.Users.GetByUsernameAsync(
>     "XDevelopers",
>     new UsersClient.GetByUsernameOptions
>     {
>         UserFields = new List<string> { "created_at", "public_metrics" },
>     });
> Console.WriteLine(response.Data);
> ```

***

## What's included

* **Typed clients** — One sub-client per X API v2 resource (`posts`, `users`, `stream`, `direct_messages`, `spaces`, `lists`, `media`, `webhooks`, `chat`, and more).
* **Authentication** — Bearer Token, OAuth 2.0 with PKCE and token refresh, and OAuth 1.0a.
* **Pagination** — Cursor handling via Python generators, TypeScript `Paginator`, Java `Paginator<T>`, and C# `IAsyncEnumerable<T>`.
* **Streaming** — Live event streams for Filtered Stream, Sample Streams, Firehose, Compliance, and Activity.

> [!TIP]
>
> For encrypted X Chat messages, see the [Chat XDK](https://docs.x.com/xchat/xchat-xdk.md) (Python, TypeScript, Java, C#, Go, and Rust).
