I found some nice documentation for doing targeting searches via Facebooks api here:
https://developers.facebook.com/docs/marketing-api/targeting-search/
The code that I have been using successfully, which was copied directly from the above documentation, is as follows:
(This is after I set up authentication with the Facebook API of course.)
params = {
'q': 'baseball',
'type': 'adinterest',
}
resp = TargetingSearch.search(params=params)
print(resp)
This works great and returns a list of topics to do with baseball, along with information about these topics like the audience size.
Now what I really want to be able to do is perform a more complex query, something like so:
return to me info on the audience of people who are in Santa Monica and who have an interest in baseball.
I want to do this because I want to be able to see the audience size for this group, but can't seem to find documentation or examples on how to do this or if it's even possible.
Something like this is what I would imagine:
params = {
'q': 'baseball, santa_monica',
'type': 'adinterest, adlocation',
}
resp = TargetingSearch.search(params=params)
print(resp)
But the above does not work.
Any tips are much appreciated.