Hot answers tagged

7 votes
Accepted

How to create API filters?

You can create and edit filters from the documentation page of the API endpoint. So you start at the Index of all endpoints. There you'll find /users/{id}/answers. On the right at the top of the ...
  • 1,810
3 votes

What is the right way to create a Stack Exchange API filter?

I have struggled with Stack Exchange API filters too, when I tried to incorporate up_vote_count, down_vote_count and view_count attributes in my user response object. I visited this page of the ...
3 votes
Accepted

How do I see the differences between two or more SE API filters and merge into a filter which includes all requested properties (i.e. is a superset)?

To make it easier to merge filters, I wrote the following snippet. The detailed differences between each two filter combinations are a bit unwieldy to display in the snippet space, so they are output ...
  • 1,388
3 votes
Accepted

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

The key mistake here is neglecting the Wrapper Object, and this is a big flaw with the filter documentation. The wrapper is the box that everything you get from the API comes in. You always get the ...
  • 12.7k
3 votes

Where are the built-in filters?

"A number of" might be a bit of a misnomer, as there are a whopping four standard ones: From the filters documentation: default, each type documents which fields are returned under the default ...
  • 4,686
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....
  • 12.7k
2 votes
Accepted

Can I pass multiple filters?

No, you cannot pass multiple filters. But the good news is you don't need to. Just create a custom filter. In your case, you might first set the edit tool to use withbody, and then further edit the ...
  • 12.7k
2 votes
Accepted

Can I pass a filter to a write method?

Yes. 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. Write methods must ...
  • 12.7k
1 vote
Accepted

Why does this minimal filter return no results at all?

Every response from the API contains a wrapper, with information about potential errors, your daily quota, and the actual results, which are in the items field. If you check that box: and hit Save, ...
  • 5,572
1 vote

Take the right filter for favourite count

I assume you're doing this call: https://api.stackexchange.com/docs/questions#order=desc&sort=activity&filter=!GeD4JB*YQqe2L&site=stackoverflow&run=true which indeed returns an empty ...
  • 5,572
1 vote
Accepted

How can I create a filter from scratch using filter/create?

I was able to deduce an answer by 'reverse-engineering' (sort of) the default filter: /2.2/filters/default this gives { "items": [ { "included_fields": [ ".backoff", "....

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