ManiaExchange.ApiClient
1.0.1
See the version list below for details.
dotnet add package ManiaExchange.ApiClient --version 1.0.1
NuGet\Install-Package ManiaExchange.ApiClient -Version 1.0.1
<PackageReference Include="ManiaExchange.ApiClient" Version="1.0.1" />
paket add ManiaExchange.ApiClient --version 1.0.1
#r "nuget: ManiaExchange.ApiClient, 1.0.1"
// Install ManiaExchange.ApiClient as a Cake Addin #addin nuget:?package=ManiaExchange.ApiClient&version=1.0.1 // Install ManiaExchange.ApiClient as a Cake Tool #tool nuget:?package=ManiaExchange.ApiClient&version=1.0.1
ManiaExchange API Client
General purpose API client for ManiaExchange. The library implements a client wrapper for the version of ManiaExchange's API (v2) as defined here.
Built with the HTTP API Wrapper Framework.
Installation
You can find the package on NuGet or install with the dotnet tool:
dotnet add package ManiaExchange.ApiClient
Usage
The library exposes classes for each of MX's websites:
IxApi
: Item Exchange APIMxSmApi
: ShootMania Exchange APIMxTm2Api
: TrackMania 2 Exchange APIMxTmApi
: TrackMania 2020 Exchange API
Example basic usage
using ManiaExchange.ApiClient;
// instanitate the API class, pass a user agent to the constructor
var api = new TmxTmApi("My MX Client");
// call an api endpoint, in this case: /api/tags/gettags
var tags = await api.GetTagsAsync();
// the method returns a C# native object parsed from the response
foreach (var tag in tags)
{
Console.WriteLine(tag.Name);
}
Caching
Since ManiaExchange encourage caching of GET methods, you can cache time by using the SetCacheTime
method. This will cache all next GET requests for the specified time. Caching is disabled by default.
Cache can be disabled by either passing TimeSpan.Zero
to SetCacheTime
or use the shortcut DisableCache
method.
Examples
You can find more examples in the Samples directory.
Documentation
Since all the methods have an almost direct 1:1 mapping to the original API as defined at api2.mania.exchange you can use this website as a reference. The methods are categorized into their respective classes. All the methods and objects are also commented with the same documentation on the MX API docs website for your convenience.
Issues
This project is not affiliated with ManiaExchange, so for issues related to the API itself, please refer to the ManiaExchange API documentation website or ManiaExchange's support channel.
For issues related to the client and library itself, feel free to open an issue in this repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Hawf (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.