The Query parameter contains the terms to be searched for. Below is a description of query syntax for use with advanced queries.
![]() | Note |
|---|---|
Remember that the parameters must be URL encoded when passed in. So when searching for the phrase "cats and dogs", you would pass in Query=%22cats%20and%20dogs%22 |
Words in queries are combined with AND by default. Search for documents that contain the word cat and the word dog:
cat dog
Prefix words that you want to exclude from the query with a hyphen (-). Search for documents about the word "cat", but not the word "dog":
cat -dog
Use double quotes (") to make phrases. Search for for documents that contain the phrase "cats and dogs":
"cats and dogs"
Use site: to limit search results to a particular site. See the article on Search Fields for a complete list of all search fields you can use to narrow your query.
cats site:amazon.com
You can use the NOT operator in any field. Search for documents about cats on all sites EXCEPT google.com
cats site:(-google.com)
To limit your search to a list of sites, separate them using the OR operator (|).
cats site:(amazon.com|espn.go.com|cnn.com)
Use parentheses to group terms. You can nest groups as well, e.g. "((a | b) c)". Search for documents containing the the word "cat" or the word "dog", and the word "control":
(cat | dog) control
Use "*" for a placeholder in phrases, e.g. "a * c" matches "a b c" or "a x c" but not "a c" or "a b b c". Search for documents that contain phrases matching "The cat [some word] on the bed":
"the cat * on the bed"
Use "|" to do OR. Search for documents containing the word "cat" or the word "dog":
cat | dog
Note when using ORs, you may be charged extra for the complexity of the query.
Please see the What are equivalent simple queries?" FAQ to check your query.