Soenneker.X.OpenApiClient 11.0.285

Prefix Reserved
dotnet add package Soenneker.X.OpenApiClient --version 11.0.285
                    
NuGet\Install-Package Soenneker.X.OpenApiClient -Version 11.0.285
                    
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="11.0.285" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.X.OpenApiClient" Version="11.0.285" />
                    
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 11.0.285
                    
#r "nuget: Soenneker.X.OpenApiClient, 11.0.285"
                    
#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@11.0.285
                    
#: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=11.0.285
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.X.OpenApiClient&version=11.0.285
                    
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 net11.0 is compatible. 
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
11.0.285 0 10/26/2026
11.0.283 44 10/26/2026
4.0.282 84 10/25/2026
4.0.281 67 10/24/2026
4.0.280 71 10/23/2026
4.0.279 66 10/22/2026
4.0.278 89 10/21/2026
4.0.277 116 10/20/2026
4.0.276 83 10/19/2026
4.0.275 127 10/18/2026
4.0.274 120 10/17/2026
4.0.273 120 10/16/2026
4.0.272 129 10/15/2026
4.0.271 131 10/15/2026
4.0.270 193 10/14/2026
4.0.269 110 10/14/2026
4.0.263 136 10/13/2026
4.0.262 91 10/13/2026
4.0.260 188 10/11/2026
4.0.259 103 10/11/2026
Loading failed

Update Soenneker.X.OpenApiClient