问题
I am trying to get Facebook Ad stats for a given date range using Facebook Graph API. It doesn't seem to work.
https://graph.facebook.com/v2.5/6039003162091/insights?since=2016-03-14&until=2016-03-15&access_token=<>
Any idea how I should go about with this?
回答1:
The answer is in the comments above and adding it here so it is clear. The issue was in the format of the time_range parameter as it needs to be
time_range={"since":"2016-03-15","until":"2016-03-15"}
回答2:
https://graph.facebook.com/v2.5/act_id?fields=ads{insights.time_range({"since":"2016-03-14","until":"2016-04-15"})}&access_token=YOUR_ACCESS_TOKEN
if you want day by day data you can alter as
https://graph.facebook.com/v2.5/6039003162091?fields=ads{insights.time_range({"since":"2016-03-14","until":"2016-04-15"}).time_increment(1)}&access_token=YOUR_ACCESS_TOKEN
来源:https://stackoverflow.com/questions/36013472/facebook-ad-insight-graph-api-edge-for-a-date-range