making complex queries using python and facebook marketing api (targeting)

房东的猫 提交于 2019-12-09 03:54:21

问题


i am trying to make complex queries in order to know things like "the is the size of population (audience size) of people who are interested in football and also live in new york". i have access token, and yet i can't make complex conditions, only 1 condition at a time. another problem is that i take the curl code and i conver it to python code using https://curl.trillworks.com/ so far i did this code:

import requests
data2 = [('type', 'adinterest'),('q','football'), 
('access_token','my_access_token'),('limit','1000')]
response = requests.get('https://graph.facebook.com/v2.11/search',params=data2)
r=response.json()

how can i make it into more complicated query like "is interested in football, in age between 18 and 30 and also live in new york" ? i looked at facebook explanations like: https://developers.facebook.com/docs/marketing-api/targeting-search https://developers.facebook.com/docs/marketing-api/buying-api/targeting

https://developers.facebook.com/docs/marketing-api/targeting-specs

and yet i fail.

来源:https://stackoverflow.com/questions/51194773/making-complex-queries-using-python-and-facebook-marketing-api-targeting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!