|
1 | 1 | # python-wowapi |
2 | 2 |
|
| 3 | + |
| 4 | +[]( [](https://pypi.org/project/python-wowapi/)) |
| 5 | +[](https://pypi.org/project/python-wowapi/) |
3 | 6 | [](https://cloud.drone.io/lockwooddev/python-wowapi) |
4 | 7 |
|
| 8 | + |
| 9 | + |
5 | 10 | Python-wowapi is a client library for interacting with the World of Warcraft |
6 | | -Community API. |
| 11 | +Community and Game Data API. |
| 12 | + |
| 13 | +To interact with this library, you need to first get a client-id and client secret by registering [here](https://develop.battle.net/access) |
7 | 14 |
|
8 | | -Documentation about installing and usage can be found at [python-wowapi.readthedocs.org](https://python-wowapi.readthedocs.org) |
| 15 | +For more information about official World of Warcraft API's visit: |
| 16 | +[Official API documentation](https://develop.battle.net/documentation) |
| 17 | +[Official API Forum](https://us.battle.net/forums/en/bnet/15051532/) |
| 18 | + |
| 19 | +API documentation can be found at [python-wowapi.readthedocs.org](https://python-wowapi.readthedocs.org). Examples and installation instructions are documented here. |
9 | 20 |
|
10 | 21 | ## Installing |
11 | 22 |
|
12 | 23 | ```bash |
13 | 24 | pip install python-wowapi |
14 | 25 | ``` |
15 | 26 |
|
16 | | -## Usage |
| 27 | +## API instance |
17 | 28 |
|
18 | 29 | ```python |
19 | 30 | import os |
20 | 31 |
|
21 | 32 | from wowapi import WowApi |
22 | 33 |
|
23 | | - |
24 | 34 | api = WowApi(os.environ['WOW_CLIENT_ID'], os.environ['WOW_CLIENT_SECRET']) |
25 | | -data = api.get_auctions('eu', 'silvermoon', locale='de_DE') |
26 | | -print(data) |
27 | 35 | ``` |
28 | 36 |
|
| 37 | +## Community API example |
| 38 | + |
| 39 | +```python |
| 40 | +api.get_auctions('eu', 'silvermoon', locale='de_DE') |
| 41 | +``` |
| 42 | + |
| 43 | + |
| 44 | +## Game Data API examples |
| 45 | + |
| 46 | + |
| 47 | +### Get token price |
| 48 | +```python |
| 49 | +api.get_token('eu', namespace='dynamic-eu', locale='de_DE') |
| 50 | +``` |
| 51 | + |
| 52 | +### Get class specializations and detail specialization resource |
| 53 | +```python |
| 54 | +data = api.get_playable_specializations('us', namespace='static-us') |
| 55 | + |
| 56 | +spec_id = data['character_specializations'][0]['id'] |
| 57 | +specialization = api.get_playable_specialization('us', namespace='static-us', spec_id=spec_id) |
| 58 | +``` |
| 59 | + |
| 60 | +### Get game data resource by url |
| 61 | + |
| 62 | +This example shows how to fetch a game data resource by url. |
| 63 | +The `get_data_resource` method will take care of adding your access_token to the url. |
| 64 | + |
| 65 | +```python |
| 66 | +api.get_data_resource('https://eu.api.blizzard.com/data/wow/connected-realm/509?namespace=dynamic-eu', region='eu') |
| 67 | +``` |
| 68 | + |
| 69 | + |
29 | 70 | ## Development & Testing |
30 | 71 |
|
31 | 72 | ```bash |
|
0 commit comments