An API for implementing leaderboards into your games

Overview

simple-leaderboard-api

An API for implementing leaderboards into your games

How to use it

You'll first want to visit http://indiealchemy.com/simple-leaderboard to get your GameID. A GameID is unique to your game and email. You can have multiple games under the same email, but to get a new GameID you'll need a new Game to generate it.

Once you have the GameID, you'll generally make GET requests to the API in exchange for your leaderboard stats.

Actions

The base URL for the API is https://indiealchemy.com/apis/simple-leaderboard/

To make a call, you must specify an action. There are three of these.

newScore

This will look like https://indiealchemy.com/apis/simple-leaderboard/?action=newScore

This is how you will add new scores to the leaderboard.

This endpoint take 3 paramaters. All three must have a value to make a successful call.

  1. gameID - The unique number you receive when you sign up with your email
  2. score - The numeric value of the user score. It's an integer, so be kind with your scale
  3. userName - The name of the user that got the score

A complete request to add a new score should look something like this

https://indiealchemy.com/apis/simple-leaderboard/?action=newScore&gameID=1&score=1000&userName=geraldfingburke

Verbose, isn't it? I promised a simple api, not a short one.

topScores

This will look like https://indiealchemy.com/apis/simple-leaderboard/?action=topScores

This is how you will read values from the leaderboard.

This endpoint has two paramaters (and one of them is optional!)

  1. gameID - The unique number you receive when you sign up with your email
  2. count - The number of scores to pull. If you leave this off, you'll just get ten. If there are fewer records than the count, you'll get what you have.

A complete request to get top scores should look like this

https://indiealchemy.com/apis/simple-leaderboard/?action=topScores&gameID=1&count=10

Remember, you can leave off the count. As a matter of fact, since the default is 10, there is virtually no difference between that call and a call without the count parameter.

userScores

This will look like https://indiealchemy.com/apis/simple-leaderboard/?action=userScores

This one lets you get scores by the name of the user that scored them.

This endpoint brings us back to three parameters (still one optional!)

1)gameID - The unique number you receive when you sign up with your email 2)userName - The name of the user you want to get scores for 3)count - The number of scores to pull. If you leave this off, you'll just get ten. If there are fewer records than the count, you'll get what you have.

https://indiealchemy.com/apis/simple-leaderboard/?action=topScores&gameID=1&userName=geraldfingburke&count=10

Remember, you can leave off the count. As a matter of fact, since the default is 10, there is virtually no difference between that call and a call without the count parameter.

Attribution and License Info

I don't actually know what the license is, I just picked one that sounded permissive. That is the spirit of this endeavor. Feel free to use this however you would like.

I don't need myself or the project to be credited if you do use this, but I absolutely love to hear when people use my work, so if you want to shoot me a message with a link to your thing, I would love to check it out.

You might also like...
Detect flaws in your architecture, before they drag you down into the depths of dependency hell ...
Detect flaws in your architecture, before they drag you down into the depths of dependency hell ...

Detect flaws in your architecture before they drag you down into the depths of dependency hell ... What it does System Requirements Installation Phive

A Composer Package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project.

phantomjs-installer A Composer package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project. Table of Contents Installa

Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP 📢 Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

N2Web turns your Notion HTML export into a fully functional static website
N2Web turns your Notion HTML export into a fully functional static website

Notion2Web N2Web turns your Notion HTML export into a fully functional static website. What is Notion? Notion is an online tool. But I can't tell you

A PHP component to convert HTML into a plain text format

html2text html2text is a very simple script that uses DOM methods to convert HTML into a format similar to what would be rendered by a browser - perfe

A PocketMine/Altay Plugin to morph yourself into a block
A PocketMine/Altay Plugin to morph yourself into a block

BlockMorph A PocketMine/Altay Plugin to morph yourself into a block Command To morph yourself into a block use this command: /blockmorph [BlockID|Bloc

This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify that a number is indeed a number of an operator X

phone-number-checker This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify t

Plugin that allows a player to morph into mobs
Plugin that allows a player to morph into mobs

BurgerMorphs This plugin adds a Morphs system to PMMP. Players can morph into most mobs available in the game. Players can also morph into baby versio

A class to help convert bytes into other units (kb, mb, etc).

A class to help convert bytes into other units (kb, mb, etc). This package can be used to convert int|float values from bytes to KB, MB and GB as well

Comments
  • Add

    Add "Return JSON" info to README

    We don't have an example of the model in the README for users to know what is returned from each endpoint. We need to include these examples. This is also dependent on changes to the model in issue #4

    documentation help wanted good first issue 
    opened by geraldfingburke 0
  • Include Ranking

    Include Ranking

    It occurred to me that I missed a pretty obvious thing. I don't have a ranking for the user. If you want to include this in our requests, I'll get the column added to the database.

    Shoot me a message if you decide to work on this. I'll have to get you a config file with a generic user on the db.

    enhancement help wanted good first issue 
    opened by geraldfingburke 9
Owner
A web/game developer living in the mountains of Northeast Tennessee
null
Type and shape system for arrays. Help write clearer code when implementing configs for your PocketMine-MP plugin or composer project.

ConfigStruct Type and shape system for arrays. Help write clearer code when implementing configs for your PocketMine-MP plugin or composer project. It

EndermanbugZJFC 9 Aug 22, 2022
Pocketmine Plugin implementing Stackable Spawners

Information This plugin adds a Stackable Spawner System to PMMP. When you place a Spawner, you can stack additional Spawners onto the same Spawner to

null 33 Aug 17, 2022
Learning design patterns by implementing them in various programming languages.

design-patterns Learning design patterns by implementing them in various programming languages. Creational design patterns Creational design patterns

Paweł Tryfon 1 Dec 13, 2021
A PHP library to support implementing representations for HATEOAS REST web services.

Hateoas A PHP library to support implementing representations for HATEOAS REST web services. Installation Working With Symfony Usage Introduction Conf

William Durand 998 Dec 5, 2022
CPAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your PHP project.

CPAY CHOCO PAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your P

faso-dev 1 Oct 26, 2022
An article about alternative solution for convert object into a JSON Object for your api.

Do we really need a serializer for our JSON API? The last years I did build a lot of JSON APIs but personally was never happy about the magic of using

Alexander Schranz 1 Feb 1, 2022
Talkino allows you to integrate multi social messengers and contact into your website and enable your users to contact you using multi social messengers' accounts.

Talkino Welcome to our GitHub Repository Talkino is a click to chat plugin to show your agents’ multiple social messengers, phone and emails on the ch

Traxconn 2 Sep 21, 2022
Rubix Server is a library for bringing your trained Rubix ML models into production.

Rubix Server is a library for bringing your trained Rubix ML models into production. Inference servers are stand-alone services that run on your private or public network and wrap your trained estimator in an API that can be queried locally or over the network in real-time using standard protocols. In addition, the library provides async-compatible client implementations for making queries to the server from your PHP applications.

Rubix 50 Aug 15, 2022