stackexchange-apistackexchange

How can I fetch the total amount of items?


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?


Solution

  • 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: