8

Does the Stack Overflow API support the ability to GET questions that are Active or Hot?

Obviously the Top Questions page groups questions onto tabs by Active, Hot, Week and Month. Each of these views can be accessed in the browser, and through RSS feeds, but I do not see them in the Stack Overflow API documentation.

And the All Questions page adds Newest, Frequent, Votes and Unanswered. The API provides an endpoint for questions/no-answers and questions/unanswered, but not the others.

I have checked the public API docs as well as those on our internal Stack Overflow Enterprise.

Those API routes would be very useful for programmatically promoting the Hot and Active questions internally, to draw in more employee users.

1 Answer 1

8

For "Active" questions, almost every route supports sorting by last_activity_date (Descending).

For example: /2.2/posts?order=desc&sort=activity&site=stackoverflow, which shows the most recently active posts first.

For "Hot" questions, the /questions route and the /me/tags/{tags}/top-questions route have this as an optional sorting. (No clue why it's only available on just those two.)

hot sorting


For example, /2.2/questions?order=desc&sort=hot&tagged=support&site=meta.stackoverflow currently returns results like:

{ "items": [ {
      "tags": ["support", "election", "faq-proposed"],
      "owner": { "display_name": "JL2210" },
      "is_answered": false,
      "view_count": 23,
      "answer_count": 0,
      "score": -5,
      "last_activity_date": 1566941318,
      "creation_date": 1566940698,
      "last_edit_date": 1566941318,
      "question_id": 388959,
      "link": "https://meta.stackoverflow.com/questions/388959/how-do-moderator-elections-work",
      "title": "How do moderator elections work?"
    }, {
      "tags": ["support", "feature-request", "api", "so-enterprise"],
      "owner": { "display_name": "5eleven7" },
      "is_answered": false,
      "view_count": 22,
      "answer_count": 0,
      "score": 4,
      "last_activity_date": 1566938483,
      "creation_date": 1566938483,
      "question_id": 388957,
      "link": "https://meta.stackoverflow.com/questions/388957/does-the-stack-overflow-api-support-the-ability-to-get-questions-that-are-active",
      "title": "Does the Stack Overflow API support the ability to get questions that are Active or Hot?"
    },
    // ...



It's possible that that sorting may work on other routes and is just not documented. Haven't tested it (and never had the need).

1
  • 1
    Excellent thank you. I was expecting to see them as specific routes, but you helped me understand they are sort options.
    – 5eleven7
    Aug 28, 2019 at 3:43

You must log in to answer this question.

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