As a developer, I want an endpoint that can efficiently determine the latest available version of a mod, so that my software can determine whether a mod update is available without needing to retrieve the full list of releases.
The addition of such an endpoint would reduce server load caused by mods/software that check for mod updates, which currently must retrieve the full mod information and full list of releases for every mod that needs to be checked.
Two alternative proposals are made here:
-
A /api/v2/mods/{modid}/releases/latest endpoint that would return a single entry (of the same type that /api/v2/mods/{modid}/releases/all returns a list of). This entry would provide information for the most recent release (highest release ID) for that mod. This is simpler to implement and the developer is provided with the download URL for the updated mod file in the same response.
-
A dedicated endpoint that accepts a list of (string) mod IDs and provides a dictionary mapping string mod IDs to the version number of the mod's latest release; this would be the most efficient method as it would return all required information in a single request. Suggested: either /api/v2/mod-versions/{modids} where modids is a comma-separated list, or omit /api/v2/mod-versions and take a query parameter containing the list, following standard conventions for passing multiple values in a query parameter. As proposed, this would entail subsequent queries to determine the URL of the updated mod file, however these additional requests would only occur for mods that actually had updates available.
As a developer, I want an endpoint that can efficiently determine the latest available version of a mod, so that my software can determine whether a mod update is available without needing to retrieve the full list of releases.
The addition of such an endpoint would reduce server load caused by mods/software that check for mod updates, which currently must retrieve the full mod information and full list of releases for every mod that needs to be checked.
Two alternative proposals are made here:
A
/api/v2/mods/{modid}/releases/latestendpoint that would return a single entry (of the same type that/api/v2/mods/{modid}/releases/allreturns a list of). This entry would provide information for the most recent release (highest release ID) for that mod. This is simpler to implement and the developer is provided with the download URL for the updated mod file in the same response.A dedicated endpoint that accepts a list of (string) mod IDs and provides a dictionary mapping string mod IDs to the version number of the mod's latest release; this would be the most efficient method as it would return all required information in a single request. Suggested: either
/api/v2/mod-versions/{modids}where modids is a comma-separated list, or omit/api/v2/mod-versionsand take a query parameter containing the list, following standard conventions for passing multiple values in a query parameter. As proposed, this would entail subsequent queries to determine the URL of the updated mod file, however these additional requests would only occur for mods that actually had updates available.