Facebook graph api Facebook营销API按洞察支出金额过滤广告

Facebook graph api Facebook营销API按洞察支出金额过滤广告,facebook-graph-api,facebook-javascript-sdk,facebook-marketing-api,Facebook Graph Api,Facebook Javascript Sdk,Facebook Marketing Api,我想得到这样一个账户的广告: https://graph.facebook.com/v7.0/act_id?fields=account_id,name,ads{id,name,insights{spend}} 但是有成千上万的广告,所以我想通过花费来过滤它们(只获取花费>0的广告)。所以我试了一下: https://graph.facebook.com/v7.0/act_id?fields=account_id,name,ads{id,name,insights{spend}}&fi

我想得到这样一个账户的广告:

https://graph.facebook.com/v7.0/act_id?fields=account_id,name,ads{id,name,insights{spend}}
但是有成千上万的广告,所以我想通过
花费
来过滤它们(只获取花费>0的广告)。所以我试了一下:

https://graph.facebook.com/v7.0/act_id?fields=account_id,name,ads{id,name,insights{spend}}&filtering=[{field: "ads.insights.spend",operator:"GREATER_THAN", value:'0'}]
https://graph.facebook.com/v7.0/act_id/ads?fields=id,name,insights{spend}&filtering=[{field: "insights.spend",operator:"GREATER_THAN", value:'0'}
但似乎不起作用。所以我也试过这个:

https://graph.facebook.com/v7.0/act_id?fields=account_id,name,ads{id,name,insights{spend}}&filtering=[{field: "ads.insights.spend",operator:"GREATER_THAN", value:'0'}]
https://graph.facebook.com/v7.0/act_id/ads?fields=id,name,insights{spend}&filtering=[{field: "insights.spend",operator:"GREATER_THAN", value:'0'}
但我得到了这个错误:

(#100) Filtering field 'insights.spend' with operation 'greater_than' is not supported"
那么有没有办法做到这一点呢


我也在使用javascript sdk,所以如果有办法,请分享

好的,我终于找到了解决方法,希望这能帮助一些人:

act_ID/ads?fields=fields=id,name,insights{spend}&filtering=[{'field':'spend','operator':'GREATER_THAN','value':'0'}]
但是,如果没有一些过滤,这并不是真正有用的:你应该像这样过滤洞察和广告

act_ID/ads?fields=fields=id,name,insights.time_range({'since':'YYYY-MM-DD','until':'YYYY-MM-DD'}){spend}&filtering=[{'field':'spend','operator':'GREATER_THAN','value':'0'}]&time_range={'since':'YYYY-MM-DD','until':'YYYY-MM-DD'}