Mod portal API: Difference between revisions
(Updated to reflect changes to the API. Many features were removed unfortunately. I most likely missed some things that changed...) |
|||
Line 19: | Line 19: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Key !! Values !! Description | ! 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 ||{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}||The amount of results to show in your search | | 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. | | namelist || {array of strings} || Return only mods that match the given names. | ||
Line 39: | Line 31: | ||
=== /api/mods/{mod_name} === | === /api/mods/{mod_name} === | ||
== JSON Object Types == | == JSON Object Types == | ||
Line 106: | Line 80: | ||
{| 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%' | 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 || ✓ || ✓ | ||
Line 157: | Line 92: | ||
| 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]][] || || ✓ | ||
Line 166: | Line 98: | ||
| 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. | ||
|- | |- | ||
|} | |} | ||
=== Releases === | === Releases === | ||
Line 318: | Line 110: | ||
|- | |- | ||
| 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 | |||
|- | |- | ||
| 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 | |||
|} | |} | ||
Revision as of 17:21, 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}
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 "Short" column, and those returned the the api/mods/{name} endpoint are marked with a check in the "Full" column.
Key | Type | 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
Key | Type | 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 |