Hot answers tagged

3 votes
Accepted

When using the Advanced Search API endpoint, how soon after the edit grace period is question data updated?

tl;dr: I think you can reduce the delay to 8-10 minutes. Grace period edits are available for 5 minutes after post creation and search results can be stale for a few minutes afterwards, especially ...
user avatar
  • 358
3 votes

How to query the Stack Exchange API using an OR operator?

The API currently does not support this, but then neither does the website itself. The "How do I search?" help page says: OR operator To combine results from multiple tags, separate the tag ...
user avatar
  • 12.6k
3 votes
Accepted

Search function in the API doesn't work as expected

Although it doesn't appear to say so in the doc page, intitle expects an exact phrase, not a list of words. You can currently see this by: /2.2/search?intitle=get column array&site=stackoverflow ...
user avatar
  • 12.6k
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. It says so right in the doc pages: Searches a site for any questions which fit the given criteria. ...
user avatar
  • 12.6k
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/...
user avatar
  • 12.6k
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! ★"
user avatar
  • 12.6k
2 votes

Paging fails at 10K items for /search on any site but Stack Overflow

This was a search issue in elastic (max_result_window) that has now been tuned across the network. See, also, this related Q&A on Meta SE.
user avatar
  • 2,194
2 votes
Accepted

How do I get the total number of records for a given search?

In order to get the total, you need to use a filter that includes it. If you just want the total, as your sample code implies, then use the built-in total filter. For example:      ...
user avatar
  • 12.6k
2 votes
Accepted

How do I search answer bodies for Markdown links?

The search methods work on the HTML version of the post, so searching for Markdown won't work. You can either use this parameter url - a url which must be contained in a post, may include a wildcard. ...
user avatar
  • 5,492
2 votes
Accepted

Advanced search doesn't return expected results when using min & max (dates) together?

Date parameters are in unix epoch time and 1447113600 is 2015-11-10, 00:00:00. So any questions posted on Nov 10th actually happened after that. When searching for date ranges, you usually want to ...
user avatar
  • 12.6k
2 votes

Search by team API - want to have same query results in StackOverflow.com site

There is no "official" Java client. I assume Java comes with an HTTP client in its standard library. That one should do the trick. The minimal example you need is this URL (click it!): ...
user avatar
  • 1,810
1 vote
Accepted

Discrepancy in results size

I can reproduce (sort of): Search on the main site: 1,449 results Searching with the API: 857 results I use a different filter which shows the total number of results at the bottom, but that doesn'...
user avatar
  • 5,492
1 vote

Bugs in API 2.2 "/search/advanced" with a "q" parameter

There's indeed no difference between order=asc and order=desc; perhaps this is a limitation of Elasticsearch which powers the Stack Exchange search engine (both the API and on the sites). To be fair, ...
user avatar
  • 5,492
1 vote
Accepted

Is there any way to get questions by tag with excerpt?

The /search/excerpts method supports searching by tag and returns the excerpts you're looking for:
user avatar
  • 5,492
1 vote
Accepted

How to search ALL sites with the advanced API?

No, there is no easy way to do this via the API. Related feature requests: Provide a method to search for sites winch merely wanted a search for site name/description. It was declined. Search ...
user avatar
  • 12.6k
1 vote

Is there a SQL-like query for the API?

No there is no "Query API", especially not for SQL-like syntax. It sure would be sweet to have an always current version of SEDE† (even if limited to, say, a hundred rows), but this is very ...
user avatar
  • 12.6k
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?...
user avatar
  • 12.6k
1 vote

wrong results of api /search/advanced

is_answered is true if there is at least one positively scoring answer. It doesn't actually mean 'marked as accepted'. See more about how it works in this answer Also, https://api.stackexchange.com/...
user avatar
  • 4,215

Only top scored, non community-wiki answers of a minimum length are eligible