3

To get the timeline for a question I am sending this request:

https://api.stackexchange.com/2.2/questions/63299112/timeline?site=stackoverflow&fromdate=1597649222

I am getting empty results:

{"items":[],"has_more":false,"quota_max":300,"quota_remaining":270}

However the query to fetch complete results without timestamp filter has all the records: https://api.stackexchange.com/2.2/questions/63299112/timeline?site=stackoverflow

{
    "items": [
        {
            "owner": {
                "reputation": 73,
                "user_id": 13884195,
                "user_type": "registered",
                "profile_image": "https://www.gravatar.com/avatar/b858a4e20694a8c3a0a0107abd8b75ac?s=128&d=identicon&r=PG&f=1",
                "display_name": "VaraPrasad-MSFT",
                "link": "https://stackoverflow.com/users/13884195/varaprasad-msft"
            },
            "creation_date": 1600594289,
            "comment_id": 113131777,
            "post_id": 63299112,
            "question_id": 63299112,
            "timeline_type": "comment"
        },
        {
            "owner": {
                "reputation": 1,
                "user_id": 13115292,
                "user_type": "registered",
                "profile_image": "https://www.gravatar.com/avatar/df109663257492e9c542a37efe61c866?s=128&d=identicon&r=PG&f=1",
                "display_name": "TheseusDev",
                "link": "https://stackoverflow.com/users/13115292/theseusdev"
            },
            "creation_date": 1597649223,
            "comment_id": 112190716,
            "post_id": 63299112,
            "question_id": 63299112,
            "timeline_type": "comment"
        },
        {
            "owner": {
                "reputation": 1129,
                "user_id": 12318748,
                "user_type": "registered",
                "profile_image": "https://www.gravatar.com/avatar/8ba99e03314cdf154460e11a52ab04dd?s=128&d=identicon&r=PG&f=1",
                "display_name": "Subhasish",
                "link": "https://stackoverflow.com/users/12318748/subhasish"
            },
            "creation_date": 1597157350,
            "comment_id": 112038848,
            "post_id": 63299112,
            "question_id": 63299112,
            "timeline_type": "comment"
        },
        {
            "owner": {
                "reputation": 1,
                "user_id": 13115292,
                "user_type": "registered",
                "profile_image": "https://www.gravatar.com/avatar/df109663257492e9c542a37efe61c866?s=128&d=identicon&r=PG&f=1",
                "display_name": "TheseusDev",
                "link": "https://stackoverflow.com/users/13115292/theseusdev"
            },
            "creation_date": 1596793060,
            "question_id": 63299112,
            "timeline_type": "question"
        }
    ],
    "has_more": false,
    "quota_max": 10000,
    "quota_remaining": 9996
}

Please let me know if I am doing something wrong, or if there is any workaround.

1 Answer 1

2

It looks like a bug in the API. It looks like it filters on the creation date of the question, not the timeline events themselves. The question has a timestamp of 1596793060, and using a fromdate of 10 seconds earlier produces the full timeline: https://api.stackexchange.com/docs/questions-timeline#fromdate=1596793050&ids=63299112&filter=default&site=stackoverflow&run=true while using one of 10 seconds after produces no results: https://api.stackexchange.com/docs/questions-timeline#fromdate=1596793070&ids=63299112&filter=default&site=stackoverflow&run=true.

Unfortunately, the API doesn't really have priority with the development team (which is understandable if you compare how often it's used vs. the regular website) so it may take a while for this to be fixed. As a workaround, you can use pagination.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.