Skip to content

Latest commit

 

History

History
81 lines (58 loc) · 1.94 KB

README.md

File metadata and controls

81 lines (58 loc) · 1.94 KB

Gamedig API

Get information about your favorite server without enter ingame

GitHub

How To Use   |    License


ℹ️ How To Use

To clone and run this application, you'll need Git, Node.js v10.16 or higher + Yarn v1.13 or higher installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/vitogd/gamedig-api gamedig-api

# Go into the repository
$ cd gamedig-api

# Install dependencies
$ npm install

# Run the api
$ npm run start:dev

The default port is 3000, you can change it editing the server.js file:

const port = process.env.PORT || 3000; // change the 3000 to your favorite port

How to get the information?

Base URL: localhost:3000/

Method Endpoint Params Return
GET /info/ game, ip, port server info object

List of supported games

The param port is optional depending of the game.

Example usage:

GET localhost:3000/info/?game=css&ip=177.54.144.126&port=27212

Return:

{
    "info": {
        "name": "HyperHops [WL]",
        "map": "bhop_malabar7",
        "password": false,
        "raw": {14 items},
        "maxplayers": 12,
        "players": [1 item],
        "bots": [1 item],
        "connect": "177.54.144.126:27212",
        "ping": 30
    }
}

📝 License

This project is under the MIT license. See the LICENSE for more information.