4

A lot of ideas I've had for Stack apps have been of the "question of the day" variety. It would be nice if there was a way to retrieve one or more random questions.

/questions/random/

The max parameter could be used to determine how many results to return. If no max is specified then only a single result should be returned. All other parameters could apply to this, including answers, body and sort.

/questions/random/?max=10&body=true

I realize that I could simply have my app guess a random question ID or something, but most of these solutions will waste precious requests trying to find a positive result and will still only return one result at a time.

2 Answers 2

2

You can implement this yourself pretty easily.

A random date range, with todate & fromdate on /questions, will work fine. Basically, pick a random question (via page) from a random hour/day/week/month/whatever.

1

Why can't you call the

/questions

method and just pick a random question from a random page?

1
  • Ah true, the paging would certainly replicate most of this functionality. There's still a high degree of repeatability this way, requiring a few pages of results to be called if I wanted a more random set.
    – Soviut
    Commented Jun 15, 2010 at 4:30

You must log in to answer this question.

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