'Searching an exact phrase with Facebook's Ad Library API

I'm attempting to do a keyword-based search of political ads via Facebook's Ad Library API and am struggling with how to format my search_term entry in a way that searches for an exact phrase, rather than any ads containing the above keywords. I've tried quotes within the quotes but that hasn't changed the results in any way.

My searches generally are for candidate names and for those with common names it means I'm casting far too wide a net. Thanks in advance for the help!



Solution 1:[1]

I know this is from a while ago, but posting in case it helps someone else. There is now a parameter named "search_type" in the Ads Archive API (documentation here) which can be set to "KEYWORD_EXACT_PHRASE". This will search for exact matches of the term(s) in in "search_terms".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Elizabeth