1. Request Syntax

To access the TOP-GTA API method, you need to perform a GET request of this type:

https://top-gta.com/api?act=METHOD_NAME?PARAMETERS


It consists of several parts:

  • METHOD_NAME (Required) — the name of the API method you want to access.
  • PARAMETERS (Optional) — input parameters of the corresponding API method

Parameters can only be transmitted using the GET method


For example, we call the getServerInfo method gets information about the server
https://top-gta.com/api?act=getServerInfo&serverId=ID
Result in JSON format::
{
    "id":"40",
    "name":"[RU] Appi RolePlay | MilkyWay :)",
    "mp":"2",
    "lang":"RU",
    "type":"1",
    "players":"44",
    "slots":"200",
    "address":"appi-rp.com:4490",
    "verified":"1",
    "website":"https:\/\/appi-rp.com\/",
    "rating":"11",
    "description":"",
    "create_date":"1507132134",
    "update_date":"1508000412"
}
2. Get server id
https://top-gta.com/api?act=getServerId&name=SERVER_NAME
  • act (Required)
  • name (Required) — u can use not full server name, like search
Result in JSON format:
[
    {
        "id":"39",
        "name":"[RU | VOICE] Appi RolePlay | Pluto :3",
        "address":"appi-rp.com:4491"
    },
    {
        "id":"40",
        "name":"[RU] Appi RolePlay | MilkyWay :)",
        "address":"appi-rp.com:4490"
    },
    {
        "id":"1696",
        "name":"Derpalicious World Of Happiness!",
        "address":"174.113.71.251:30120"
    }
]
3. Get server info
https://top-gta.com/api?act=getServerInfo&serverId=ID
  • act (Required)
  • serverId (Required) — server id, use getServerId action if u wanna know server id

Types
  • 0  — Unknown
  • 1  — Role Play
  • 2  — Death Match
  • 3  — Drift
  • 4  — Tycoon / PVE / Simulator
  • 5  — Simulator
  • 6  — Zombie

Result in JSON format:
{
    "id":"40",
    "name":"[RU] Appi RolePlay | MilkyWay :)",
    "mp":"2",
    "lang":"RU",
    "type":"1",
    "players":"44",
    "slots":"200",
    "address":"appi-rp.com:4490",
    "verified":"1",
    "website":"https:\/\/appi-rp.com\/",
    "rating":"11",
    "description":"",
    "create_date":"1507132134",
    "update_date":"1508000412"
}
4. Get server stats
https://top-gta.com/api?act=getServerStats&serverId=ID&type=week
  • act (Required)
  • serverId (Required) — server id, use getServerId action if u wanna know server id
  • type (Optional) — week / day. Default: day
Result in JSON format:
[
    {"server_id":"34","players":"78","datetime":"1511427003"},
    {"server_id":"34","players":"54","datetime":"1511423403"},
    {"server_id":"34","players":"50","datetime":"1511419802"},
    {"server_id":"34","players":"68","datetime":"1511416203"},
    {"server_id":"34","players":"72","datetime":"1511412603"},
    {"server_id":"34","players":"91","datetime":"1511409003"},
    {"server_id":"34","players":"0","datetime":"1511406002"},
    {"server_id":"34","players":"106","datetime":"1511402403"},
    {"server_id":"34","players":"116","datetime":"1511398803"},
    {"server_id":"34","players":"119","datetime":"1511395203"},
    {"server_id":"34","players":"1","datetime":"1511391603"},
    {"server_id":"34","players":"127","datetime":"1511388003"},
    {"server_id":"34","players":"151","datetime":"1511384403"},
    {"server_id":"34","players":"170","datetime":"1511380803"},
    {"server_id":"34","players":"2","datetime":"1511377203"},
    {"server_id":"34","players":"170","datetime":"1511373603"},
    {"server_id":"34","players":"170","datetime":"1511370003"},
    {"server_id":"34","players":"168","datetime":"1511366403"},
    {"server_id":"34","players":"4","datetime":"1511362804"},
    {"server_id":"34","players":"153","datetime":"1511359203"},
    {"server_id":"34","players":"170","datetime":"1511355603"},
    {"server_id":"34","players":"141","datetime":"1511352002"},
    {"server_id":"34","players":"1","datetime":"1511348403"}
]
5. Get multuplayer info
https://top-gta.com/api?act=getMpInfo&mpId=ID
  • act (Required)
  • mpId (Optional) — default: 0

Multiplayer Ids
  • 0  — All
  • 2  — GTMP
  • 3  — GTA:Network
  • 4  — Rage
  • 5  — FiveM
  • 7  — SA:MP

Result in JSON format:
{"mpId":"5","countServers":"4501","countPlayers":"1014","countSlots":"129064"}
6. Get vote info
https://top-gta.com/api?act=getVoteInfo&voteId=ID
  • act (Required)
  • mpId (Required)

Result in JSON format:
{"id":"259","server_id":"70","cookie":"1507124133343637382","ip":"128.72.190.40","user_id":"1","nickname":"Test Name","update_date":"1520389937"}
7. Vote with callback
https://top-gta.com/vote{SERVER ID}?domain=example.com&ssl=true&nickname=NickName
  • SERVER ID (Required) - your server ID
  • domain (Required) - your domain with URI
  • ssl (Optional) — default: http
  • nickname (Optional) — its user nickname, if you wanna give bonus on your server

Example:
https://top-gta.com/vote70?domain=example.com&ssl=true&nickname=Test Name

Callback:
  • success  true / false
  • voteId  if success - true
https://example.com/?success=true&voteId=259

Check vote:
https://top-gta.com/api?act=getVoteInfo&voteId=259

Result in JSON format:
{"id":"259","server_id":"70","cookie":"1507124133343637382","ip":"128.72.190.40","user_id":"1","nickname":"Test Name","update_date":"1520389937"}