Comprehensive Guide to the Factorio Download API

Factorio93 views1 favorites2 min readby GhostwheelUpdated Jan 26, 2025View on Steam ↗

Authenticating

To download Factorio, an authenticated session with the web server is required. This process differs from typical API authentication mechanisms and involves interacting with the HTML login endpoint.

Steps to Authenticate:

1. Initiate an HTTP Session:
- Send a `GET` request to the login page:
- The server will respond with an HTML page containing a Cross-Site Request Forgery (CSRF) token.
  1. Extract the CSRF Token:
    - Parse the HTML response to locate the CSRF token.
    - The token can be found using the following selectors:
    - CSS Selector: `input[name=csrf_token]`
    - XPath: `//input[@name="csrf_token"]/@value`
  2. Submit Login Credentials:
    - Send a `POST` request to the same login endpoint with the following parameters:
    - csrf_token: The extracted CSRF token.
    - username_or_email: Your Factorio username or email address.
    - password: Your Factorio account password.

Upon successful authentication, the session can be used to download the desired game files.

Downloading

Once authenticated, you can download Factorio releases by constructing a specific URL based on the desired version, build type, and distribution format.

Download URL Structure:

Parameters:
- {version}: The specific version number you wish to download (e.g., `0.15.31`). Use `latest` to download the most recent version for the specified build.
- {build}: The type of build, which can be:
- alpha: The current standard full-featured build without the Space Age expansion.
- expansion: The current standard full-featured build with the Space Age expansion.
- demo: The free, publicly accessible demo version.
- headless: A version for running servers on machines without a graphical interface.
- {distro}: The distribution format, which includes:
- win64: EXE installer for 64-bit Windows.
- win64-manual: ZIP package for 64-bit Windows.
- osx: DMG package for 64-bit macOS.
- linux64: tar.gz or tar.xz package for 64-bit Linux. Example:
To download version `0.15.31` of the standard 64-bit Windows installer:

If the requested download is unavailable, the server will respond with a `404` error. It's advisable to check available versions beforehand.

Using cURL to Download Factorio

An alternative method to download Factorio is by sending an HTTP `GET` request with your `username` and an authentication `token` as parameters. The authentication token can be obtained from the Factorio website after logging into your account. This token is sensitive and should be kept confidential.

cURL Command Structure:

Example:

Parameters:
- -L: Follows any redirects.
- --output: Specifies the path and filename for the downloaded file.

Ensure that the `username` and `token` are correctly specified to authenticate the download request.

Version Listings

To determine the latest available versions of Factorio, you can utilize the following resources:

1. Latest Releases API Endpoint:
An API endpoint provides information on the latest stable and experimental releases:

This endpoint returns a JSON object detailing the most recent versions, which can be polled to automatically detect new updates. 2. Download Archive Page:
A comprehensive list of all available Factorio versions is accessible at:

This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.