• Game Jolt PHP API
    Version 0.9 - 5th January 2010

    Download Link(s)
    Version 0.9 Github: https://github.com/ashleygwinnell/Game-Jolt-PHP-Game-API

    Example Usage

        $game_id = 1;
        $private_key = "";
        $trophy_id = "";
        $username = "";
        $usertoken = "";

        $gj = new GameJoltTrophyAPI($game_id, $private_key);
        if ($gj->verifyUser($username, $token) == true)
            echo "<h2>Authenticated successfully!</h2>";
        } else {
            echo "<h2>" . $result . ": Could not authenticate you. :(!</h2>";

    Example Usage Explanation
    You need to fill in the variables in the above Java program with the relevant information. Most of the information can be found in the "Manage Trophies" section when you're editting your game.

    You may not use any of the data-calling methods before calling verifyUser(). You should only need to call verifyUser once for each GameJoltTrophyAPI object.

    Since this is just a port of the Java API, everything should be nice and high level and easy to use. There are a few differences from the Java version.

     - A method has been added named "setUsingCURL()" incase your PHP server does not allow you to get information from a url using the normal file methods.
     - The class/object name is GameJoltTrophyAPI and not GameJoltAPI.
     - Enum types "Difficulty" and "Achieved" are replaced with Strings.
     - There is "request()" and "requestFromArray()" since overloading is not supported.

    Now you may be thinking:
    What point is there to this library?
    Isn't PHP a server-side scripting language?
    What /game/ is going to use PHP?

    Well, probably very few. There may be a few turn based browser game's out there that want to use GameJolt Achievements, but I still think that's unlikely.

    I'm using this library with Netbin. Here's how it is:

    - Netbin will offer an API directly mapping to the GameJolt Trophy API.
    - You pass Netbin your trophy requests and Netbin will pass it on to Game Jolt.
    - Netbin will store the data too and will show it on the site!

    Wahey, your favourite game site mixed with some social networking.

    If you run into any troubles, as far as I am aware, you may ask in this thread. :)

    Additional Links
    GJ API Documentation

    Last edited on July 30, 2012 - 06:11 PM by Ashley

  • ....php games? o.o

  • @Alej:

    You don't know any turn-based browser games? How about Travian, OGame, or Mafia Wars? I think Flash/ActionScript can execute a PHP script too, so a developer may prefer to do that than write a Flash/ActionScript API.

  • Wait a second. When the heck did you do this? How did I not see this before?

  • Sometime shortly after new year, as you can see by the post date. :D

    It only took about an hour to port over from the Java API. It also means it has some bad logic in there too which I've not gotten around to updating. :(

  • I've moved this over to Github so people can contribute to the project easier. The PHP API is lacking High Scores, Data Storage and Sessions - whoops.


  • This is useful, especially for a game engine that only supports opening pages in a web browser. With GET strings, the Game Jolt API is possible!

  • doge bro