Soenneker.X.OpenApiClient 4.0.276

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.X.OpenApiClient --version 4.0.276
                    
NuGet\Install-Package Soenneker.X.OpenApiClient -Version 4.0.276
                    
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.276" />
                    
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.276" />
                    
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.276
                    
#r "nuget: Soenneker.X.OpenApiClient, 4.0.276"
                    
#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.276
                    
#: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.276
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.X.OpenApiClient&version=4.0.276
                    
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.277 4 10/20/2026
4.0.276 46 10/19/2026
4.0.275 75 10/18/2026
4.0.274 72 10/17/2026
4.0.273 74 10/16/2026
4.0.272 88 10/15/2026
4.0.271 111 10/15/2026
4.0.270 166 10/14/2026
4.0.269 105 10/14/2026
4.0.263 130 10/13/2026
4.0.262 84 10/13/2026
4.0.260 180 10/11/2026
4.0.259 94 10/11/2026
4.0.258 87 10/10/2026
4.0.257 195 10/9/2026
4.0.256 158 10/8/2026
4.0.255 128 10/7/2026
4.0.254 121 10/6/2026
4.0.253 119 10/5/2026
4.0.252 133 10/4/2026
Loading failed

Update Soenneker.X.OpenApiClient