2

Is there a way that I can specify a minimum score when requesting comments from the StackExchange API while still ordering by the creation date? I'm currently requesting comments ordered by date and then just ignore the comments where score < x when processing the response. For now x = 2, but this may increase. The bigger x gets the more I'd profit from specifying it in the API call, that is: fewer calls to the API would be made – see bottom of this question for percentages.

Of course I've already played arround with Try It section of the docs. This seems the logical thing to do:

https://api.stackexchange.com/2.2/comments?fromdate=1531180800&todate=1531094400&order=desc&min=2&sort=creation&site=stackoverflow

However, to quote the Complex Queries page of the docs:

The API provides the sort, min, max, fromdate, and todate parameters on many methods to allow for more complicated queries. min and max specify the range of a field must fall in (that field being specified by sort) to be returned, while fromdate and todate always define the range of creation_date. Think these parameters as defining two "windows" in which data must fit to be returned.

The above is also illustrated by the fact that the symbol in front of the Try It sections min field, changes from something that indicates a calendar (for creation_date) to some kind of counter (for score) when switching from sort=creation to sort=score.

This makes zero sense to me, since the fromdate and todate parameters render a min and max argument for creation_date useless as far as I'm concerned.

As far as I can tell it's impossible to do what I want to do (i.e. request comments with a minimum score ordered by creation date). I'm coming here in the hope that someone will prove me wrong.

Edit:

I ran some queries: being able to specify 1, 2, or 3 as a minimum score, reduces the number of results by 85, 95 and 98 percentage respectively. On large request the query reduction would be somewhere in that neighbourhood.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Niellles
  • 868
  • 10
  • 27
  • 1
    Pretty sure this is impossible. Also, the API has documented bugs with dates, min/max's sorting and pagination. – Brock Adams Jul 10 '18 at 19:05

0 Answers0