Page 1 of 1

Mod Portal API

Posted: Fri Jun 12, 2026 10:12 pm
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

Re: Mod Portal API

Posted: Fri Jun 12, 2026 11:07 pm
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!

Re: Mod Portal API

Posted: Fri Jun 12, 2026 11:39 pm
by sevens
Yeah I suppose that does make sense, I appreciate the pointer! I'll see if I can finagle anything together

Re: Mod Portal API

Posted: Sat Jun 13, 2026 6:33 pm
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

Re: Mod Portal API

Posted: Mon Jun 15, 2026 11:19 am
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.

Re: Mod Portal API

Posted: Mon Jun 15, 2026 11:43 am
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

Re: Mod Portal API

Posted: Mon Jun 15, 2026 11:45 am
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

Re: Mod Portal API

Posted: Mon Jun 15, 2026 11:52 am
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-

Re: Mod Portal API

Posted: Mon Jun 15, 2026 11:57 am
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.

Re: Mod Portal API

Posted: Mon Jun 15, 2026 12:02 pm
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!

Re: Mod Portal API

Posted: Tue Jun 16, 2026 1:08 pm
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