0

I'd like to call for a stack exchange query to get the number of questions that were asked in a certain time range about a certain tag.

How can I do it? according to api's documentation it said that:

If you're looking to just select total, exclude the items field in favor of excluding all the properties on the returned type.

How can I do it?

GyRo
  • 2,586
  • 5
  • 30
  • 38
  • I found this so maybe the question isn't relevant: https://stackapps.com/questions/7293/how-to-get-the-number-count-total-of-tags-badges-something-from-the-api – GyRo Sep 25 '18 at 20:55
  • Just updated that linked answer; thanks for the catch. – Brock Adams Sep 25 '18 at 21:24

1 Answers1

1

You need to pass a custom filter in the parameters to the API call.

For example:

/2.2/questions?fromdate=1537056000&todate=1537660800&order=desc&sort=creation&tagged=android&site=stackoverflow &filter=!w-*Ytm8YGWVl9..xoC

Reference:

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • thanks Brock. How did you edit the filter, apart from checking the field 'total' in the '.wrapper' section, what else did you change? – GyRo Sep 25 '18 at 20:59
  • OK, I checked 'total' and unchecked 'items' and it worked. Is it correct? – GyRo Sep 25 '18 at 21:01
  • Yeah, that'll work, as long as you have `backoff` and `error_id` also checked. (Additional strongly recommended fields are in the first referenced link above.) – Brock Adams Sep 25 '18 at 21:10