https://github.com/scriptlinestudios/leaderboards
Simple leaderboard API
https://github.com/scriptlinestudios/leaderboards
api flask flask-sqlalchemy leaderboard python
Last synced: 11 months ago
JSON representation
Simple leaderboard API
- Host: GitHub
- URL: https://github.com/scriptlinestudios/leaderboards
- Owner: ScriptLineStudios
- License: gpl-3.0
- Created: 2022-01-16T14:26:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-24T19:33:45.000Z (about 4 years ago)
- Last Synced: 2025-01-31T09:45:27.678Z (about 1 year ago)
- Topics: api, flask, flask-sqlalchemy, leaderboard, python
- Language: Python
- Homepage: https://leaderboards.pythonanywhere.com/
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Leaderboard API v0.1
==============
Leaderboards is a simpole leaderboards api that allows you to make GET/POST requests to a leaderboard server which will manage the board.
Getting Started
==============
To get started head over to https://leaderboards.pythonanywhere.com/ and and create a new leaderboard. This will give you an api key which will allow you to access to the api. **Keep this key safe** as it will allow for new entries to be made to your board. To make a new entry make a POST request to the following endpoint: https://leaderboards.pythonanywhere.com/add/ an example of a request in Python:
```
import requests
requests.post("https://leaderboards.pythonanywhere.com/add?apiKey=YOUR_API_KEY&data=NAME_OF_ENTRY&scores=THEIR_SCORE")
```
The leaderboard can then be viewed at: https://leaderboards.pythonanywhere.com/leaderboard/YOUR_LEADERBOARD_NAME alternativly you might want to grab the leaderboards contents to display directly in your game. This can be done by making a GET request to the endpoint. An example of the request being made in Python:
```
import requests
data = requests.get("https://leaderboards.pythonanywhere.com/add?apiKey=YOUR_API_KEY")
print(data.content)
```
From there the data can be formatted to be displayed in any way you like.
https://user-images.githubusercontent.com/85095943/151555501-98845d3f-f9ad-48c2-a9bd-2cf301a18553.mov