Skip to main content

This application accesses the Nitrado API.

Project description

Python Nitrado SDK

Testing

A Python based SDK for the Nitrado RESTful API published at PyPI.

Overview

To have access to this application 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.


Installation

In your terminal install the nitrado package with pip.

pip install nitrado

Examples

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 nitrado import NitradoAPI

NitradoAPI.initialize_client("your-api-key")
api = NitradoAPI()

or

from nitrado import NitradoAPI

api = NitradoAPI("your-api-key")

Services

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})>
]

GameServer

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': []})>
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nitrado-0.0.9.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

nitrado-0.0.9-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page