Biostar API

This is the documentation for Biostar API. If you have additional questions, or believe you have encountered a bug, don't hesitate to post a question on Biostar.

General

All API responses are JSON.

Some API responses are cached. Polling for changes should be done sparingly in any case, and polling at a rate faster than once a minute (for semantically identical requests) is considered abusive.

A number of methods in the Biostar API accept dates as parameters and return dates as properties, the format of these dates is documented above. As a general rule, full dates use ISO 8601 and timestamps are in unix epoch time.

Methods

Traffic

GET /api/traffic/

Number of post views over the last 60 min filtered by unique IPs.

Fields in response

  • date: the current date, ISO 8601 format.
  • post_views_last_60_min: number of post views over the last 60 min filtered by unique IPs.
  • timestamp: the current date, unix epoch time format.

Example

/api/traffic/

{
    "date": "2014-05-29T14:59:55.788069",
    "post_views_last_60_min": 850,
    "timestamp": 1401375595
}

User

GET /api/user/{uid}/

General info about a user.

Parameters

  • uid: the identifier of the user.

Fields in response

  • date_joined: the date the user joined the website, ISO 8601 format.
  • id: the identifier of the user, a number.
  • joined_days_ago: the date the user joined the website, as the number of days ago.
  • last_login: the date of the last login of the user, ISO 8601 format.
  • name: the name of the user.
  • vote_count: the number of votes given by the user.

Example

/api/user/23/

    "date_joined": "2010-01-18T21:43:55.253000+00:00",
    "id": 23,
    "joined_days_ago": 1614,
    "last_login": "2011-11-08T19:37:21.753000+00:00",
    "name": "Giovanni M Dall'Olio",
    "vote_count": 37
}

Post

GET /api/post/{id}/

General info about a post.

Parameters

  • id: the identifier of the post, a number.

Fields in response

  • answer_count: number of answers.
  • author: author name.
  • author_id: author's identifier, a number.
  • book_count: number of bookmarks.
  • comment_count: number of comments.
  • creation_date: creation date, ISO 8601 format.
  • has_accepted: true if the question has an accepted answer, boolean.
  • id: identifier of the post, a number.
  • lastedit_date: date of last edit, ISO 8601 format.
  • lastedit_user_id: user who last edited this post.
  • parent_id: identifier of the parent post.
  • rank: rank, a number.
  • reply_count: number of replies.
  • root_id: identifier of the root post.
  • status: status message.
  • status_id: status' identifier, a number.
  • subs_count: number of subscribers following this post.
  • tag_val: tags.
  • thread_score: thread's score.
  • title: title.
  • type: type of post.
  • type_id: type's identifier for this post.
  • url: url.
  • view_count: number of views.
  • vote_count: number of votes.
  • xhtml: content.

Example /api/post/25/

{
    "answer_count": 2,
    "author": "Gue Su",
    "author_id": 18,
    "book_count": 0,
    "comment_count": 0,
    "creation_date": "2009-12-01T20:57:35.300000+00:00",
    "has_accepted": false,
    "id": 25,
    "lastedit_date": "2009-12-01T20:57:35.300000+00:00",
    "lastedit_user_id": 18,
    "parent_id": 24,
    "rank": 0.0,
    "reply_count": 0,
    "root_id": 24,
    "status": "Open",
    "status_id": 1,
    "subs_count": 0,
    "tag_val": "",
    "thread_score": 0,
    "title": "A: How To Set Shrimp Parameters For Best Sensitivity With 35Bp Colorspace Data?",
    "type": "Answer",
    "type_id": 1,
    "url": "http://localhost:8080/p/24/#25",
    "view_count": 0,
    "vote_count": 2,
    "xhtml": "
I just read the SHRiMP manual again, but I think that their explanation about -M option may not be enough to answer your question. I usually use the \"seed\" mode by using -s, -n, and -w and the option -M is a new feature of the version 1.3.1, which I have never tried before.

\n\n
I recommend for you to use the \"seed\" mode--the default would be good, but please adjust the -s option if you want more sensitivity. Always fast speed compensates sensitivity and the -M option seems to exist for this purpose.

\n\n
Hope my message to be helpful for your project.

\n"
}

Vote

GET /api/vote/{id}/

General info about a vote.

Parameters

  • id: the identifier of the vote, a number.

Fields in response

  • author: author name.
  • author_id: author's identifier, a number.
  • date: date of the vote, ISO 8601 format.
  • id: identifier of the vote, a number.
  • post_id: identifier of the voted post.
  • type: type of vote.
  • type_id: type's identifier for this vote.

Example /api/vote/21/

{
    "author": "Zhaorong",
    "author_id": 14,
    "date": "2014-04-29T15:02:17.740000+00:00",
    "id": 21,
    "post_id": 26,
    "type": "Upvote",
    "type_id": 0
}

Statistics on the Nth day

GET /api/stats/day/{day}/

Statistics as of the Nth day after day-0 (the day of the first ever post).

Parameters

  • day: number of days after day-0, a number.

Fields in response

  • answers : total number of answers as of the given day.
  • comments: total number of comments as of the given day.
  • date: date, ISO 8601 format.
  • new_posts: number of new posts in the given day.
  • new_users: number of new users in the given day.
  • new_votes: number of new votes in the given day.
  • questions: total number of questions as of the given day.
  • timestamp: date, unix epoch time format.
  • toplevel: total number of toplevel post as of the given day.
  • users: total number of users as of the given day.
  • votes: total number of votes as of the given day.

Example

/api/stats/day/5/

{
    "answers": 6,
    "comments": 0,
    "date": "2009-10-05T00:00:00",
    "new_posts": [
        10,
        11,
        12
    ],
    "new_users": [
        10,
        11
    ],
    "new_votes": [],
    "questions": 6,
    "timestamp": 1254700800,
    "toplevel": 6,
    "users": 10,
    "votes": 0
}

Statistics on a date

GET /api/stats/date/{year}/{month}/{day}/

Statistics as of the given date.

Parameters

  • year: a number, 4 digits.
  • month: a number, 2 digits.
  • day: a number, 2 digits.

Fields in response

  • answers: total number of answers as of the given date.
  • comments: total number of comments as of the given date.
  • date: date, ISO 8601 format.
  • new_posts: number of new posts in the given date.
  • new_users: number of new users in the given date.
  • new_votes: number of new votes in the given date.
  • questions: total number of questions as of the given date.
  • timestamp: date, unix epoch time format.
  • toplevel: total number of toplevel post as of the given date.
  • users: total number of users as of the given date.
  • votes: total number of votes as of the given date.

Example /api/stats/date/2009/10/06/

{
    "answers": 9,
    "comments": 0,
    "date": "2009-10-06T00:00:00",
    "new_posts": [
        13,
        14,
        15,
        16
    ],
    "new_users": [
        12,
        13
    ],
    "new_votes": [],
    "questions": 7,
    "timestamp": 1254787200,
    "toplevel": 7,
    "users": 12,
    "votes": 0
}

Tags List

POST /api/tags/list/

Return a list of tags with corresponding counts of posts. Can also pass down a time range.

Parameters

  • data: a file listing the tags, with
  • months: 6

Given

curl -X POST -F "tags=@/Users/natay/Desktop/apps/biostar-central/tags.txt" http://localhost:8000/api/tags/list/?trange=year

Returns

{
    "tag1": {
        "answer_count": 0,
        "comment_count": 0,
        "total": 21
    },
    "tag2": {
        "answer_count": 0,
        "comment_count": 0,
        "total": 20
    }
}
Traffic: 1593 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6