Mod portal API: Difference between revisions
(→Endpoints: note new? endpoint) |
No edit summary |
||
Line 79: | Line 79: | ||
=== Result Entry === | === Result Entry === | ||
Fields returned by the api/mods endpoint are marked with a check (✓) in the " | Fields returned by the api/mods endpoint are marked with a check (✓) in the "api/mods endpoint" column, those returned by the api/mods/{name} endpoint are marked with a check in the "Short" column and those returned by the api/mods/{name}/full endpoint are marked in the "Full" column. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Key !! Type !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Short !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Full !! Description | ! Key !! Type !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | api/mods endpoint !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Short !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Full !! Description | ||
|- | |- | ||
| downloads_count || Integer || ✓ || ✓ | | downloads_count || Integer || ✓ || ✓ || ✓ | ||
| Number of downloads. | | Number of downloads. | ||
|- | |- | ||
| latest_release || [[#Releases|Release]] || ✓ || | | latest_release || [[#Releases|Release]] || ✓ || || | ||
| The latest version of the mod available for download. See [[#Releases]] | | The latest version of the mod available for download. See [[#Releases]] | ||
|- | |- | ||
| name || String || ✓ || ✓ | | name || String || ✓ || ✓ || ✓ | ||
| The mod's machine-readable ID string. | | The mod's machine-readable ID string. | ||
|- | |- | ||
| owner || String || ✓ || ✓ | | owner || String || ✓ || ✓ || ✓ | ||
| The Factorio username of the mod's author. | | The Factorio username of the mod's author. | ||
|- | |- | ||
| releases || [[#Releases|Release]][] || || ✓ | | releases || [[#Releases|Release]][] || || ✓ || ✓ | ||
| A list of different versions of the mod available for download. See [[#Releases]] | | A list of different versions of the mod available for download. See [[#Releases]] | ||
|- | |- | ||
| summary || String || ✓ || ✓ | | summary || String || ✓ || ✓ || ✓ | ||
| A shorter mod description. | | A shorter mod description. | ||
|- | |- | ||
| title || String || ✓ || ✓ | | title || String || ✓ || ✓ || ✓ | ||
| The mod's human-readable name. | | The mod's human-readable name. | ||
|- | |- | ||
Line 108: | Line 108: | ||
=== Releases === | === Releases === | ||
Fields returned by api/mods/{name} endpoint are marked with a check in the "Short" column and those returned by api/mods/{name}/full are marked in the "Full" column. | |||
{| class="wikitable" | {| class="wikitable" | ||
! Key !! Type !! Description | ! Key !! Type !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Short !!+ style='writing-mode:vertical-lr;vertical-align:bottom;font-size:90%' | Full !! Description | ||
|- | |- | ||
| download_url || String || Path to download for a mod. starts with "/api" and does not include a full url | | download_url || String || ✓ || ✓ | ||
| Path to download for a mod. starts with "/api" and does not include a full url | |||
|- | |- | ||
| file_name || String || The file name of the release. Always seems to follow the pattern "{name}_{version}.zip" | | file_name || String || ✓ || ✓ | ||
| The file name of the release. Always seems to follow the pattern "{name}_{version}.zip" | |||
|- | |- | ||
| info_json || Object || A copy of the mod's info.json file, only contains factorio_version | | info_json || Object || ✓ || ✓ | ||
| A copy of the mod's info.json file, only contains factorio_version | |||
|- | |- | ||
| released_at || String(ISO 8601) || ISO 6501 for when the mod was released. | | released_at || String(ISO 8601) || ✓ || ✓ | ||
| ISO 6501 for when the mod was released. | |||
|- | |- | ||
| version || String || The version string of this mod release. Used to determine dependencies. | | version || String || ✓ || ✓ | ||
| The version string of this mod release. Used to determine dependencies. | |||
|- | |- | ||
| sha1 || String || The sha1 key for the file | | sha1 || String || ✓ || ✓ | ||
| The sha1 key for the file | |||
|} | |} | ||
Revision as of 17:45, 4 September 2018
This article is a stub, and not comprehensive. |
---|
You can help this wiki by expanding it. |
The Mod Portal API is used to both browse and download all mods available on the official Factorio mod portal. Using the API does not require any kind of authentication or account information and can be viewed simply by following the URLs below in any web browser.
https://mods.factorio.com/api/mods
More detailed information about a particular mod can be obtained by retrieving the following URL, where {name} is the mod's name field in the result object.
https://mods.factorio.com/api/mods/{name}
Endpoints
TODO!!! Note: The mod portal has been partially rewritten, and much of this section is out of date. Most of the parameters have been shifted to url path strings. Documentation needs to be updated, I'll do it soon(tm)! --Lexxy Fox (talk) 15:44, 24 February 2018 (UTC)
/api/mods
GET Parameters:
Key | Values | Description |
---|---|---|
page | {an integer} | Page number you would like to show. Makes it so you can see a certain part of the list without getting detail on all |
page_size | {an integer or 'max'} | The amount of results to show in your search |
namelist | {array of strings} | Return only mods that match the given names. |
Returns #Mod List Response
/api/mods/{mod_name}
/api/mods/{mod_name}/full
JSON Object Types
Mod List Response
Key | Type | Description |
---|---|---|
pagination | Pagination | See #Pagination |
results | Result[] | A list of mods, matching any filters you specified. |
Pagination
Key | Type | Description |
---|---|---|
count | Integer | Total number of mods that match your specified filters. |
links | Links | Utility links to mod portal api requests, preserving all filters and search queries. |
page | Integer | The current page number. |
page_count | Integer | The total number of pages returned. |
page_size | Integer | The number of results per page. |
Pagination Links
Key | Type | Description |
---|---|---|
first | String(URL) | URL to the first page of the results, or null if you're already on the first page. |
prev | String(URL) | URL to the previous page of the results, or null if you're already on the first page. |
next | String(URL) | URL to the next page of the results, or null if you're already on the last page. |
last | String(URL) | URL to the last page of the results, or null if you're already on the last page. |
Result Entry
Fields returned by the api/mods endpoint are marked with a check (✓) in the "api/mods endpoint" column, those returned by the api/mods/{name} endpoint are marked with a check in the "Short" column and those returned by the api/mods/{name}/full endpoint are marked in the "Full" column.
Key | Type | api/mods endpoint | Short | Full | Description |
---|---|---|---|---|---|
downloads_count | Integer | ✓ | ✓ | ✓ | Number of downloads. |
latest_release | Release | ✓ | The latest version of the mod available for download. See #Releases | ||
name | String | ✓ | ✓ | ✓ | The mod's machine-readable ID string. |
owner | String | ✓ | ✓ | ✓ | The Factorio username of the mod's author. |
releases | Release[] | ✓ | ✓ | A list of different versions of the mod available for download. See #Releases | |
summary | String | ✓ | ✓ | ✓ | A shorter mod description. |
title | String | ✓ | ✓ | ✓ | The mod's human-readable name. |
Releases
Fields returned by api/mods/{name} endpoint are marked with a check in the "Short" column and those returned by api/mods/{name}/full are marked in the "Full" column.
Key | Type | Short | Full | Description |
---|---|---|---|---|
download_url | String | ✓ | ✓ | Path to download for a mod. starts with "/api" and does not include a full url |
file_name | String | ✓ | ✓ | The file name of the release. Always seems to follow the pattern "{name}_{version}.zip" |
info_json | Object | ✓ | ✓ | A copy of the mod's info.json file, only contains factorio_version |
released_at | String(ISO 8601) | ✓ | ✓ | ISO 6501 for when the mod was released. |
version | String | ✓ | ✓ | The version string of this mod release. Used to determine dependencies. |
sha1 | String | ✓ | ✓ | The sha1 key for the file |
Error
Key | Type | Description |
---|---|---|
detail | String |