ManiaExchange.ApiClient 1.0.1

There is a newer version of this package available.
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                
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="ManiaExchange.ApiClient" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ManiaExchange.ApiClient --version 1.0.1                
#r "nuget: ManiaExchange.ApiClient, 1.0.1"                
#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.
// 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:

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 1,974 12/8/2022
1.0.1 832 6/24/2022
1.0.0 778 6/21/2022