This application accesses the Nitrado API.
Reason this release was yanked:
unstable
Project description
Python Nitrado API
This API accesses the Nitrado API found at Nitrado API
Overview
To have access to the Nitrado you must have an account created at Nitrado and create an API key.
Wiki - Full documentation
Table of contents
1. Introduction
Shows how to get access to your API key.
2. Getting Started
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.
Connect to Client
To 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 src.example_package.nitrado_api import NitradoAPI
NitradoAPI.initialize_client("https://api.nitrado.net/", "your-api-key.txt")
api = NitradoAPI()
or
from src.example_package.nitrado_api import NitradoAPI
api = NitradoAPI("https://api.nitrado.net/", "your-api-key.txt")
Services
This example highlights how to get the service.
from src.example_package.nitrado_api import NitradoAPI
api = NitradoAPI("https://api.nitrado.net/", "your-api-key.txt")
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})>
]
GameServer
This example highlights how to get the gameserver.
from src.example_package.nitrado_api import NitradoAPI
api = NitradoAPI("https://api.nitrado.net/", "your-api-key.txt")
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': []})>
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.