3

I was looking into Stack API doc and found the following API call.

https://api.stackexchange.com/docs/comments#order=desc&min=1&sort=votes&filter=!)V)MSZJUgX_&site=stackoverflow&run=true

I understand all parts but filter=!)V)MSZJUgX_. Apparently this call returns the same result as filter=total so I assume that !)V)MSZJUgX_ may be equal to total. But how?

Layray
  • 105
  • 1
  • 2
  • 9
  • 1
    This should probably be on [meta]. – jonrsharpe May 29 '17 at 21:17
  • Impressive. After just 3 minutes (!) google found **this** question when searching for this string. Beyond that, https://codegolf.stackexchange.com/a/96388/40774 , but I cannot derive an answer from that. – Marco13 May 29 '17 at 21:19

1 Answers1

4

!)V)MSZJUgX_ is a unique ID for a custom, Stack Exchange, API filter.

The filter controls what the Stack Exchange API returns -- to reduce bandwidth and increase speed by not returning unwanted properties. See the doc for more info.

You can see what the filter (potentially) returns by using the /filters/{filters} route.

In this particular case, !)V)MSZJUgX_ just returns the .total property. That is, it just returns the total number of comments on the site -- when used with the query shown in the question.


For more information about creating custom filters, see the above links, plus:

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • Darn, I was hoping there'd be more specific instructions here, since I can't create a [working] filter at all. (My question [elsewhere](https://stackapps.com/q/7829/50270).) – ashleedawg Mar 28 '18 at 20:46
  • 1
    @ashleedawg, updated but only tangentially related. I'll get to your question in a bit (no promises). – Brock Adams Mar 28 '18 at 21:01
  • Thanks - I've read the docs and a number of questions; I'm probably missing something silly. – ashleedawg Mar 28 '18 at 21:05