OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
181 stars 47 forks source link

Which api can get game play time? #91

Open Asteroidxx opened 2 years ago

Asteroidxx commented 2 years ago

I had get user's game list form request "https://titlehub.xboxlive.com:443/users/xuid(xuid)/titles/titlehistory/decoration/achievement,image,scid" and get many detail, but I can't found play duration in each game. How can i get it?

Please,Appreciate!

JeahWan commented 1 year ago

I had get user's game list form request "https://titlehub.xboxlive.com:443/users/xuid(xuid)/titles/titlehistory/decoration/achievement,image,scid" and get many detail, but I can't found play duration in each game. How can i get it?

Please,Appreciate!

Hello brother, have you found this API? I also need it very much. If you find it, please let me know. Thank you very much!!!

stelemanuele77 commented 3 months ago

To get playtime you need to do a POST request to https://userstats.xboxlive.com/batch Headers:

Authorization: XBL3.0 Token
X-Xbl-Contract-Version: 2

Content: {"arrangebyfield":"xuid","xuids":["XUID_HERE"],"stats":[{"name":"MinutesPlayed","titleId":"TITLEID_1"},{"name":"MinutesPlayed","titleId":"TITLEID_2"}]}