A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
Clone or download
Latest commit 0a39578 Nov 14, 2018



Latest Version Documentation Status https://travis-ci.org/OpenXbox/xbox-webapi-python.svg?branch=master Discord chat channel

Xbox-WebAPI is a python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.

Authentication via credentials or tokens is supported, Two-Factor-Authentication ( 2FA ) is also possible.


  • Python >= 3.5
  • Libraries: requests, demjson, appdirs, urwid

How to use


pip install xbox-webapi


# Token save location: If tokenfile is not provided via cmdline, fallback
# of <appdirs.user_data_dir>/tokens.json is used as save-location
# Specifically:
# Windows: C:\\Users\\<username>\\AppData\\Local\\OpenXbox\\xbox
# Mac OSX: /Users/<username>/Library/Application Support/xbox/tokens.json
# Linux: /home/<username>/.local/share/xbox
# For more information, see: https://pypi.org/project/appdirs and module: xbox.webapi.scripts.constants

xbox-authenticate --tokens tokens.json --email no@live.com --password abc123

# NOTE: If no credentials are provided via cmdline, they are requested from stdin
xbox-authenticate --tokens tokens.json

# If you have a shell compatible with ncurses, you can use the Terminal UI app
xbox-auth-ui --tokens tokens.json

Fallback Authentication:

# In case this authentication flow breaks or you do not trust the code with your credentials..
# Open the following URL in your web-browser and authenticate

# Once you finished auth and reached a blank page, copy the redirect url from your browser address-field
# Execute the script with supplied redirect url
xbox-auth-via-browser 'https://login.live.com/oauth20_desktop.srf?...access_token=...&refresh_token=...'

API usage:

# Search Xbox One Catalog
xbox-searchlive --tokens tokens.json "Some game title"

# Search Xbox 360 Catalog
xbox-searchlive --tokens tokens.json -l "Some game title"


Here you can see the Auth TUI (Text user interface):



Known issues

  • There are a lot of missing XBL endpoints


  • Report bugs/suggest features
  • Add/update docs
  • Add additional xbox live endpoints


This package uses parts of Cookiecutter and the audreyr/cookiecutter-pypackage project template. The authentication code is based on joealcorn/xbox

Informations on endpoints gathered from:


Xbox, Xbox One, Smartglass and Xbox Live are trademarks of Microsoft Corporation. Team OpenXbox is in no way endorsed by or affiliated with Microsoft Corporation, or any associated subsidiaries, logos or trademarks.