java.lang.Object
io.github.matyrobbrt.curseforgeapi.request.Requests

public final class Requests extends Object
A utility class that contains methods for creating common requests. Please see the CurseForge documentation for more information.
  • Constructor Details

    • Requests

      public Requests()
  • Method Details

    • getGame

      public static Request<Game> getGame(int gameId)
      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

      public static Request<List<Game>> 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

      public static Request<List<Game>> getGames(PaginationQuery paginationQuery)
      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

      public static Request<List<GameVersionsByType>> getGameVersions(int 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.
      Parameters:
      gameId - the game id to get the versions for
      Returns:
      the request
    • getGameVersionTypes

      public static Request<List<GameVersionType>> getGameVersionTypes(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).
      Parameters:
      gameId - the game id to get the version types for
      Returns:
      the request
    • getCategories

      public static Request<List<Category>> getCategories(int gameId)
      Get all of the categories which match the given gameId.
      Parameters:
      gameId - The unique game id to search categories for
      Returns:
      the request
    • getCategories

      public static Request<List<Category>> getCategories(int gameId, int classId)
      Get all of the categories which match the given gameId and classId.
      Parameters:
      gameId - The unique game id to search categories for
      classId - The unique class id to search categories for
      Returns:
      the request
    • getMod

      public static Request<Mod> getMod(int modId)
      Get the mod with the specified ID
      Parameters:
      modId - the mod id to search for (the project ID)
      Returns:
      the request
    • getModDescription

      public static Request<String> getModDescription(int modId)
      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

      public static Request<List<Mod>> searchMods(ModSearchQuery query)
      Searches for mods based on the specified query.
      Parameters:
      query - the query to search
      Returns:
      the request
    • getFeaturedMods

      public static Request<FeaturedMods> getFeaturedMods(FeaturedModsQuery query)
      Get a list of featured, popular and recently updated mods.
      Parameters:
      query - the query used for requesting the mods
      Returns:
      the request
    • getModFile

      public static Request<File> getModFile(int modId, int fileId)
      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

      public static Request<List<File>> getModFiles(Mod mod)
      Get all files of the specified mod.
      Parameters:
      mod - the mod
      Returns:
      the request
    • getModFiles

      public static Request<List<File>> getModFiles(int modid)
      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 for
      paginationQuery - the pagination query used for the request
      Returns:
      the request
    • getFiles

      public static Request<List<File>> getFiles(int... fileIds)
      Get a list of files.
      Parameters:
      fileIds - a list of file ids to fetch
      Returns:
      the request
    • getModFileChangelog

      public static Request<String> getModFileChangelog(int modId, int fileId)
      Get the changelog of a file in HTML format.
      Parameters:
      modId - the mod id (project id) the file belongs to
      fileId - the file id
      Returns:
      the request
    • getModFileDownloadURL

      public static Request<String> getModFileDownloadURL(int modId, int fileId)
      Get a download url for a specific file.
      Parameters:
      modId - the mod id (project id) the file belongs to
      fileId - the file id
      Returns:
      the request
    • getFingerprintMatches

      public static Request<FingerprintsMatchesResult> getFingerprintMatches(int... fingerprints)
      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

      public static String format(String str, Query query)
    • format

      public static String format(String str, Arguments args)