CurseForge.APIClient
3.0.0
dotnet add package CurseForge.APIClient --version 3.0.0
NuGet\Install-Package CurseForge.APIClient -Version 3.0.0
<PackageReference Include="CurseForge.APIClient" Version="3.0.0" />
paket add CurseForge.APIClient --version 3.0.0
#r "nuget: CurseForge.APIClient, 3.0.0"
// Install CurseForge.APIClient as a Cake Addin #addin nuget:?package=CurseForge.APIClient&version=3.0.0 // Install CurseForge.APIClient as a Cake Tool #tool nuget:?package=CurseForge.APIClient&version=3.0.0
CurseForge API Client
This project aims to be a fully functional .NET client that allows you to use the CurseForge API,
All you need is an API key, your partner ID and a contact email to get started.
Initialize the ApiClient
Please make note that the ApiClient inheirits of IDisposable
, so that you dispose of it when you're done with it.
var cfApiClient = new CurseForge.APIClient.ApiClient(apiKey);
var cfApiClient = new CurseForge.APIClient.ApiClient(apiKey, contactEmail);
var cfApiClient = new CurseForge.APIClient.ApiClient(apiKey, partnerId, contactEmail);
How to call the API with the client
Games
Get Games
Get all games that are available to the provided API key.
GetGamesAsync(int? index = null, int? pageSize = null)
var games = await cfApiClient.GetGamesAsync();
Get Game
Get a single game. A private game is only accessible by its respective API key.
GetGameAsync(int gameId)
var game = await cfApiClient.GetGameAsync(gameId);
Get Game Versions
Get all available versions for each known version type of the specified game. A private game is only accessible to its respective API key.
GetGameVersionsAsync(int gameId)
var gameVersions = await cfApiClient.GetGameVersionsAsync(gameId);
Get Game Version Types
GetGameVersionTypesAsync(int gameId)
Get all available version types of the specified game.
A private game is only accessible to its respective API key.
Currently, when creating games via the CurseForge Core Console, you are limited to a single game version type. This means that this endpoint is probably not useful in most cases and is relevant mostly when handling existing games that have multiple game versions such as World of Warcraft and Minecraft (e.g. 517 for wow_retail).
var gameVersionTypes = await cfApiClient.GetGameVersionTypesAsync(gameId);
Categories
Get Categories
Get all available classes and categories of the specified game. Specify a game id for a list of all game categories, or a class id for a list of categories under that class.
GetCategoriesAsync(int? gameId = null, int? classId = null, bool? classesOnly = null)
Requires either gameId
or classId
for the method to work.
var categories = await cfApiClient.GetCategoriesAsync(gameId, classId);
Mods
Search Mods
Get all mods that match the search criteria.
SearchModsAsync(
int? gameId = null, int? classId = null, int? categoryId = null,
string gameVersion = null, string searchFilter = null,
ModsSearchSortField? sortField = null, ModsSearchSortOrder sortOrder = ModsSearchSortOrder.Descending,
ModLoaderType? modLoaderType = null, int? gameVersionTypeId = null,
int? index = null, int? pageSize = null
)
Requires at least one filter to be filled in.
var searchedMods = await cfApiClient.SearchModsAsync(gameId);
Get Mod
Get a single mod.
GetModAsync(int modId)
var mod = await cfApiClient.GetModAsync(modId);
Get Mods
Get a list of mods.
GetModsAsync(GetModsByIdsListRequestBody body)
var mods = await cfApiClient.GetModsAsync(new GetModsByIdsListRequestBody {
ModIds = new List<long>() { modId }
});
Get Featured Mods
Get a list of featured, popular and recently updated mods.
GetFeaturedModsAsync(GetFeaturedModsRequestBody body)
var featuredMods = await cfApiClient.GetFeaturedModsAsync(new GetFeaturedModsRequestBody {
GameId = gameId,
ExcludedModIds = new List<long>(),
GameVersionTypeId = null
});
Get Mod Description
Get the full description of a mod in HTML format.
GetModDescriptionAsync(int modId)
var modDescription = await cfApiClient.GetModDescriptionAsync(modId);
Files
Get Mod File
Get a single file of the specified mod.
GetModFileAsync(int modId, int fileId)
var modFile = await cfApiClient.GetModFileAsync(modId, fileId);
Get Mod Files
Get all files of the specified mod.
GetModFilesAsync(int modId, string gameVersion = null,
ModLoaderType? modLoaderType = null, string gameVersionFlavor = null,
int? index = null, int? pageSize = null)
var modFiles = await cfApiClient.GetModFilesAsync(modId);
Get Files
Get a list of files.
GetFilesAsync(GetModFilesRequestBody body)
var files = await cfApiClient.GetFilesAsync(new GetModFilesRequestBody {
FileIds = new List<long> { fileId }
});
Get Mod File Changelog
Get the changelog of a file in HTML format.
GetModFileChangelogAsync(int modId, int fileId)
var modFileChangelog = await cfApiClient.GetModFileChangelogAsync(modId, fileId);
Get Mod File Download URL
Get a download url for a specific file.
GetModFileDownloadUrlAsync(int modId, int fileId)
var modFileDownloadUrl = await cfApiClient.GetModFileDownloadUrlAsync(modId, fileId);
Fingerprints
Get Fingerprints Matches
Get mod files that match a list of fingerprints.
GetFingerprintMatchesAsync(GetFingerprintMatchesRequestBody body)
var modFile = await cfApiClient.GetFingerprintMatchesAsync(new GetFingerprintMatchesRequestBody {
Fingerprints = new List<long>() { fingerprint }
});
Get Fingerprints Matches By GameId
GetFingerprintByGameIdMatchesAsync(int gameId, GetFingerprintMatchesRequestBody body)
var matches = await cfApiClient.GetFingerprintByGameIdMatchesAsync(gameId, body);
Get Fingerprints Fuzzy Matches
Get mod files that match a list of fingerprints using fuzzy matching.
GetFingerprintsFuzzyMatchesAsync(GetFuzzyMatchesRequestBody body)
var modFile = await cfApiClient.GetFingerprintsFuzzyMatchesAsync(new GetFuzzyMatchesRequestBody {
GameId = gameId,
Fingerprints = new List<FolderFingerprint> {
new FolderFingerprint {
Foldername = folderName,
Fingerprints = new List<long> { fingerprint }
}
}
});
Get Fingerprints Fuzzy Matches By GameId
Get mod files that match a list of fingerprints using fuzzy matching.
GetFingerprintsFuzzyMatchesAsync(int gameId, GetFuzzyMatchesRequestBody body)
var modFile = await cfApiClient.GetFingerprintsFuzzyMatchesAsync(gameId, new GetFuzzyMatchesRequestBody {
GameId = gameId,
Fingerprints = new List<FolderFingerprint> {
new FolderFingerprint {
Foldername = folderName,
Fingerprints = new List<long> { fingerprint }
}
}
});
Minecraft
Get Minecraft Versions
This method allows you to fetch the Minecraft versions available to CurseForge
GetMinecraftVersions(bool sortDescending)
Get Specific Minecraft Version
Get information about a specific Minecraft version
GetSpecificMinecraftVersionInfo(string gameVersion)
Get Minecraft ModLoaders
Get all modloaders for Minecraft
GetMinecraftModloaders(string version, bool includeAll)
Get Specific Minecraft ModLoader
Gets information about a specific modloader
GetSpecificMinecraftModloaderInfo(string modloaderName)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 is compatible. 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 is compatible. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
-
net7.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on CurseForge.APIClient:
Repository | Stars |
---|---|
DaiYu-233/YMCL.Avalonia
Yu Minecraft Launcher · YMCL !
|
|
YUXUAN888/FSM3
FSMLauncher!
|
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 398 | 8/26/2024 |
2.2.0 | 1,159 | 1/30/2024 |
2.1.0 | 999 | 3/4/2023 |
2.0.1 | 538 | 11/22/2022 |
2.0.0 | 345 | 11/22/2022 |
1.5.2 | 613 | 8/17/2022 |
1.5.1 | 390 | 8/17/2022 |
1.5.0 | 565 | 7/22/2022 |
1.4.0 | 532 | 6/27/2022 |
1.3.4 | 684 | 6/6/2022 |
1.3.3 | 394 | 6/6/2022 |
1.3.2 | 413 | 6/6/2022 |
1.3.1 | 497 | 5/23/2022 |
1.3.0 | 418 | 5/23/2022 |
1.2.0 | 448 | 5/9/2022 |
1.1.4 | 456 | 4/26/2022 |
1.1.3 | 598 | 4/14/2022 |
1.1.2 | 438 | 3/24/2022 |
1.1.1 | 407 | 3/21/2022 |
1.1.0 | 435 | 3/10/2022 |
1.0.1 | 442 | 1/31/2022 |
1.0.0 | 360 | 11/5/2021 |