Eranio
Color theme

CurseForge API

Base: https://api.curseforge.com/v1

CurseForge is the largest mod source in the Game Mods Installer and is the default provider in the mod browser. This page documents the calls the plugin makes against api.curseforge.com/v1: searching mods, reading a mod, listing its files and fetching the HTML description. All calls need a CurseForge API key in the x-api-key header. Minecraft uses gameId 432 with classId 6 for mods, Hytale uses gameId 70216 with classId 9137.

Handler: CurseForgeProvider
GET /mods/search

Search mods

Searches CurseForge for mods by keyword and returns one page of results with name, summary, authors, download count, logo and categories. This is the call behind the mod browser when CurseForge is selected.

Parameters

Name Type Required Description
x-api-key string Yes Your CurseForge API key (CURSEFORGE_API_KEY in the plugin settings). Without it the plugin returns empty results instead of an error.
gameId integer Yes Game ID: 432 for Minecraft, 70216 for Hytale.
classId integer No Content class: 6 for Minecraft mods, 9137 for Hytale mods. The plugin sets it automatically.
searchFilter string No Search keyword. Omitted when the search field is empty.
sortField integer No Sort field: 1 featured, 2 popularity, 3 last updated, 4 name, 6 total downloads.
sortOrder string No asc or desc. The plugin always sends desc.
pageSize integer No Results per page, at most 50 on the CurseForge side. Default of the plugin: 20.
index integer No Zero-based offset, calculated as (page minus 1) times pageSize.
gameVersion string No Game version filter, for example 1.20.1. Taken from the version selected in the browser.
modLoaderType integer No Loader filter for Minecraft: 1 Forge, 2 Cauldron, 3 LiteLoader, 4 Fabric, 5 Quilt, 6 NeoForge.

Response Example

{"data":[{"id":238222,"gameId":432,"name":"Just Enough Items (JEI)","slug":"jei","links":{"websiteUrl":"https://www.curseforge.com/minecraft/mc-mods/jei"},"summary":"View Items and Recipes","downloadCount":195000000,"categories":[{"id":421}],"classId":9137,"authors":[{"name":"mezz"}]}],"pagination":{"index":0,"pageSize":20,"resultCount":1,"totalCount":1}}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/search?gameId=432&classId=9137&searchFilter=jei&pageSize=5"
The plugin sends gameId 432 for Minecraft and adds classId 6 (mods). For Hytale it sends gameId 70216 and classId 9137. modLoaderType is only sent for Minecraft and only when you pick a loader: forge 1, cauldron 2, liteloader 3, fabric 4, quilt 5, neoforge 6. A keyword uses sortField 1 by default, without a keyword the sort order of the browser applies, and sortOrder is always desc. pageSize is the mods-per-page setting (default 20, MODS_PER_PAGE) and index is the zero-based offset. CurseForge itself limits pageSize to 50. Without a configured API key no request is made at all and the list stays empty.

Internal Behavior

After the response arrives the plugin re-ranks the page locally when a keyword was used: an exact mod name scores 100, an exact author name 80, a keyword inside the name 50 and inside the author list 40. This makes searches by author name useful even though CurseForge ranks them lower.
The result of a search is cached by the mod browser: 60 seconds when a keyword was entered, 15 minutes for the plain list. Errors such as a wrong key or a timeout are written to the panel log and the browser shows an empty list. The request timeout is MODS_REQUEST_TIMEOUT, 10 seconds by default.
GET /mods/{modId}

Get mod details

Returns the full record of a single mod: name, summary, download count, main file and the index of the latest files per game version.

Parameters

Name Type Required Description
x-api-key string Yes Your CurseForge API key (CURSEFORGE_API_KEY in the plugin settings). Without it the plugin returns empty results instead of an error.
modId integer Yes Numeric CurseForge mod ID, for example 238222.

Response Example

{"data":{"id":238222,"name":"Just Enough Items (JEI)","slug":"jei","summary":"View Items and Recipes","downloadCount":195000000,"mainFileId":5000000,"latestFilesIndexes":[{"gameVersion":"1.20.1","fileId":5000000}]}}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/238222"
The plugin uses this call to look up the slug of an installed or selected mod, which it needs to build the link to the CurseForge project page. It does not read other fields from it. The call needs the same x-api-key header as every other CurseForge call. If the mod ID does not exist, CurseForge answers with 404 and the plugin simply has no slug and shows no link.

Internal Behavior

Only the slug field is evaluated. On any non-successful answer or exception the method returns null without logging an error, so a missing link is the only visible effect.
The slug lookup is only made for CurseForge. Modrinth and Modtale already use the ID as the slug and do not need an extra request.
GET /mods/{modId}/files

Get mod files

Lists the files (versions) of a mod with file name, release date, supported game versions and download URL. The mod browser shows these as the installable versions.

Parameters

Name Type Required Description
x-api-key string Yes Your CurseForge API key (CURSEFORGE_API_KEY in the plugin settings). Without it the plugin returns empty results instead of an error.
modId integer Yes Numeric CurseForge mod ID, for example 238222.
gameVersion string No Filter by game version. Valid at CurseForge, but not sent by the plugin for this call.
modLoaderType integer No Filter by loader (1 Forge, 4 Fabric, 5 Quilt, 6 NeoForge). Valid at CurseForge, not sent by the plugin for this call.
pageSize integer No Number of files per page. The plugin sends 50.

Response Example

{"data":[{"id":5000000,"displayName":"jei-1.20.1-15.2.0.27.jar","fileName":"jei-1.20.1-15.2.0.27.jar","releaseType":1,"downloadUrl":"https://edge.forgecdn.net/files/...","gameVersions":["1.20.1","Forge"],"dependencies":[]}]}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/238222/files?gameVersion=1.20.1"
The plugin itself always requests pageSize 50 and no further filters. Which versions are offered for your server is decided afterwards from the game versions and loaders contained in each file. Loaders are read from sortableGameVersions and recognised for forge, fabric, quilt and neoforge. If downloadUrl is empty in a file, the plugin cannot install that file automatically and the download has to be done by hand. The version list of a mod is cached, so a new upload can take a moment to show up.

Internal Behavior

When you install a version from CurseForge, the plugin first calls /mods/{modId}/files/{fileId} and reads the required dependencies (relationType 3). For each dependency it looks for a file whose game-version tags overlap with the parent file, preferring a match on both game version and loader and falling back to a match on the game version alone. Dependencies are resolved recursively and installed before the mod itself, unless they are already installed on the server. Cycles are prevented by remembering which mods were already resolved.
The installation then calls the same file endpoint once more to get downloadUrl and fileName and downloads the file into the mods folder.
GET /mods/{modId}/description

Get mod description

Returns the long description of a mod as an HTML string inside the data field.

Parameters

Name Type Required Description
x-api-key string Yes Your CurseForge API key (CURSEFORGE_API_KEY in the plugin settings). Without it the plugin returns empty results instead of an error.
modId integer Yes Numeric CurseForge mod ID, for example 238222.

Response Example

{"data":"<h2>Just Enough Items</h2><p>JEI is an item and recipe viewing mod...</p>"}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/238222/description"
This is a CurseForge endpoint and it works with the same key as the other calls. The Game Mods Installer does not call it at the moment: the mod browser shows the short summary from the search result. The call is listed here so you can test the key and the access of your server to CurseForge with it. The HTML comes unsanitised from the author, so never insert it into a page without cleaning it first.

Internal Behavior

No plugin code is involved. The call goes straight from the test tool to api.curseforge.com. A 403 means the key is missing or invalid, a 404 means the mod ID does not exist.