Modrinth.Net 3.0.6

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

Modrinth.Net

GitHub Nuget Nuget (with prereleases) Modrinth API

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);

User-Agent

  • You can also use the UserAgent class to help you create a valid user-agent
  • User-Agent current cannot be changed after the client has been created
  • More info about the User-Agent can be found here
using Modrinth;
using Modrinth.Client;

// Note: All properties are optional, and will be ignored if they are null or empty
var userAgent = new UserAgent
{
    ProjectName = "ProjectName",
    ProjectVersion = "1.0.0",
    GitHubUsername = "Username",
    Contact = "contact@contact.com"
};

var client = new ModrinthClient(userAgent: userAgent, token: "Your_Authentication_Token");

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
using Modrinth;
using Modrinth.Exceptions;
using System.Net;

var client = new ModrinthClient(userAgent: "My_Awesome_Project");

try 
{
    var project = await _client.Project.GetAsync("non-existent-project");
    
    Console.WriteLine(project.Title);
}
// You can catch the exception and only handle the 404 status code
catch (ModrinthApiException e) when (e.StatusCode == HttpStatusCode.NotFound) 
{
    Console.WriteLine("Project not found");
}
// Or you can catch the exception and handle all non-200 status codes
catch (ModrinthApiException e)
{
    Console.WriteLine($"API call failed with status code {e.StatusCode}");
}
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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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 Modrinth.Net:

Package Downloads
Gml.Core

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Modrinth.Net:

Repository Stars
yiikooo/YMCL.Avalonia
Yu Minecraft Launcher · YMCL !
Version Downloads Last Updated
3.6.0 963 8/6/2025
3.5.2 300 8/6/2025
3.5.1 342 6/2/2025
3.5.0 676 2/18/2025
3.4.5 1,485 4/22/2024
3.4.4 225 4/21/2024
3.4.3 364 2/22/2024
3.4.2 266 2/22/2024
3.4.1 236 1/29/2024
3.4.0 470 11/28/2023
3.4.0-alpha2 182 9/29/2023
3.4.0-alpha 184 9/29/2023
3.3.0 461 8/7/2023
3.2.2 380 6/21/2023
3.2.1 277 6/21/2023
3.2.0 405 5/20/2023
3.2.0-rc2 222 5/13/2023
3.2.0-rc1 247 5/12/2023
3.2.0-beta1 281 4/25/2023
3.0.6 328 3/11/2023
Loading failed