Something like the below, but with appropriate formatting (damn you cut and paste into these forums!) works well for years like 2017 / 2016. The results seem borked for 2015 where you would think it would filter out any results with an 'expected_release_year' of none, but it does not... If they could fix this it would be super easy to then just offset through the result pages. The expected_release_date is set to None once the game is released.
There is an alternative, which is to use the releases url and sort them by release_date or I remember it was one of the fields, I can look it up if you want, but that had issues too due to bad database data where I ended up needing to hit the api 4 or 5 more times than I wanted to, to make sure there were no more expected_release_date results laying around. Another option would be to just play support sorting on 'expected_release_date'. Either that or filtering working right would be awesome!
params['format'] = 'json'
params['filter'] = 'expected_release_year:2015'
results = requests.get(self.base_url + '/games/', params=params)
json_results = results.json()
num_results = json_results['number_of_total_results']
num_results_in_page = json_results['number_of_page_results']
print('results: ' + str(num_results) + 'page_results:' + str(num_results_in_pa ge))
for json_item in json_results['results']:
if 'expected_release_year' in json_item:
print('EXPECTED_RELEASE_YEAR' + str(json_item['expected_release_year']
Log in to comment