A Python wrapper for Blizzard API
Project description
blizzardapi2
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
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.
Source Distribution
Built Distribution
File details
Details for the file blizzardapi2-0.1.3.tar.gz
.
File metadata
- Download URL: blizzardapi2-0.1.3.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d225a5f92592911db01db3843aa2b6fc0610a80993f4e80f39f9792b9d527d |
|
MD5 | 00984e4b5c2a301c19b0cecbb5778779 |
|
BLAKE2b-256 | 86c5cb30d8ab4bdcb5dcfd4cb142d3ad3b884e49ed0a45ccbd336944295f6925 |
File details
Details for the file blizzardapi2-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: blizzardapi2-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bee9b25c1cfbc762d1a6335631c1ef387b0adf18c525af397ac73ef4267d42d |
|
MD5 | c46e27933bd0d01e0ecac2d0c77e585d |
|
BLAKE2b-256 | 8a18f397ffdaa2116d24a111126750d9e7c3a02accbc3501be3cbe06402a5c12 |