Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about searching via the API, typically using the /search method.
3
votes
Accepted
Search function in the API doesn't work as expected
You can currently see this by:
/2.2/search? … To search for titles that contain a list of words,
use the /search/advanced route and pass multiple title:... properties in the q parameter.
For example:
/2.2/search/advanced? …
3
votes
How to query the Stack Exchange API using an OR operator?
The "How do I search?" … Search for [java] title:http class (only 3303 results, currently).
Search for [java] title:http foo (81 results).
Repeat for each additional keyword. …
2
votes
Searching on Stack Overflow and using the API give different results?
The /search path and the /search/advanced path return only questions, not answers, and by design. … Your example Stack Overflow search returned answers as well.
The correct equivalent search is:
stackoverflow.com/search? …
2
votes
Accepted
Advanced search doesn't return expected results when using min & max (dates) together?
When you take this into account, then:
/2.2/search/advanced?min=1446940800&max=1447200000&body=vm&tagged=sql-server
Returns the 3 questions you expect. …
2
votes
Accepted
How do I get the total number of records for a given search?
For example:
/2.2/search? … For example:
/2.2/search?intitle=X&site=stackoverflow&filter=!w-1xWerkkwLn6avAMY
See this answer for help creating custom filters.
Note: you should use care when requesting totals. …
2
votes
The /search route is ignoring the answers parameter.
The /search/excerpts route looks to be about as good as /search and it does return both questions and answers, and it does have an answers parameter.
This route is "★ All new! For version 2.2! ★" …
2
votes
Accepted
How to search answers like is:answer
I forget when, but sometime in the last couple of years, the /search/excerpts route started allowing is:answer in the q parameter.
For example:
/2.2/search/excerpts?&q=Hear! …
1
vote
Accepted
Possible to get more than 5 tags for /search? Or to use or-logic, for tags, in /questions?
The search path already allows more than 5 tags, and it uses OR logic. From the docs:
tagged and nottagged are semi-colon delimited list of tags. … So, you would use:
/2.1/search? …
1
vote
Can we pull posts out of Stack Overflow based on tags?
Is there any valid way to get the information from stackoverflow.com/search?q=?
Use the /search/advanced route of the API; that's what it's there for.
For example:
/2.2/search/advanced? …
1
vote
Is there a SQL-like query for the API?
Your options are:
Oftentimes the q parameter of the /search/advanced route is pretty powerful and will get you close to what you want. …
1
vote
Accepted
How to search ALL sites with the advanced API?
Related feature requests:
Provide a method to search for sites winch merely wanted a search for site name/description. It was declined.
Search across Stack Exchange sites in Android app. … Your alternatives are:
Scrape the Stack Exchange network search results page, EG stackexchange.com/search?q=foo
Loop through /2.2/search/advanced for each site and aggregate the results. …