Soenneker.X.OpenApiClient 4.0.228

Prefix Reserved
dotnet add package Soenneker.X.OpenApiClient --version 4.0.228
                    
NuGet\Install-Package Soenneker.X.OpenApiClient -Version 4.0.228
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.X.OpenApiClient" Version="4.0.228" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.X.OpenApiClient" Version="4.0.228" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.X.OpenApiClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.X.OpenApiClient --version 4.0.228
                    
#r "nuget: Soenneker.X.OpenApiClient, 4.0.228"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.X.OpenApiClient@4.0.228
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.X.OpenApiClient&version=4.0.228
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.X.OpenApiClient&version=4.0.228
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.X.OpenApiClient

A Kiota-generated .NET client for the X API, including strongly typed request builders and response models.

Installation

dotnet add package Soenneker.X.OpenApiClient

Usage

The generated client requires a Kiota request adapter. This example uses an app bearer token to search for users:

using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;
using Soenneker.X.OpenApiClient;
using System.Net.Http.Headers;

using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", bearerToken);

var adapter = new HttpClientRequestAdapter(
    new AnonymousAuthenticationProvider(),
    httpClient: httpClient);

var client = new XOpenApiClient(adapter);

var response = await client.Two.Users.Search.GetAsync(request =>
{
    request.QueryParameters.Query = "dotnet";
    request.QueryParameters.MaxResults = 25;
}, cancellationToken);

foreach (var user in response?.Data ?? [])
    Console.WriteLine($"{user.Name} (@{user.Username})");

X endpoints accept different authentication contexts. Use an app bearer token only for endpoints that support app-only authentication; user-context operations require the appropriate OAuth access token.

The generated surface follows the API path hierarchy. For example, /2/users/search is exposed as client.Two.Users.Search.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.X.OpenApiClient:

Package Downloads
Soenneker.X.ClientUtil

Provides a cached X OpenAPI client authenticated with a configured bearer token.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.228 0 9/12/2026
4.0.226 42 9/11/2026
4.0.225 57 9/10/2026
4.0.224 81 9/9/2026
4.0.223 115 9/8/2026
4.0.222 85 9/8/2026
4.0.221 151 9/7/2026
4.0.220 125 9/6/2026
4.0.219 113 9/5/2026
4.0.218 89 9/4/2026
4.0.217 161 9/4/2026
4.0.216 167 9/3/2026
4.0.215 103 9/3/2026
4.0.214 136 8/31/2026
4.0.213 132 8/30/2026
4.0.212 132 8/29/2026
4.0.211 123 8/29/2026
4.0.210 119 8/28/2026
4.0.209 112 8/26/2026
4.0.208 182 8/25/2026
Loading failed

Automated update