Skip to main content
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
Results tagged with
Search options not deleted user 7653

Questions about the creation, manipulation, and usage of Filters - which were introduced in v2.0 of the API.

1 vote

API returns the last activity date even if asked not to

If I create a new filter and explicitly specify a sort key on votes, it worked for a time or two (no last_activity_date returned). … As a partial workaround for this bug, always specify a sort key that doesn't rely on a field not returned by the filter. …
Brock Adams's user avatar
2 votes
Accepted

Can I pass multiple filters?

Just create a custom filter. In your case, you might first set the edit tool to use withbody, and then further edit the filter to check the box next to .wrapper -> total, in the edit tool. … When you do that, you get a custom filter like !BHTP)ZqRO*RussQSam5gFh2.5-X*0T -- which you can see in action with queries like: /2.2/search?pagesize=1&intitle=orange& ... &filter=! …
Brock Adams's user avatar
10 votes
Accepted

How to strip out certain fields from the Stack Exchange API, JSON response?

For example, if you append &filter=!BGRhem4Z)WIti9lP55R*tgr(Jq_fHC to your query, above, you will get results without upvote_count, downvote_count, or owner information. … An easy way to create a filter is to use the filter-edit tool, on the appropriate doc page for the path you are using. : (Sample image of tool follows. It is not specific to this question) …
Brock Adams's user avatar
3 votes
Accepted

My filter is not returning any results. How to create a minimal filter?

For this reason, every filter should have .wrapper.items and/or .wrapper.total selected. More on this, below. … This automatically shows you only the filter sections that are relevant for that API path/query. Click the filter [edit] control and paste in the minimum base filter from step 1 above. …
Brock Adams's user avatar
4 votes
Accepted

Get questions with body and answers

To get answers, merely use the /questions path with a filter that has answers enabled. … page=1&pagesize=30&order=desc&sort=activity&site=stackoverflow&filter=! …
Brock Adams's user avatar
2 votes
Accepted

Can I pass a filter to a write method?

You can pass a filter, and you should (for all the standard reasons). First: On the doc page, changing the filter or preview, etc. will not change the URL for write methods. … But when I post with a sensible filter (filter=!8IfkvFvN6wVk. …
Brock Adams's user avatar
3 votes

Field "comment_count" is not always returned by API

This appears to be closely related to the bug: Why is comment_count=1 (incorrectly) when this particular filter is used?. … The workaround from there -- altering the filter by: selecting comment.comment_id and selecting question.comments appears to work in this case too. …
Brock Adams's user avatar