Skip to main content

A Python wrapper for Blizzard API

Project description

blizzardapi2

GitHubPytestDependabotCodeQLCode style: black

blizzardapi2 is a client library for Blizzard's APIs. It's a fork of the original library.

Current supported features include:

  • Battle.net User
  • WoW Profile
  • WoW Game Data
  • WoW Classic Game Data
  • Diablo 3 Community
  • Diablo 3 Game Data
  • Hearthstone Game Data
  • Starcraft 2 Community
  • Starcraft 2 Game Data

Type hints have been added as well.

To gain access to Blizzard's API please register here to obtain a client id and client secret.

For more information on Blizzard's API visit:

Official Documentation
Official API Forum

Requirements

Python (3.9, 3.10, 3.11)

Installing

pip install blizzardapi2

Example

main.py

from blizzardapi2 import BlizzardApi

api_client = BlizzardApi("client_id", "client_secret")

# Unprotected API endpoint
categories_index = api_client.wow.game_data.get_achievement_categories_index("us", "en_US")

# Protected API endpoint
summary = api_client.wow.profile.get_account_profile_summary("us", "en_US", "access_token")

# Wow Classic endpoint
connected_realms_index = api_client.wow.game_data.get_connected_realms_index("us", "en_US", is_classic=True)

Access token vs Client ID/Client Secret

You can pass in a client_id and client_secret and use almost any endpoint except for a few that require an access_token obtained via OAuth authorization code flow. You can find more information at https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow.

Here is the list of endpoints, specified by Blizzard, that require an OAuth token.

GET /oauth/userinfo
GET /profile/user/wow
GET /profile/user/wow/protected-character/{realm-id}-{character-id}
GET /profile/user/wow/collections
GET /profile/user/wow/collections/pets
GET /profile/user/wow/collections/mounts

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

blizzardapi2-1.0.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

blizzardapi2-1.0.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file blizzardapi2-1.0.0.tar.gz.

File metadata

  • Download URL: blizzardapi2-1.0.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for blizzardapi2-1.0.0.tar.gz
Algorithm Hash digest
SHA256 59793101c8c87aefdff4c5935cb7b11f599345fba2f67f6bf7e1ead9b8057abe
MD5 d0ab0af2e0e14875bd7f0ba4d46e42d6
BLAKE2b-256 0a34af1ea57b8bbef002e0f135ac0b55fadd8575c49dd49770d452a57c382f17

See more details on using hashes here.

File details

Details for the file blizzardapi2-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: blizzardapi2-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for blizzardapi2-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6887b2976cdad125faa9c79a981b33a81e8d87e9771cd24ee2a6c59359a2f18
MD5 e03d24bbdf83337fd1495cc5867825f0
BLAKE2b-256 e942105d5b3fd4c95c8e5378b317474050006ba59f25aedc0488c8e63884a723

See more details on using hashes here.

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