Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Need StackExchange API for question count for particular tag

I tried Questions Dos from stackexchange to get total count of questions for perticular tag
but it has some limitation like That API return only 30 data at a time and max 100 data(question) But I need more than 10,000 counts, If I go through all page and count those questions using js or php it will take lots of time any sort way to get the total count of that question?

Example API: https://api.stackexchange.com/2.3/questions?tagged=airflow&site=stackoverflow;

I tried https://api.stackexchange.com/2.3/questions?tagged=airflow&site=stackoverflow API

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

and I get the first 30 items

But I want total number of those questions
Screenshot

>Solution :

To get a total of tagged "airflow" you need to use a custom filter

https://api.stackexchange.com/2.3/questions?tagged=airflow&site=stackoverflow&filter=!w-*Ytm8YGWVl9..xoC

{ "total": 11509,
 ...
}

Alternative is looking at tags – I am not sure why there is a difference in the airflow tags – we should ask the developers if "synonyms" makes the difference

One tag:

https://api.stackexchange.com/2.3/tags/airflow/info?site=stackoverflow

{
  "items": [
  {
    "has_synonyms": true,
    "count": 10263,
    "name": "airflow"

Tags with airflow in the name

https://api.stackexchange.com/2.3/tags?order=desc&sort=popular&inname=airflow&site=stackoverflow

document.getElementById('report').innerHTML =  resultAsOf20231104.items
  .map(({name,count}) => `${name}: ${count}`).join('<br/>')
<div id="report"></div>


<script>
const resultAsOf20231104 = { "items": [ { "has_synonyms": true, "is_moderator_only": false, "is_required": false, "count": 10263, "name": "airflow" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 1253, "name": "airflow-scheduler" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 710, "name": "airflow-2.x" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 170, "name": "airflow-webserver" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 80, "name": "airflow-api" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 76, "name": "airflow-taskflow" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 27, "name": "airflow-xcom" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 11, "name": "airflow-connections" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 5, "name": "airflow-celery" }, { "has_synonyms": false, "is_moderator_only": false, "is_required": false, "count": 4, "name": "airflow-k8s" } ], "has_more": false, "quota_max": 300, "quota_remaining": 294 }
</script>

If you need to run over more than 100 to count, then you need to throttle your requests and add paging to your code.

It is not trivial but I have done so for Github.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading