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.
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);
Get all games that are available to the provided API key.
GetGamesAsync(int? index = null, int? pageSize = null)
var games = await cfApiClient.GetGamesAsync();
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 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);
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);
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);
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 a single mod.
GetModAsync(int modId)
var mod = await cfApiClient.GetModAsync(modId);
Get a list of mods.
GetModsAsync(GetModsByIdsListRequestBody body)
var mods = await cfApiClient.GetModsAsync(new GetModsByIdsListRequestBody {
ModIds = new List<long>() { modId }
});
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 the full description of a mod in HTML format.
GetModDescriptionAsync(int modId)
var modDescription = await cfApiClient.GetModDescriptionAsync(modId);
Get a single file of the specified mod.
GetModFileAsync(int modId, int fileId)
var modFile = await cfApiClient.GetModFileAsync(modId, fileId);
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 a list of files.
GetFilesAsync(GetModFilesRequestBody body)
var files = await cfApiClient.GetFilesAsync(new GetModFilesRequestBody {
FileIds = new List<long> { fileId }
});
Get the changelog of a file in HTML format.
GetModFileChangelogAsync(int modId, int fileId)
var modFileChangelog = await cfApiClient.GetModFileChangelogAsync(modId, fileId);
Get a download url for a specific file.
GetModFileDownloadUrlAsync(int modId, int fileId)
var modFileDownloadUrl = await cfApiClient.GetModFileDownloadUrlAsync(modId, fileId);
Get mod files that match a list of fingerprints.
GetFingerprintMatchesAsync(GetFingerprintMatchesRequestBody body)
var modFile = await cfApiClient.GetFingerprintMatchesAsync(new GetFingerprintMatchesRequestBody {
Fingerprints = new List<long>() { fingerprint }
});
GetFingerprintByGameIdMatchesAsync(int gameId, GetFingerprintMatchesRequestBody body)
var matches = await cfApiClient.GetFingerprintByGameIdMatchesAsync(gameId, body);
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 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 }
}
}
});
This method allows you to fetch the Minecraft versions available to CurseForge
GetMinecraftVersions(bool sortDescending)
Get information about a specific Minecraft version
GetSpecificMinecraftVersionInfo(string gameVersion)
Get all modloaders for Minecraft
GetMinecraftModloaders(string version, bool includeAll)
Gets information about a specific modloader
GetSpecificMinecraftModloaderInfo(string modloaderName)