Skip to main content

A Python wrapper for Blizzard API

Project description

blizzardapi2

GitHubPython packageDependabot UpdatesCodeQL

blizzardapi2 is a client library for Blizzard's APIs. It's a fork of the original library and I'm trying to update it and keep its packages managed.

It currently has the exact same functionality as the original version, but with updated dependencies. As I go through Blizzard's API categories, I'll update the library as necessary.

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

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-0.1.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

blizzardapi2-0.1.2-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blizzardapi2-0.1.2.tar.gz
  • Upload date:
  • Size: 11.9 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-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b240797c2457af29ba91c5a7f7bb32b9009312bcff5441655cf97636c933afb9
MD5 b518167d4a7ebbe2b5d640c6e58ad7bf
BLAKE2b-256 9e278bf8d4fa476f1e67f8adf176c0271e1f2f1762e4b851ba4363dde7e9b051

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blizzardapi2-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.4 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-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b05a7d6d91ce72cb36e213ff1faef32e938787a1c8d5c6342ff0514db8a6077
MD5 88d5485a5ec4857bd3c70b0e3cb2e20d
BLAKE2b-256 8c54ae308d74bf22f253387d35cf47c00e1b7139637157ee4f181bb390f9f5cb

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