Package: get-wow-data-async
THIS README IS NOT UPDATED TO 0.2.0.0get-wow-data-asyncget-wow-data-asyncimplements asynchronous requests to the World of Warcraft (WoW) APIs so you don't have to.Example: Get the value of all auctions from the Winterhoof server.importgetwowdataasyncimportasyncioasyncdefmain():us_api=awaitgetwowdataasync.WowApi.create('us')#regionwinterhoof_auctions=awaitus_api.get_auctions(4)#4 = Winterhoof's connected realm idawaitus_api.close()#close aiohttp session after queries are donetotal_value=0foriteminwinterhoof_auctions['auctions']:ifitem.get('unit_price'):total_value+=item.get('unit_price')elifitem.get('buyout'):total_value+=item.get('buyout')elifitem.get('bid'):total_value+=item.get('bid')print(getwowdataasync.as_gold(total_value))#prints 430,846,968g 67s 00casyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())asyncio.run(main())FeaturesMuch faster then my other synchronous get-wow-data package.
Supported APIs. (seethisfor a complete list of APIs provided by blizzard. Not all are consumeable, currently, by get-wow-data-async)Connected RealmsItemsIconsAuctionsProfessionsRecipesIconsWow TokenInstallingget-wow-data-async is avilable on PyPi:$python-mpipinstallgetwowdataasyncSetupTo access any blizzard API you need a Client Id and Client Secret.Go tohttps://develop.battle.net/Click on Get started and login.Now click create client and fill out the form.You now have a Client Id and Client Secret to query Blizzards APIsRemember not to commit your wow_api_secret!Set wow_api_id and wow_api_secret as environment variables andget-wow-data-asyncwill read these credentials from there.Setting the client id and secret as an environment variabledotenv is used inside WowApi.create() to get your client id and secret.Create a file called .envSet wow_api_id andwow_api_secretwow_api_id = x
wow_api_secret = yNow WowApi.create() will use those variabels to get an access token for future requests.APISeedocumentation sitefor the API.Notes on the dataVisithttps://develop.battle.net/documentation/world-of-warcraftfor blizzard official documentation.Below are notes that i've gathered from the documentation, reading the returned data, and
from forum posts/reddit.Reading jsonUsing a normal print() on response.json() outputs gibberish.
I recommend either the pprint module or viewing the json fromthis listof all the available APIs.Href'sThe href's in the json are links to related elements. One of the links will be to the url that produced that data.PricesThe prices or value of an item is in the following format g*sscc, where g = gold, s = silver, c = copper.
Silver and copper are fixed in the last 4 decimal spaces whlie gold can be as any number of spaces before silver. So 25289400 is 2528g 94s 00c.buyout vs unit_priceStackable items have a single unit_price while unique items like weapons have a bid/buyout price.Item bonus listThe item bonus list are the modifiers applied to an item, such as the level its scaled to. Blizzard does not make the bonus values and their corresponding effects available through an API. (Boo)Versions of an item with different bonuses can be found onwowhead. Mouse over select version and pick your desired version from the drop down menu.Item contextWhere the item was created. Incomplete listContextValue1Normal Dungeon5Heroic Raid11Quest Reward14Vendor15Black MarketItem modifiersNo ideaParameter CheatsheetIncomplete listRegionNamespacelocale (language)usstatic-{region}en_USeudynamic-{region}es_MXkrprofile-{region}pt_BRtwde_DEcnen_GBes_ESfr_FRit_ITru_RUko_KRzh_TWzh_CNFeedbackFeel free tofile an issue.I'm currently teaching myself how to code, so, if you have any suggestions or corrections I would really appriciate it!LicenseMITRelated projectI was writing this formy WoW profession profit calculatorsite.Hopefully you'll find this useful!