In other languages:

Download API

From Official Factorio Wiki
Revision as of 15:39, 1 August 2017 by Lexxy Fox (talk | contribs)
Jump to navigation Jump to search

This API allows you to download official releases of stand-alone Factorio from the Factorio servers. It's not so much of an API as it is web scraping, but it's documented here for completeness. Please update this page if you utilize it and the information becomes outdated. Also note that's there's a separate, (semi)official API for upgrading between releases, which should be used when possible to lighten load on the Factorio servers. (I'll document that later, promise!)

Authenticating

Downloading Factorio requires an authenticated session with the web server, which is different than the typical API authentication mechanism. Authentication uses the HTML endpoint at

https://www.factorio.com/login

To log in:

  1. Create an HTTP session and send a GET request.
    There's a CSRF token you'll need to grab which can be found using one of the following selectors:
    • CSS1: input[name=csrf_token]
    • XPATH1: //input[@name="csrf_token"]/@value.
  2. Then send a POST request with the following parameters:
    • csrf_token: the CSRF token you grabbed earlier.
    • username_or_email: your username or email address.
    • password: your password.

Downloading

Download Factorio releases at

https://www.factorio.com/get-download/{version}/{build}/{distro}

  • Where {version} is the version string of the release you wish to grab - e.g. "0.15.31".
  • {build} is the release build, which currently comprises of:
    • alpha - the current standard full-featured build.
    • demo - the free, publicly accessible demo versions.
    • headless - for running servers on machines without graphical interface.
  • and {distro} is the os / type of release you wish to download, currently:
    • win64 - EXE installer for 64 bit Windows.
    • win64-manual - ZIP package for 64 bit Windows.
    • win32 - EXE installer for 32 bit Windows. No longer supported.
    • win32-manual - ZIP package for 32 bit Windows. No longer supported.
    • osx - DMG package for 64 bit Mac OS.
    • linux64 - tar.gz or tar.xz package for 64 bit Linux.
    • linux32 - tar.gz or tar.xz package for 32 bit Linux. No longer supported.

Experimental builds are taken down quickly after they become obsolete, so it's best to check what versions are available before hand (documented below).

Version Listings

You can grab a list of Factorio versions available for download by sending a GET request to the endpoint at

https://www.factorio.com/download

There is also another endpoint available that filters to only headless releases, but otherwise has the same interface at

https://www.factorio.com/download-headless</code