Mod Portal API

A place to talk about the official Factorio mod portal (https://mods.factorio.com)
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Mod Portal API

Post by sevens »

I'm not entirely certain if this is the correct place for this, but it's the closest I could see so here it goes, I guess.
I was wondering if there was a public api available for downloading mods from the mod portal, likely with an api key as provided by having a registered account 'n such. The thought behind this is that it'd allow for some simple automation scripts for handling headless modded servers, avoiding the need to:
  1. open factorio in a non-headless environment
  2. download the mods you need
  3. delete any you don't want appearing on the server
  4. copy the mods directory over to the server environment
yes, this method works and is straight-forward enough, but it can be time consuming and a tad annoying at the best of times if there are a large number of mods, so it'd be nice to have a way to handle that simply enough within the server env itself
eugenekay
Smart Inserter
Smart Inserter
Posts: 1071
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Mod Portal API

Post by eugenekay »

I don’t believe that a public documentation of the mod portal API has been posted; it’s not very complex and mostly seems to follow REST conventions once you’re logged-in or have a token. I just explored it via Browser debugging sessions (F12) and you can re-create requests with curl or a Python script.

The factorio game client logs HTTP requests that it makes when utilizing the Mod API; look in factorio-current.log. You can set a HTTP Proxy via config.ini setting proxy= to a debug server locally to get request header details & normal responses. Your API key (Token) can be found at https://factorio.com/profile.

Good Luck!
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Re: Mod Portal API

Post by sevens »

Yeah I suppose that does make sense, I appreciate the pointer! I'll see if I can finagle anything together
I have watched myself make horrendous decisions, but that won't stop me from making even more out of boredom
ZadenOwer
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Jun 12, 2026 10:33 pm
Contact:

Re: Mod Portal API

Post by ZadenOwer »

Thanks to @eugenekay comment, I did some tests and manage to request some mods from the api, here is an example of how you can do it as well
Url: "https://mods.factorio.com/api/mods?page ... e_age=true"
Method: POST
Body: '{"username":"<YOUR_USERNAME>", "token":"<YOUR_TOKEN>"}'

The username and token can be obtained from the https://factorio.com/profile

I tested it using a Windows Powershell command:

Code: Select all

(Invoke-WebRequest -Uri "https://mods.factorio.com/api/mods?page_size=10&full=True&version=2.0.76&lang=en&is_space_age=true" `
>> -Method POST `
>> -ContentType "application/json" `
>> -Body '{"username":"<YOUR_USERNAME>", "token":"<YOUR_TOKEN>"}' `
>> -UseBasicParsing).Content | Out-file "C:\mods_output.json"
With this you can get 10 mods from the api, since there's no docs for this sorting and filtering is a trial and error thing
Bilka
Factorio Staff
Factorio Staff
Posts: 3773
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Mod Portal API

Post by Bilka »

You can find the documentation for the API on the wiki, there's an overview on https://wiki.factorio.com/Factorio_HTTP ... guidelines.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Re: Mod Portal API

Post by sevens »

Bilka wrote: Mon Jun 15, 2026 11:19 am You can find the documentation for the API on the wiki, there's an overview on https://wiki.factorio.com/Factorio_HTTP ... guidelines.
so there is! neato
unfortunately it's not quite comprehensive in terms of the endpoints available but I'll make it work
certainly takes a load off of my shoulders with trying to read http requests
I have watched myself make horrendous decisions, but that won't stop me from making even more out of boredom
Bilka
Factorio Staff
Factorio Staff
Posts: 3773
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Mod Portal API

Post by Bilka »

sevens wrote: Mon Jun 15, 2026 11:43 am unfortunately it's not quite comprehensive in terms of the endpoints available but I'll make it work
If you spot anything missing, please add it to the wiki, that way the next person will also have it easier :D
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Re: Mod Portal API

Post by sevens »

Bilka wrote: Mon Jun 15, 2026 11:45 am
sevens wrote: Mon Jun 15, 2026 11:43 am unfortunately it's not quite comprehensive in terms of the endpoints available but I'll make it work
If you spot anything missing, please add it to the wiki, that way the next person will also have it easier :D
I fully intend to! The main thing I noticed was missing was the /api/search endpoint, but it seems simple enough
the only parts I'm confused on are the "version" and "is_space_age" request body parameters... messing with them doesn't seem to change the response at all so I'm unsure what they mean-
I have watched myself make horrendous decisions, but that won't stop me from making even more out of boredom
Bilka
Factorio Staff
Factorio Staff
Posts: 3773
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Mod Portal API

Post by Bilka »

sevens wrote: Mon Jun 15, 2026 11:52 am the only parts I'm confused on are the "version" and "is_space_age" request body parameters... messing with them doesn't seem to change the response at all so I'm unsure what they mean-
I don't know why the game sends "is_space_age", the mod portal doesn't read it. The version should control what mods are returned, e.g. not include 1.1 only mods for a 2.0 game.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Re: Mod Portal API

Post by sevens »

Bilka wrote: Mon Jun 15, 2026 11:57 am I don't know why the game sends "is_space_age", the mod portal doesn't read it. The version should control what mods are returned, e.g. not include 1.1 only mods for a 2.0 game.
Hm, certainly odd, but at least it makes it simpler for me lol, thanks for the help!
I have watched myself make horrendous decisions, but that won't stop me from making even more out of boredom
sevens
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 12, 2026 10:03 pm
Contact:

Re: Mod Portal API

Post by sevens »

I am now in possession of a factorio wiki account, so I'll do my damnedest to bring the api pages up to date with whatever I find while poking around
I have watched myself make horrendous decisions, but that won't stop me from making even more out of boredom
Post Reply

Return to “Mod portal Discussion”