Eranio
Color theme

CurseForge API

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

CurseForge has the largest catalogue of Minecraft modpacks and is one of two providers that install directly onto your server. The plugin searches class 4471 (modpacks) of game 432 (Minecraft), reads pack details and lists the files of a pack. All calls go to api.curseforge.com/v1 and need a CurseForge API key in the x-api-key header. Server installations read the manifest.json of the pack and fetch the listed mods one by one.

Handler: CurseForgeProvider
GET /mods/search

Search modpacks

Searches CurseForge for Minecraft modpacks and returns name, summary, first author, download count, thumbnail and last modification date.

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 makes no request and the list stays empty.
gameId integer Yes Game ID, 432 for Minecraft. Fixed in the plugin.
classId integer No Content class, 4471 for modpacks. Fixed in the plugin.
searchFilter string No Search keyword. Omitted when the search field is empty.
pageSize integer No Results per page, at most 50.
index integer No Zero-based offset in the result list.

Response Example

{"data":[{"id":261725,"name":"RLCraft","slug":"rlcraft","summary":"A modpack designed around survival","downloadCount":30000000,"classId":4471}],"pagination":{"index":0,"pageSize":20,"totalCount":500}}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/search?gameId=432&classId=4471&searchFilter=rlcraft&pageSize=5"
The plugin always sends gameId 432 and classId 4471. Without a keyword it sorts by popularity (sortField 2), a different sort order from the browser overrides this. sortOrder is always desc. The page size is limited to 50, even if the setting is higher, and the total count reported to the browser is capped at 10,000 because CurseForge does not page beyond that. An empty or missing API key does not produce an error message in the browser, the list is simply empty; the reason is written to the panel log.

Internal Behavior

Mapping into the browser list: id, name, summary, logo.thumbnailUrl as icon, the name of the first author (or the translated word for unknown), downloadCount and dateModified. Modpack IDs are kept as strings. Search results, details and version lists are cached for 30 minutes by default (MODPACKS_CACHE_DURATION, 1800 seconds), so identical searches do not hit the API again.
When you install a CurseForge pack on a server, the plugin unpacks the archive and reads manifest.json. For every file listed there it resolves the download URL through the CurseForge API and downloads the mods, then copies the overrides folder of the pack into the server directory.
GET /mods/{modId}

Get modpack details

Returns the complete record of one modpack, including the long description, logo, author list and the link to its CurseForge page.

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 makes no request and the list stays empty.
modId integer Yes Numeric CurseForge ID of the modpack, for example 1210677.

Response Example

{"data":{"id":261725,"name":"RLCraft","slug":"rlcraft","summary":"A modpack designed around survival","downloadCount":30000000}}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/261725"
The plugin reads name, summary, description (shown as the body text), the thumbnail logo, the first author, downloadCount, dateCreated, dateModified and links.websiteUrl. The call is made when you open the detail view of a pack. If CurseForge answers with an error or the key is missing, the plugin gets no details and the detail view stays empty instead of showing an error.

Internal Behavior

The endpoint is the same /mods/{modId} that is used for single mods, because on CurseForge a modpack is a mod of class 4471. The followers field is not provided by CurseForge and is always set to 0 by the plugin.
GET /mods/{modId}/files

Get modpack files

Lists the files of a modpack: each file is a version that you can select for the installation.

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 makes no request and the list stays empty.
modId integer Yes Numeric CurseForge ID of the modpack, for example 1210677.
gameVersion string No Filter by Minecraft version. Valid at CurseForge, not sent by the plugin.

Response Example

{"data":[{"id":4500000,"displayName":"RLCraft-1.12.2-2.9.2.zip","fileName":"RLCraft-1.12.2-2.9.2.zip","downloadUrl":"https://edge.forgecdn.net/...","gameVersions":["1.12.2","Forge"]}]}

cURL

curl -H "x-api-key: YOUR_KEY" "https://api.curseforge.com/v1/mods/261725/files"
The plugin reads id, displayName, fileName, fileDate and downloadCount from every file. The display name is shown as the version name, the file name as the version number. The call sends no game version filter; the parameter listed here is valid at CurseForge but not used by the plugin. For the actual download the plugin calls /mods/{modId}/files/{fileId} and takes downloadUrl, fileName and fileLength from it. A pack whose file has no downloadUrl cannot be installed from the panel.

Internal Behavior

The version list is requested together with the lists of other packs in parallel by the browser to keep the page fast, and the answer is cached. During an installation the progress runs through the steps preserve, backup, delete, download, extract, restore, merge and finalize, which you can read with the progress routes of the Pelican Client API.