In [4]:
# Stat Usage Sample

# 1. GET Summary Report per multiple entities 

uri = '/stats'
method = 'GET'
stat_ids = ['cmp-a001-01-00000000********','cmp-a001-01-00000000********']
r = requests.get(BASE_URL + uri, params={'ids': stat_ids, 'fields': '["clkCnt","impCnt","salesAmt", "ctr", "cpc", "avgRnk", "ccnt","convAmt"]', 'datePreset': 'yesterday'}, headers=get_header(method, uri, API_KEY, SECRET_KEY, CUSTOMER_ID))

print("response status_code = {}".format(r.status_code))
print("response body = {}".format(r.json()))
params :  {'ids': ['cmp-a001-01-00000000********', 'cmp-a001-01-00000000********'], 'fields': '["clkCnt","impCnt","salesAmt", "ctr", "cpc", "avgRnk", "ccnt","convAmt"]', 'datePreset': 'yesterday'}
response status_code = 200
response body = {'data': [{'ctr': 1.83, 'convAmt': 283830, 'clkCnt': 59, 'cpc': 113, 'ccnt': 4, 'avgRnk': 3.9, 'id': 'cmp-a001-01-00000000********', 'impCnt': 3236, 'salesAmt': 6688}, {'ctr': 1.73, 'convAmt': 406980, 'clkCnt': 123, 'cpc': 104, 'ccnt': 3, 'avgRnk': 2.6, 'id': 'cmp-a001-01-00000000********', 'impCnt': 7115, 'salesAmt': 12793}], 'compTm': '202004300343', 'cycleBaseTm': '202004290000'}