API commands

Note: This API has been deprecated, and will be replaced when version 3.0 releases.

Every API-request should be going to "http://api.gamemakerserver.com/"

An API-request consists of a few general and a few specific parameters

-dev_id: The Developer-ID (See API-info pages)
-security_code: The securitycode
-format: json, xml, php or text. If the format should be text, this parameter can be left out.
-action: GameINI, PlayerINI, Achievements, Statistics, Highscore, Members, Logins, Online, GameINI_write, PlayerINI_write, Games or NameToID.

*GameINI*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
Returns: A set containing all INI-keys in the GameINI
You must own this game to use this function

*PlayerINI*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
-user_id: The user-ID of the player.
Returns: A set containing all INI-keys in the PlayerINI
You must own this game to use this function

*achievements*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
-user_id: The user-ID of the player.
Returns: A set containing all achievements and whether they've been reached
You must own this game to use this function

*Statistics*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
-user_id: The user-ID of the player.
Returns: A set of all statistics, and the corresponding values.
Returns: You must own this game to use this function

*Highscore*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
-list_id: The list-ID of the highscorelist.
Returns: A set containing all scores and corresponding usernamer or user-IDs
You must own this game to use this function

*Members*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
Returns: A set containting user-IDs and usernames of all members of the given game.
You must own this game to use this function

*Logins*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
Returns: A set containing the last 25 logins, including username and user-ID
You must own this game to use this function

*Online*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
Geeft terug: A set containing username and user-ID of all online players.
You must own this game to use this function

*GameINI_write*
Additional parameters:
-game_id: De API-gameID (Zie API-info pagina)
-section: Section to write
-key: Key to write
-value_string/value_real: The value to write
Returns: OK on succes or error on the first line of the document when it fails.
You must own this game to use this function

*PlayerINI_write*
Additional parameters:
-game_id: The API-gameID (See API-info pages)
-user_id: The user-ID of the player.
-section: Section to write
-key: Key to write
-value_string/value_real: The value to write
Returns: OK on succes or error on the first line of the document when it fails.
You must own this game to use this function

*Games*
Additional parameters:
-start: Geeft aan waar in de lijst van games te starten
Returns: A set containing all games, ranging form start to start + 20

*NameToID*
Additional parameters:
-name: The username of the player
Returns: A set containing the user-ID and username of the given player.

Replies (15)

Last message on 24 Apr 2021

Aouab on 30 Apr 2019, 03:45:29
Will this API be back?

Any E.T.A?

I need it for making a Discord Bot. ^-^
Size43 (Administrator) on 5 May 2019, 12:39:52
Some kind of API might make a return after the rewrite has been finished.
PlanetWorlds_Manager on 15 Apr 2021, 23:09:36
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Mouse Event for Left Pressed
for object obj_button_planet:

DoAdd :: Execution Error
at gml_Script_planet_create (line 36) - gms_ini_player_write("status","planet_create_cooldown",gms_time() + gms_ini_game_read("system","planet_create_cooldown"));
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_planet_create (line 36)
called from - gml_Object_obj_button_planet_LeftButtonPressed_1 (line 10) - planet_create(obj_textbox_planet.text);
Size43 (Administrator) on 24 Apr 2021, 19:21:07
You are seeing this error because gms_time() returns a real, and the INI key contains a string (or does not exist). You should check whether the INI key exists before reading it and using its value. If the INI value does not exist you should use some default value instead.

Additionally, if you are sometimes storing strings in this INI key, you might want to check whether the value is a string or a real before using it as well.
puzzle on 28 Jan 2017, 12:26:08
It seems that "user_id" in the explanation of *Highscore* is wrong.
I tried the test and it seems that "list_id" is correct.
Size43 (Administrator) on 30 Jan 2017, 11:12:04
You're right, I've fixed it.
matthe815 on 30 Dec 2016, 00:46:18
I've looked at the developer panel and saw something saying "API Requests per Hour", does that apply to the extension or just the web API?
Size43 (Administrator) on 3 Jan 2017, 12:57:13
Just the web API.
matthe815 on 3 Jan 2017, 18:46:00
Alright, thank you.
namlunthkl on 24 Feb 2015, 23:29:36
Hey... Any one have an example on PHP?
Size43 (Administrator) on 25 Feb 2015, 13:06:19
If you set the format to JSON, you can use json_decode in PHP to transform the API responses into a PHP array/object. Form there on it shouldn't be a problem to do the rest :)
namlunthkl on 20 Jun 2015, 03:35:03
What's Sercurity Code??? How can I get it?
Size43 (Administrator) on 20 Jun 2015, 15:15:07
It's needed for API authentication. You can find it by clicking your name in the top right of the screen.
namlunthkl on 21 Jun 2015, 05:42:51
error
unknown 43 ... why??????????????
Size43 (Administrator) on 21 Jun 2015, 12:01:03
Seems like something is wrong with the xml encoding. I'll take a look when I can. For now, please try using another format like JSON.