Learn advanced querying techniques to enhance the precision and relevance of your searches.
q
AND
operator. This means each token has to
be present in the text at least once. For example, q=Apple Microsoft
will
be read as q=Apple AND Microsoft
"
when you search for companies, person names,
etc. For example, if you want to find articles where Tim Cook
is mentioned,
you should pass q="Tim Cook"
not q=Tim Cook
user_input
list in the JSON that
we return to you. Make sure our API saw your keywords as you intended.
"
for the exact match.
When you want to search for articles that mention Tim Cook you should do the
following query:
q=Tim Cook
then it will be treated as q=Tim AND Cook
. In that
case, every article that mentions tim
and cook
will match.
Moreover, if you specify lang=en
that will also match the articles with
cooking
, cooked
, and other stems of the word cook
.
AND
AND
operator makes tokens from both sides to be present in the text.
AND
is the default operator. When your q input is more than 1 word, AND
operator is added between each word behind the scenes. Therefore,
q=Apple Microsoft Tesla
is the same as q=Apple AND Microsoft AND Tesla
For example, if we want both Microsoft
and Tesla
to be present in the
returned news articles, the q
parameter should look as follows:
OR
OR
can also be written as ||
OR
operator means that either the left or the right sides of OR
have to be
satisfied.
You should use Grouping when you want to logically group a set of tokens. For
example:
NOT
NOT
can also be written as !
Use NOT
operator when you want the token from its right not to be present. For
example, if we want to search for articles about Microsoft and not about Tesla,
the q
parameter should look as follows:
MUST
rules:
+
(plus sign) if it MUST appear in the searched text.user_input
object in
the Response Body to see how our back end saw your request.+
(plus sign) will be escaped by default in many situations.
Therefore, we recommend using its URL-encoded version: %2B
NOT MUST
rules:
-
(minus sign) if it MUST NOT appear in the searched
text. For example, if we want to search for news articles that contain Elon
Musk but not Grimes, we have to write:Elon
or
Musk
are present. Shouldn’t we write +Elon +Musk -Grimes
?
If we write +Elon +Musk -Grimes
that means that Elon
and Musk
should be
present in the text, however, not in that particular. The “correct” query should
look like this:
"Elon Musk"
, plus,
Grimes
must not be present.
*
and ?
*
to match any string in any quantity.?
to match any string exactly once.Microsort
and any
C-level officers: