A Python based SDK for the Nitrado RESTful API published at PyPI.
To have access to this application you must have an account created at Nitrado and create an API key.
1. Introduction
Shows how to get access to your API key.
Shows how to log in to the client and use the basic code interface
3. Services
Data provided outside of the game server. Like server status, user id, and auto extension plan.
4. GameServer
Data directly related to the game server. This includes the player list, game settings, etc.
In your terminal install the nitrado package with pip.
pip install nitradoTo begin using the API the Client must first be connected to your Nitrado account. Once connected to the client, you should have access to any of the API calls.
from nitrado import NitradoAPI
NitradoAPI.initialize_client("your-api-key")
api = NitradoAPI()or
from nitrado import NitradoAPI
api = NitradoAPI("your-api-key")This example highlights how to get the service.
from nitrado import NitradoAPI
api = NitradoAPI("your-api-key")
services = api.services
print(services)[
<Service(id=1011111, username='ni11111_1', details={'address': '111.111.111.111:9996', 'name': '[API] My-Server-1', 'game': 'ARK: Survival Evolved (Xbox One)', 'portlist_short': 'arkxb', 'folder_short': 'arkxb', 'slots': 70})>,
<Service(id=1011112, username='ni11111_1', details={'address': '111.111.111.112:9996', 'name': '[API] My-Server-2', 'game': 'ARK: Survival Evolved (Xbox One)', 'portlist_short': 'arkxb', 'folder_short': 'arkxb', 'slots': 70})>,
<Service(id=1011113, username='ni11111_1', details={'address': '111.111.111.113:9996', 'name': '[API] My-Server-3', 'game': 'ARK: Survival Evolved (Xbox One)', 'portlist_short': 'arkxb', 'folder_short': 'arkxb', 'slots': 70})>
]This example highlights how to get the gameserver.
from nitrado import NitradoAPI
api = NitradoAPI("your-api-key")
gameserver = api.game_servers
print(gameserver)[
<GameServer(service_id=11111111, status='started', query={'server_name': '[API] My-Server-1', 'connect_ip': '111.111.111.111:9996', 'map': 'LostIsland', 'version': '943.10', 'player_current': 0, 'player_max': 70, 'players': []})>,
<GameServer(service_id=11111112, status='started', query={'server_name': '[API] My-Server-2', 'connect_ip': '111.111.111.112:9996', 'map': 'Ragnarok', 'version': '943.10', 'player_current': 0, 'player_max': 70, 'players': []})>,
<GameServer(service_id=11111113, status='started', query={'server_name': '[API] My-Server-3', 'connect_ip': '111.111.111.113:9996', 'map': 'TheIsland', 'version': '943.10', 'player_current': 0, 'player_max': 70, 'players': []})>
]