NAV Navbar
shell

Introduction

Welcome to the official Dino Panel API documentation! Currently, you can use our API to access and manage your server's information.

We have examples in Shell (and JavaScript soon to come)! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

To make an authenticated request, you can use the following code:

curl "https://dino.gg/api/client/ENDPOINT" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE"

Make sure to replace KEYHERE with your API key, and ENDPOINT with your desired endpoint chosen from below.

We use API keys to allow access to the API. You can create a new API key in the Security Controls tab on the left on dino.gg, or by following this link.

All API requests are done to the base URL of:

https://dino.gg/api/client/ENDPOINT

Our API expects for the API key to be included in each API requests to the server in a header that looks like the following:

Authorization: Bearer KEYHERE

You also need to set the Content-Type header to application/json to receive responses from the API in JSON:

Content-Type: application/json

And finally add Accept header that's set to application/vnd.dinopanel.v1+json:

Accept: application/vnd.dinopanel.v1+json

Servers

Each server's ID can be found through the URL when viewing their console, usually in the format of:

https://dino.gg/server/ABCDEFGH

Where ABCDEFGH is the server's ID.

Get All Servers

curl "https://dino.gg/api/client/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE"

The above command returns JSON structured like this:

{
    "object": "list",
    "data": [
        {
            "object": "server",
            "attributes": {
                "server_owner": true,
                "identifier": "5d4bb573",
                "name": "my server",
                "description": "a",
                "limits": {
                    "memory": 2048,
                    "swap": 0,
                    "disk": 5000,
                    "io": 500,
                    "cpu": 75
                },
                "feature_limits": {
                    "databases": 4
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

This endpoint retrieves all servers.

HTTP Request

GET https://dino.gg/api/client/

Data

The response's data will contain an array of server objects.

Pagination

You can check if there are more servers to display using the meta.pagination data provided in the request.

To check the next page, you can append at end of the URL ?page=NUMBER and replace NUMBER with the desired page to load.

Get a Specific Server

curl "https://dino.gg/api/client/servers/<ID>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE"

The above command returns JSON structured like this:

{
    "object": "server",
    "attributes": {
        "server_owner": true,
        "identifier": "5d4bb573",
        "name": "my server",
        "description": "a",
        "limits": {
            "memory": 2048,
            "swap": 0,
            "disk": 5000,
            "io": 500,
            "cpu": 75
        },
        "feature_limits": {
            "databases": 4
        }
    }
}

This endpoint retrieves a specific server.

HTTP Request

GET https://dino.gg/api/client/servers/<ID>

Data

The response will be a server object.

Get Server Resource Usage

curl "https://dino.gg/api/client/servers/<ID>/utilization" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE"

The above command returns JSON structured like this:

{
    "object": "stats",
    "attributes": {
        "state": "off",
        "memory": {
            "current": 0,
            "limit": 2048
        },
        "cpu": {
            "current": 0,
            "cores": [],
            "limit": 75
        },
        "disk": {
            "current": 0,
            "limit": 5000
        },
        "players": {
            "current": 1,
            "limit": 32
        },
        "query": {
            "info": {
                "protocol": 17,
                "name": "Garry's Mod Server hosted by Crident",
                "map": "gm_flatgrass",
                "folder": "garrysmod",
                "game": "Sandbox",
                "appid": 4000,
                "players": 1,
                "maxplayers": 32,
                "bots": 0,
                "servertype": "d",
                "environment": "l",
                "password": 0,
                "secure": 1,
                "version": "19.02.18",
                "port": 27015,
                "steamID": -1723883520,
                "steamIDUpper": 20983901,
                "keywords": " gm:sandbox",
                "gameID": 4000
            },
            "players": [
                {
                    "index": 0,
                    "name": "Trixter - crident",
                    "score": 0,
                    "online": 506.78546142578125
                }
            ]
        }
    }
}

This endpoint retrieves server's resource usage.

HTTP Request

GET https://dino.gg/api/client/servers/<ID>/utilization

Data

The response will be a stats object.

Endpoint Ratelimit

This endpoint is limited to 15 requests/minute.

Send Power Request

curl "https://dino.gg/api/client/servers/<ID>/power" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE" \
  -X POST \
  -d '{"signal": "start"}'

The above command returns HTTP 204 with empty body.

This endpoint sends a power change request to the server.

HTTP Request

POST https://dino.gg/api/client/servers/<ID>/power

Request Parameters

The request data must be in the JSON format, with the following data:

Parameter Description
signal The signal to send, can be one of: start, stop, restart or kill

Data

This API endpoint returns HTTP 204 with empty body.

Send Command Request

curl "https://dino.gg/api/client/servers/<ID>/command" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.dinopanel.v1+json" \
  -H "Authorization: Bearer KEYHERE" \
  -X POST \
  -d '{"command": "say hello world"}'

The above command returns HTTP 204 with empty body.

This endpoint executes a console command on the server.

HTTP Request

POST https://dino.gg/api/client/servers/<ID>/command

Request Parameters

The request data must be in the JSON format, with the following data:

Parameter Description
command The command to run.

Data

This API endpoint returns HTTP 204 with empty body.

Objects

Server

{
    "object": "server",
    "attributes": {
        "server_owner": true,
        "identifier": "5d4bb573",
        "name": "my server",
        "description": "a",
        "limits": {
            "memory": 2048,
            "swap": 0,
            "disk": 5000,
            "io": 500,
            "cpu": 75
        },
        "feature_limits": {
            "databases": 4
        }
    }
}

Attributes

Parameter Type Description
server_owner boolean Value is true, if the current API key user is the owner of the server.
identifier string The identifier of the server used in URL and in the API.
name string The name of the server.
description string The description of the server.
limits.memory integer The maximum amount of memory the server can use.
limits.swap integer The maximum amount of swap the server can use.
limits.disk integer The maximum amount of disk space the server can use.
limits.io integer The IO weight for the server.
limits.cpu integer The maximum amount of CPU the server can use.
feature_limits.databases integer The amount of databases the server can have.

Stats

{
    "object": "stats",
    "attributes": {
        "state": "off",
        "memory": {
            "current": 0,
            "limit": 2048
        },
        "cpu": {
            "current": 0,
            "cores": [],
            "limit": 75
        },
        "disk": {
            "current": 0,
            "limit": 5000
        },
        "players": {
            "current": 1,
            "limit": 32
        },
        "query": {
            "info": {
                "protocol": 17,
                "name": "Garry's Mod Server hosted by Crident",
                "map": "gm_flatgrass",
                "folder": "garrysmod",
                "game": "Sandbox",
                "appid": 4000,
                "players": 1,
                "maxplayers": 32,
                "bots": 0,
                "servertype": "d",
                "environment": "l",
                "password": 0,
                "secure": 1,
                "version": "19.02.18",
                "port": 27015,
                "steamID": -1723883520,
                "steamIDUpper": 20983901,
                "keywords": " gm:sandbox",
                "gameID": 4000
            },
            "players": [
                {
                    "index": 0,
                    "name": "Trixter - crident",
                    "score": 0,
                    "online": 506.78546142578125
                }
            ]
        }
    }
}

Attributes

Parameter Type Description
state string The current state of the server, possible values: on, starting, stopping, off.
memory.current integer The current memory usage. (0, if server is offline)
memory.limit integer The maximum amount of memory the server can use.
cpu.current integer The current CPU usage. (0, if server is offline)
cpu.cores array The CPU usage per each machine's thread. (empty, if server is offline)
cpu.limit integer The maximum amount of CPU the server can use.
disk.current integer The current disk space usage. (0, if server is offline)
disk.limit integer The maximum amount of disk space the server can use.
players.current integer The current amount of players on the server. (0, if server is offline)
players.limit integer The maximum amount of players the server can have. (0, if server is offline)
query QueryData The QueryData object returned by the game's query API. (empty, if server is offline)

QueryData

Depending on the game, you're gonna be returned with different type of QueryData.

Source Engine

For Source Engine based games, it's in the following format:

{
    "info": {
        "protocol": 17,
        "name": "Garry's Mod Server hosted by Crident",
        "map": "gm_flatgrass",
        "folder": "garrysmod",
        "game": "Sandbox",
        "appid": 4000,
        "players": 1,
        "maxplayers": 32,
        "bots": 0,
        "servertype": "d",
        "environment": "l",
        "password": 0,
        "secure": 1,
        "version": "19.02.18",
        "port": 27015,
        "steamID": -1723883520,
        "steamIDUpper": 20983901,
        "keywords": " gm:sandbox",
        "gameID": 4000
    },
    "players": [
        {
            "index": 0,
            "name": "Trixter - crident",
            "score": 0,
            "online": 506.78546142578125
        }
    ]
}

Attributes

Parameter Type Description
info SourceInfo Basic information of the server returned by A2S_INFO
players SourcePlayers Player information of the server returned by A2S_PLAYERS

SourceInfo

You can find the response format documentation in the Valve's Server Query Documentation.

SourcePlayers

You can find the response format documentation in the Valve's Server Query Documentation.

Minecraft

For Minecraft, it's in the following format:

{
    "query": {
        "info": {
            "type": 0,
            "hostname": "A Minecraft Server",
            "gametype": "SMP",
            "game_id": "MINECRAFT",
            "version": "1.13.2",
            "plugins": "",
            "map": "world",
            "numplayers": "1",
            "maxplayers": "20"
        },
        "players": [
            "Trixter"
        ]
    }
}

Attributes

Parameter Type Description
info MCInfo Basic information of the server returned by full stat request
players MCPlayers Player information of the server returned by full stat request

MCInfo

You can find the response format documentation in the Minecraft Query Documentation.

MCPlayers

An array of player names.

Ratelimit

The API is ratelimited to 60 requests/minute. Some endpoints may have stricter limits, and have separate ratelimit section with details.

In case of a ratelimit, you will receive the HTTP code 429. There will be also additional X-RateLimit-Reset header included indicating when the ratelimit will expire. All of the available ratelimit headers are:

Header Description
X-RateLimit-Limit The amount of requests you can do per minute.
X-RateLimit-Remaining The amount of remaining requests until you hit the ratelimit.
X-RateLimit-Reset UNIX timestamp of when the ratelimit expires.

Errors

We use the following error codes to indicate an error or an issue with the request:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- You didn't provide an API key or it was in wrong format.
403 Forbidden -- You do not have the permission to do this action.
404 Not Found -- The specified object could not be found.
405 Method Not Allowed -- You tried to access an object with an invalid method.
412 Precondition Failed -- The object you're trying to access isn't able to do this. (e.g. run a command on a server because it isn't running)
429 Too Many Requests -- You're doing too many requests, you've been ratelimited.
500 Internal Server Error -- We had a problem with our server. Contact us through a support ticket or Discord.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
504 DaemonConnectionException -- The daemon responsible for managing the server isn't answering our requests. Contact us through a support ticket or Discord.