Class Requests
java.lang.Object
io.github.matyrobbrt.curseforgeapi.request.Requests
A utility class that contains methods for creating common requests. Please
see the CurseForge documentation
for more information.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
getCategories
(int gameId) Get all of the categories which match the givengameId
.getCategories
(int gameId, int classId) Get all of the categories which match the givengameId
andclassId
.static Request<FeaturedMods>
getFeaturedMods
(FeaturedModsQuery query) Get a list of featured, popular and recently updated mods.getFiles
(int... fileIds) Get a list of files.static Request<FingerprintsMatchesResult>
getFingerprintMatches
(int... fingerprints) Get mod files that match a list of fingerprints.static Request<List<FingerprintFuzzyMatch>>
Get mod files that match a list of fingerprints using fuzzy matching.getGame
(int gameId) Get a single game.getGames()
Get all games that are available to your API key.getGames
(PaginationQuery paginationQuery) Get all games that are available to your API key.static Request<List<GameVersionsByType>>
getGameVersions
(int gameId) Get all available versions for each known version type of the specified game.static Request<List<GameVersionType>>
getGameVersionTypes
(int gameId) Get all available version types of the specified game.getMod
(int modId) Get the mod with the specified IDgetModDescription
(int modId) Get the description of the mod with the specified ID in the HTML format.getModFile
(int modId, int fileId) Get a single file of the specified mod.getModFileChangelog
(int modId, int fileId) Get the changelog of a file in HTML format.getModFileDownloadURL
(int modId, int fileId) Get a download url for a specific file.getModFiles
(int modid) Get all files of the specified mod.getModFiles
(int modId, Integer gameVersionTypeId, PaginationQuery paginationQuery) Get all files of the specified mod.getModFiles
(Mod mod) Get all files of the specified mod.searchMods
(ModSearchQuery query) Searches for mods based on the specified query.
-
Constructor Details
-
Requests
public Requests()
-
-
Method Details
-
getGame
Get a single game. A private game is only accessible by its respective API key.- Parameters:
gameId
- the id of the game to get- Returns:
-
getGames
Get all games that are available to your API key.- Returns:
- a request which will get all the games available to the API key.
-
getGames
Get all games that are available to your API key.- Parameters:
paginationQuery
- the pagination query used for the request- Returns:
- a request which will get all the games available to the API key.
-
getGameVersions
Get all available versions for each known version type of the specified game. A private game is only accessible to its respective API key.- Parameters:
gameId
- the game id to get the versions for- Returns:
- the request
-
getGameVersionTypes
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).- Parameters:
gameId
- the game id to get the version types for- Returns:
- the request
-
getCategories
Get all of the categories which match the givengameId
.- Parameters:
gameId
- The unique game id to search categories for- Returns:
- the request
-
getCategories
Get all of the categories which match the givengameId
andclassId
.- Parameters:
gameId
- The unique game id to search categories forclassId
- The unique class id to search categories for- Returns:
- the request
-
getMod
Get the mod with the specified ID- Parameters:
modId
- the mod id to search for (the project ID)- Returns:
- the request
-
getModDescription
Get the description of the mod with the specified ID in the HTML format.- Parameters:
modId
- the mod id of the mod to request the description of (project id)- Returns:
- the request
-
searchMods
Searches for mods based on the specified query.- Parameters:
query
- the query to search- Returns:
- the request
-
getFeaturedMods
Get a list of featured, popular and recently updated mods.- Parameters:
query
- the query used for requesting the mods- Returns:
- the request
-
getModFile
Get a single file of the specified mod.- Parameters:
modId
- the mod id the file belongs to (project id)fileId
- the file id- Returns:
- the request
-
getModFiles
Get all files of the specified mod.- Parameters:
mod
- the mod- Returns:
- the request
-
getModFiles
Get all files of the specified mod.- Parameters:
modid
- the mod id the files belong to (project id)- Returns:
- the request
-
getModFiles
public static Request<List<File>> getModFiles(int modId, Integer gameVersionTypeId, PaginationQuery paginationQuery) Get all files of the specified mod.- Parameters:
modId
- the mod id the files belong to (project id)gameVersionTypeId
- the game version to search forpaginationQuery
- the pagination query used for the request- Returns:
- the request
-
getFiles
Get a list of files.- Parameters:
fileIds
- a list of file ids to fetch- Returns:
- the request
-
getModFileChangelog
Get the changelog of a file in HTML format.- Parameters:
modId
- the mod id (project id) the file belongs tofileId
- the file id- Returns:
- the request
-
getModFileDownloadURL
Get a download url for a specific file.- Parameters:
modId
- the mod id (project id) the file belongs tofileId
- the file id- Returns:
- the request
-
getFingerprintMatches
Get mod files that match a list of fingerprints.- Parameters:
fingerprints
- the fingerprints to search for- Returns:
- the request
-
getFingerprintsFuzzyMatches
public static Request<List<FingerprintFuzzyMatch>> getFingerprintsFuzzyMatches(GetFuzzyMatchesQuery query) Get mod files that match a list of fingerprints using fuzzy matching.- Parameters:
query
- the query to search for- Returns:
- the request
-
format
-
format
-