Date parameters do not seem to work for the Stack

2019-05-29 05:03发布

问题:

If I request tag info without specifying fromdate/todate parameters, I get back some data. EG:

{
    "has_synonyms": true,
    "is_moderator_only": false,
    "is_required": false,
    "count": 1199408,
    "name": "c#"
}

But if I use the fromdate/todate parameters (recent date range), no data is returned.

Please let me know where to change?

回答1:

This is both a bug in the API documentation and a bug in the way the /tags/{tags}/info route works.
It is closely related to this bug on Stack Apps.

The docs don't say it, but the fromdate and todate parameters operate on the tag's creation date.

This is really bad behavior because:

  1. None of the /tags/ routes return creation date, nor allow sorting on it.
  2. There is no way to even know a tag's creation date. You can only know when the wiki was created (if any) and/or how old the oldest question that currently has that tag is.
  3. The /tags/ routes do return the last_activity_date. So one would think that the fromdate and todate parameters would operate on it, but they don't.
  4. This is not what any reasonable user expects (as demonstrated by both this question and the cross-site duplicate).

So:

  1. The doc is misleading and/or incomplete about this functionality.
  2. The API really should return the creation date and/or apply the fromdate and todate parameters to the last_activity_date

You can get an idea of a tag's (likely) creation date with this SEDE query: data.stackexchange.com/stackoverflow/query/840451/creation-date-for-a-tag