4

I believe I can use the Stack Exchange API to get total questions that fit chosen tags.

I have an example I wrote myself here:
          data.stackexchange.com/stackoverflow/query/767064/number-of-posts-for-excel-and-python

How do I measure the growth of popularity of a particular tag or a particular bunch of tags over time using the Stack Exchange API?

E.g.

  • [excel] vs [python]
  • [excel]+[python] vs [excel]+[php]

and so on.

1 Answer 1

2

Do you mean something like this plot? :

diabolical plot
(Generated by SEDE: /query/201360?ShowScore=0&Tag1=excel&Tag2=python&Tag3=NA&Tag4=NA#graph)

Use the data explorer (SEDE) for that.

To do this with the API, is possible but not pretty.
For example, to replicate the above plot you would need to make 111(Age of SO in months) API calls for python like this call, a then make 111 API calls for excel with the same time parameters. (Then piece the results all together and plot it.)

Due to rate limiting, those 222 calls would take at least 8 seconds. More tags, or finer time slices, increases the time proportionally.

Also, you are allowed 10,000 API calls a day, max. So that means, at most, 90 such runs per day -- including tests and development.


UPDATE:

For comparing compound tags, EG [excel]+[python] vs [excel]+[php], this would become even more problematic in the API.

But, I forked the SEDE query into something that compares tag set A versus tag set B:

plot 2

Right now it does 1 by 1, 1 by 2, 2 by 1, and 2 by 2 tag combos. But it should be obvious how to extend it for more tags on each side.

4
  • wow.. yes this is very close to what I want. I have some follow up questions. How do I modify this query and where can I learn the various meaning of magical constants such as posttypeid = 1? Instead of comparing 1 tag against another, I prefer to compare a bunch of tags against another bunch of tags. E.g. excel-python against excel-php. I will modify my question such that I explicitly make clear, it may be a bunch of tags comparing.
    – Kim Stacks
    Commented Dec 5, 2017 at 7:10
  • How is your new question any different? Merely change the parameters of the query I provided. Maybe add a sketch of what you you are looking for. ... For PostTypeId, etc., consult the SEDE schema. Commented Dec 5, 2017 at 7:16
  • Apologies. I realise I phrase my question poorly. I meant to say, compare questions have both excel and python tags against questions that have both excel and php tags on them. I looked at your query and was thinking how to fork it. I realise I probably can only fork it to do pair-tags comparisons. Which is probably good enough for my own usage
    – Kim Stacks
    Commented Dec 5, 2017 at 7:28
  • See the updated answer. I forked the query for tag-combo comparisons. Commented Dec 5, 2017 at 10:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .