3

I'm trying to, for humorous purposes, check out some of the worst scoring questions ever on SO.

I'm pretty much expecting them to all be "heeeeelp homework" or "plz send me teh codez" or something to do with Access and Excel macros.

Buuut, when trying to use the API to find them, it seems that the dev team has tried to save the innocence of these poor souls.

http://api.stackoverflow.com/0.8/questions?sort=votes&order=asc

That seems to only show things with a score of 0.

Bug?

3

3 Answers 3

3

Adding max=-10 will only show score with -10 or lower questions

http://api.stackoverflow.com/0.8/questions?sort=votes&order=asc&max=-10&type=jsontext

3
  • Ah. I first tried &max=0&min=-9999 but this just showed 0 scores again. From that I guessed that the min and max parameters controlled the count or total number of results returned. Thanks!
    – magcius
    Commented Jun 2, 2010 at 11:29
  • adding a separate comment because you can't do linebreaks in a comment: Would you consider either of these cases a bug? It's certainly non-obvious.
    – magcius
    Commented Jun 2, 2010 at 11:30
  • 1
    @magcius, I am not sure actually, I just know that min and/or max are needed when we want to do something based on sort parameter
    – YOU
    Commented Jun 2, 2010 at 12:18
1

If you don't want to have a magic number in your call, you can also just go to the last page.

Get http://api.stackoverflow.com/0.8/questions?sort=vote

then calculate lastPage = Ceil(totalItems/pageSize)

then get http://api.stackoverflow.com/0.8/questions?sort=votes&page=lastPage

1
  • the spirit of the suggestion is correct but a bit naive. the only way to get a full page is to pull the last 2 pages. the last page could contain 1 question. Commented Jul 29, 2010 at 5:49
0

http://api.stackoverflow.com/1.0/questions?sort=votes&order=asc

You can use SOAPI-EXPLORE to play around with things like this

{
  "total": 827442,
  "page": 1,
  "pagesize": 30,
  "questions": [
    {
      "tags": [
        "python",
        "homework",
        "sudoku"
      ],
      "answer_count": 2,
      "favorite_count": 3,
      "question_timeline_url": "/questions/1765525/timeline",
      "question_comments_url": "/questions/1765525/comments",
      "question_answers_url": "/questions/1765525/answers",
      "question_id": 1765525,
      "owner": {
        "user_id": 214862,
        "user_type": "unregistered",
        "display_name": "trevor",
        "reputation": 3,
        "email_hash": "1656d15a272448a583047af9f7595ba2"
      },
      "creation_date": 1258655489,
      "last_edit_date": 1258826938,
      "last_activity_date": 1272905541,
      "up_vote_count": 0,
      "down_vote_count": 41,
      "view_count": 1772,
      "score": -41,
      "community_owned": false,
      "title": "Python sudoku programming"
    },
    {
      "tags": [
        "c++",
        "algorithm

You must log in to answer this question.

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