Matchmaking API

Anything related to the content on our wiki (https://wiki.factorio.com/)

Moderator: Bilka

squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Matchmaking API

Post by squiddog »

Team,

Is the API supported? I am able to authenticate, and use the get-games endpoint, but the get-game-details endpoint generates a "404 Not Found"
User avatar
vinzenz
Factorio Staff
Factorio Staff
Posts: 352
Joined: Mon Aug 02, 2021 6:45 pm
Contact:

Re: Matchmaking API

Post by vinzenz »

404 means the matching server doesn't know about the given game id, can you provide more details?
bringing the oops to devops
squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Re: Matchmaking API

Post by squiddog »

Example (redacted token)

Code: Select all

https://multiplayer.factorio.com/get-games?username=squiddog&token=REDACTED
This returns (I am clipping it off)

Code: Select all

[
    {
        "game_id": 12975085,
        "name": "Factorio Server",
        "description": "Hosted by Nodecraft.com",
        "max_players": 0,
        "application_version": {
            "game_version": "1.1.61",
            "build_version": 59839,
            "build_mode": "headless",
            "platform": "linux64"
        },
        "game_time_elapsed": 510,
        "has_password": false,
        "server_id": "wkhWdIc4jhl/wKYb6LY0RXeJ+CZHDnMHEjaUwlygAWQ=",
        "tags": [
            "game",
            "tags",
            "nodecraft"
        ],
        "headless_server": true,
        "has_mods": true,
        "mod_count": 51
    },
    {
        "game_id": 12942089,
        "name": "[WIF] Factorio",
        "description": "Wif Factorio Server",
        "max_players": 0,
        "application_version": {
            "game_version": "1.1.61",
            "build_version": 59839,
            "build_mode": "headless",
            "platform": "linux64"
        },
        "game_time_elapsed": 1593,
        "has_password": true,
        "server_id": "Ucv60GgoeS+RZMsru/t7huCGIa1opmb9wZxJa9c6EM4=",
        "tags": [
            "game",
            "tags",
            "nodecraft"
        ],
        "headless_server": true,
        "has_mods": true,
        "mod_count": 20
    },
    {
        "game_id": 10955453,
        "name": "Tuuttiposse Factorio Server!",
        "description": "Einarin työhönvalmennus kurssi",
        "max_players": 20,
        "application_version": {
            "game_version": "1.1.42",
            "build_version": 59009,
            "build_mode": "headless",
            "platform": "linux64"
        },
        "game_time_elapsed": 1300,
        "has_password": true,
        "server_id": "PMlscmzh2ANhFroEg8+XjeSbrkYCtUb2tETLu9mkfGU=",
        "tags": [
            "tuuttiposse"
        ],
        "has_mods": false,
        "mod_count": 0
    },
    {
        "game_id": 13010165,
        "name": "factoribruh",
        "description": "yeeeeeeeeeeeeeeet",
        "max_players": 20,
        "application_version": {
            "game_version": "1.1.61",
            "build_version": 59839,
            "build_mode": "headless",
            "platform": "linux64"
        },
        "game_time_elapsed": 796,
        "has_password": true,
        "server_id": "sb6uAghktQksXGNzqENXNdvtd4ILwflg9Smme5n7bsE=",
        "tags": [
            "mobiusnone"
        ],
        "headless_server": true,
        "has_mods": true,
        "mod_count": 3
    },
If I then try and use any of those game IDs, like

Code: Select all

https://multiplayer.factorio.com/get-game-details/?game_id=13010165
I get:

Code: Select all

<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try
	again.</p>
squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Re: Matchmaking API

Post by squiddog »

It seems more like the specific API "get-game-details" is not found. This is not an application error. Other Matchmaker API calls that have bad or missing parameters return explicit errors. I can misspell the key and it's the same error.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Matchmaking API

Post by Bilka »

squiddog wrote: Mon Jul 18, 2022 2:38 pm If I then try and use any of those game IDs, like

Code: Select all

https://multiplayer.factorio.com/get-game-details/?game_id=13010165
It should be https://multiplayer.factorio.com/get-ga ... s/13010165, without the "?game_id=". This is documented here: https://wiki.factorio.com/Matchmaking_A ... me-details
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Re: Matchmaking API

Post by squiddog »

Well oh crap, that was obvious. Thanks!
squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Re: Matchmaking API

Post by squiddog »

As long as I have you here....

Is there an easy way to, from the API, find a specific game (maybe matching a name)? Vs getting the list of all games and then parsing the JSON?
squiddog
Inserter
Inserter
Posts: 44
Joined: Sat Mar 10, 2018 12:25 am
Contact:

Re: Matchmaking API

Post by squiddog »

Never mind, I can use jq on the whole json and get my gameIDs and other info in a single line.
Post Reply

Return to “Wiki Talk”