Wrapper for the official in-game Nadeo API from Trackmania released in 2020. Part of the ManiaAPI.NET library set.
$ dotnet add package ManiaAPI.NadeoAPIWraps the official Nadeo API used in the latest Trackmania (2020). This API requires authentication.
After initial authentication, the connectivity is managed by the library, so you don't have to worry about refreshing the token.
The game provides 3 domains, and they are split into 3 separate services:
NadeoServices for the core functionalityNadeoLiveServices for leaderboards, clubs, and other live contentNadeoMeetServices for getting the current Cup of the DayFor NadeoServices:
For NadeoLiveServices:
For NadeoMeetServices:
using ManiaAPI.NadeoAPI;
var ns = new NadeoServices();
await ns.AuthorizeAsync("mylogin", "mypassword", AuthorizationMethod.UbisoftAccount);
// Ready to use
var zones = await ns.GetZonesAsync();
You can also use a dedicated server. Just be aware it has some limitations.
await ns.AuthorizeAsync("my_dedicated_server", "ls>97jO>e3>>D/Ce", AuthorizationMethod.DedicatedServer);
For other services, just replace NadeoServices with NadeoLiveServices or NadeoMeetServices.
using ManiaAPI.NadeoAPI;
var login = "mylogin";
var password = "mypassword";
var ns = new NadeoServices();
await ns.AuthorizeAsync(login, password, AuthorizationMethod.UbisoftAccount);
var nls = new NadeoLiveServices();
await nls.AuthorizeAsync(login, password, AuthorizationMethod.UbisoftAccount);
// Ready to use combined
// With NadeoLiveServices
var weeklyCampaigns = await nls.GetSeasonalCampaignsAsync(1);
var campaignMap = weeklyCampaigns.CampaignList.First().Playlist.First();
var mapInfo = await nls.GetMapInfoAsync(campaignMap.MapUid);
var mapLeaderboard = await nls.GetTopLeaderboardAsync(campaignMap.MapUid);
// With NadeoServices
var records = await ns.GetMapRecordsAsync(mapLeaderboard.Top.Top.Select(x => x.AccountId), mapInfo.MapId);
For DI, consider using the ManiaAPI.NadeoAPI.Extensions.Hosting package. It also handles the authorization for you without additional startup code.