JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

"Updates, discussions, and documentation of the BungieNetPlatform API."

Request Join
originally posted in:BungieNetPlatform
10/13/2015 12:01:07 AM
2

Help accessing historical account data

New to the BungiePlatform API, but have a background in programming, so not entirely a noob. I'm attempting to develop a Python script that uses the Bapi to access a day's worth of a player's activity, both in PvE and PvP, though requested separately. I'm attempting to do this using the HistoricalStatsGet function. code: [spoiler]import requests import json from pprint import pprint HEADERS = {"X-API-Key":'[REDACTED]'} url = "http://www.bungie.net/Platform/Destiny/Stats/ActivityHistory/" #Thanks, Makeshyft pid = "2/4611686018428423229/2305843009237066429/" #Breaking these out just for ease of reading, editing. params = "?mode=AllPvE" params = params + "&daystart=2015-10-03" params = params + "&dayend=2015-10-03" params = params + "&periodType=daily" response = requests.get(url+pid+params, headers=HEADERS) activity = response.json() #print(json.dumps(activity['Response']['data']['activities], sort_keys=True, indent=3))[/spoiler] Using that, I assumed and hoped, through specifying a start and end date, I'd receive all PvE events that happened during that timeframe, however, in the response, I receive all data. [spoiler][ { "activityDetails": { "activityTypeHashOverride": 0, "instanceId": "3913097996", "mode": 3, "referenceId": 3671763238 }, "period": "2015-10-12T01:02:27Z", "values": { "activityDurationSeconds": { "basic": { "displayValue": "10m 9s", "value": 609.0 }, "statId": "activityDurationSeconds" }, "assists": { "basic": { "displayValue": "18", "value": 18.0 }, "statId": "assists" }, etc... I won't dump it all here, but it starts on the 12th of Oct (today) and goes to August.[/spoiler] Am I missing something? Did I use the URL parameters inappropriately? Your guidance would be appreciated.

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon