New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

xboxapi

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xboxapi

XBOX One API

pipPyPI
Version
2.0.1
Maintainers
1

Description

This is a Python wrapper for the unofficial Xbox API

Build Status

Installation

For now you will have to install manually, as I didn't upload the initial version to pypi (pip).

  • Clone this repo
  • Place the xboxapi directory in your project

The only dependency is requests library.

Usage

This is a basic example of how to create a client and fetch a gamers profile information from their gamertag.

from xboxapi import Client

client = Client(api_key=<api_key>)
gamer = client.gamer('voidpirate')

profile = gamer.get('profile')

Client class constructor takes the following optional arguments except api_key.

ArgumentValueShort Description
api_keystringapi token from Xbox API
timeoutinthow long until the request times out (seconds)
langstringcountry language code (e.g. for German (de-DE))

Client class public methods.

MethodValueOptionalShort Description
gamer(gamertag=<string>)stringxuid=<string>gamertag to lookup
calls_remaining()n/an/aReturn headers about api rate limits

A note about the gamer method. If you already know the gamers xuid you can use that instead to avoid an additional api call when using only a gamertag.

Gamer class public methods, returned from gamer method in Client.

MethodValueOptionalShort Description
get(method=<string>)stringterm=<string>API calls.
send_message(message=<string>)stringn/aSend a message to gamer
send_activity(message=<string>)stringn/aUpdate your activity feed with a message

Pagination is supported in this client and all handled through get method. It works by detecting the response header for pagination, any subsequent calls to the same api endpoint will return paged data. If another api call is made to a different endpoint, the pagination token will be cleared and results will not be paged.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts