AnsweredAssumed Answered

media-reports API has too low rate-limit and not well supports multiple cpcpcodes in one request

Question asked by Yorick Shen on Sep 21, 2017
Latest reply on Sep 25, 2017 by Yorick Shen

I am trying to use '/media-reports/v1/adaptive-media-delivery/data' to get performance of my property with over 200 cpcodes. I run into some annoying troubles.    (some background  how to get property performance metrics using APIs ) 

1. I found that I cannot send requests to that API frequently – more than 1 request every 3 seconds caused "500 Server error" responses. But since Akamai doesn't provide a way to get property performance in one request, we have to iterate over all cpcodes in that property and sum them up. 0.3rps rate limit makes our task impossible.  (not to mention that there're so many metrics)

2. I tried put all the 200+ cpcodes in one request like below. But 400 response is returned..... After testing I found that, if any cpcode doesn't have that metric available, the multiple-cpcode request will just fail, which again forced me to use that API by iterating over each of the cpcodes.

Couldn't Akamai API be a little intelligent and ignore those "bad" cpcodes?  

parameters = {
    'startDate': start_time.strftime('%m/%d/%Y:%H:%M'),
    'endDate': end_time.strftime('%m/%d/%Y:%H:%M'),
    'limit': 10000,
    'dimensions': '1',
    'metrics': metric_id,
    'cpcodes': ','.join(cpcodes)
}

How can I workaround the rate-limiter, or/and how to fetch multiple cpcodes' metrics in one request? 

 

Thanks in advance!

 

Best,

Yorick Shen

Outcomes