Modrinth.Net 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Modrinth.Net --version 3.0.1
NuGet\Install-Package Modrinth.Net -Version 3.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="Modrinth.Net" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Modrinth.Net --version 3.0.1
#r "nuget: Modrinth.Net, 3.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 Modrinth.Net as a Cake Addin
#addin nuget:?package=Modrinth.Net&version=3.0.1

// Install Modrinth.Net as a Cake Tool
#tool nuget:?package=Modrinth.Net&version=3.0.1

Modrinth.Net

GitHub Nuget Nuget (with prereleases)

  • C# Wrapper for the Modrinth API
  • Previously known as "Modrinth.RestClient"

Usage

using Modrinth;

// You must provide a user-agent, and optionally an authentication token if you wish to access authenticated API endpoints
var client = new ModrinthClient(userAgent: "My_Awesome_Project" , token: "Your_Authentication_Token");

var project = await client.Project.GetAsync("sodium");

Console.WriteLine(project.Description);

Unsuccesful API calls

  • If the API call was unsuccessful, the client will throw an ModrinthApiException exception
  • This will be thrown if the API call return non-200 status code, or if the response body is not valid JSON
  • This approach will be revisited in future versions

Upgrade from 2.X.X to 3.0.0

The package has been renamed from "Modrinth.RestClient" to "Modrinth.Net", so you will need to do the following to upgrade:

  1. Uninstall the old "Modrinth.RestClient" package
  2. Install the new "Modrinth.Net" package
  3. Replace the old namespace "Modrinth.RestClient" with the new namespace "Modrinth" in your code
API Changes from 2.X.X to 3.0.0
  • New client class
    • ModrinthClient is the new client class, which contains all the smaller API classes
    • It's similar to the API specification:
      • Instead of client.GetProjectAsync("sodium") you will do client.Project.GetAsync("sodium")
      • client.GetProjectTeamMembersByProjectAsync("sodium") will become client.Team.GetProjectTeamAsync("sodium")
      • And so on
// Old
using Modrinth.RestClient;

var client = ModrinthApi.NewClient(userAgent: "My_Awesome_Project");
var project = await client.GetProjectAsync("sodium");

// New
using Modrinth;

var client = new ModrinthClient(userAgent: "My_Awesome_Project");
var project = await client.Project.GetAsync("sodium");
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.

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
3.4.5 87 4/22/2024
3.4.4 89 4/21/2024
3.4.3 219 2/22/2024
3.4.2 126 2/22/2024
3.4.1 112 1/29/2024
3.4.0 378 11/28/2023
3.4.0-alpha2 106 9/29/2023
3.4.0-alpha 90 9/29/2023
3.3.0 274 8/7/2023
3.2.2 256 6/21/2023
3.2.1 121 6/21/2023
3.2.0 233 5/20/2023
3.2.0-rc2 86 5/13/2023
3.2.0-rc1 100 5/12/2023
3.2.0-beta1 127 4/25/2023
3.1.1 306 4/14/2023
3.1.0 225 4/2/2023
3.1.0-rc4 109 3/31/2023
3.1.0-rc3 158 3/25/2023
3.1.0-rc2 117 3/24/2023
3.1.0-rc1 110 3/23/2023
3.1.0-alpha3 122 3/21/2023
3.1.0-alpha2 122 3/20/2023
3.1.0-alpha 119 3/20/2023
3.0.10 214 3/20/2023
3.0.9 189 3/16/2023
3.0.8 203 3/15/2023
3.0.7 190 3/15/2023
3.0.6 198 3/11/2023
3.0.5 288 2/20/2023
3.0.4 226 2/20/2023
3.0.3 249 2/18/2023
3.0.2 253 2/2/2023
3.0.1 288 1/29/2023