originally posted in:BungieNetPlatform
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.
-
Edited by Rikkert2x: 10/15/2015 2:38:51 PMwrong thread
-
those parameters are not defined only the following: mode, count, page, definitions is mentioned in the API help: http://www.bungie.net/platform/Destiny/help/.