making complex queries using python and facebook m

2019-03-05 17:59发布

问题:

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.