Find articles with related terms in close proximity
NEAR
operator. This operator
lets you specify two or more terms and the maximum number of words that can
appear between them.
By using the NEAR
operator, you can significantly improve the relevance of
your search results, finding articles where related terms are discussed in close
proximity to each other.
Understand NEAR syntax
NEAR
operator uses the following format:phrase_A
and phrase_B
: The terms or phrases you want to find near each
other (max 4 words per phrase).distance
: The maximum number of words that can appear between the phrases
(max 100).in_order
: Optional boolean parameter. If true, phrase_B
must appear
after phrase_A
. Defaults to false.Construct your query
NEAR
queries:NEAR("climate change", "renewable energy", 15)
NEAR("artificial intelligence", "healthcare", 20, true)
NEAR
operationMake an API request
/search
endpoint with your constructed query in the q
parameter.
Here’s a Python code example:Analyze the results
Refine your query as needed
NEAR
operator (up to 3 phrases)NEAR
with boolean operators for more complex queries. For example: