Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I know this is probably a dumb question, but there's a bunch of documentation and I don't know what to do with this stuff. How do you use the API?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

Do you mean to say how do I use this stuff?

You can find the documentation here or there's a Get Started section at the right of this page.

For example if you want to see a list of users you could send a web request to http://api.stackoverflow.com/1.0/users and parse then JSON response.

Now if you want to find out details about a particular user lets say your details http://stackoverflow.com/users/566610/jared

Do you see the number 566610 thats the id. Every question, answer, comment ,or user has a id.

So here you need to send your web request to http://api.stackoverflow.com/1.0/users/566610

Your JSON response :

{
  "total": 1,
  "page": 1,
  "pagesize": 30,
  "users": [
    {
      "user_id": 566610,
      "user_type": "registered",
      "creation_date": 1294388578,
      "display_name": "Jared",
      "reputation": 28,
      "email_hash": "e51f7fdd3c09fc9246278abf89f1881e",
      "age": 19,
      "last_access_date": 1294538702,
      "website_url": "http://wphax.com",
      "location": "Wisconsin, US",
      "about_me": "<p>Freelance WordPress Expert</p>\n",
      "question_count": 2,
      "answer_count": 2,
      "view_count": 1,
      "up_vote_count": 0,
      "down_vote_count": 0,
      "association_id": "d0249d62-3c97-4b50-9df1-8c7f377846f6",
      "user_questions_url": "/users/566610/questions",
      "user_answers_url": "/users/566610/answers",
      "user_favorites_url": "/users/566610/favorites",
      "user_tags_url": "/users/566610/tags",
      "user_badges_url": "/users/566610/badges",
      "user_timeline_url": "/users/566610/timeline",
      "user_mentioned_url": "/users/566610/mentioned",
      "user_comments_url": "/users/566610/comments",
      "user_reputation_url": "/users/566610/reputation",
      "badge_counts": {
        "gold": 0,
        "silver": 0,
        "bronze": 4
      }
    }
  ]
}

Take one more example. Lets assume we want to find out list of questions for this you should send your web request to http://api.stackoverflow.com/1.0/questions

and if you want questions related to a particular tag for example wordpress

your url will be http://api.stackoverflow.com/1.0/questions?tagged=wordpress

And once you have finished with your application you can register for an API key.

Read How API Keys Work for more details.


Edit :

You can use StackAPI which is an interactive way to explore the API of the stack family of sites.

Edit 1 :

You can find list of libraries here.

I hope this helps.

share|improve this answer
    
That does help out a lot, for understanding what it is, but what I want to know I guess is how I send these web requests. How do I do that? –  Jared Jan 9 '11 at 12:57
    
@Jared Which programming language are you going to work on? Morever it is language specific, as the name says it is used to send a request to a url. –  Searock Jan 9 '11 at 13:15
    
Well, I'm a website developer, so HTML/CSS, PHP, jQuery, ect.? Maybe I'm not sure exactly what this API is for.. :P –  Jared Jan 9 '11 at 13:45
    
@Jared Hmm, have you heard about facebook or twitter api? Similarly using this api you can access data of stackoverflow and corresponding site's users,questions,answers from your desktop application or from your website. You can either use AJAX or PHP (it's up to you). –  Searock Jan 9 '11 at 16:27
    
@Jared For example iStack for iPad –  Searock Jan 9 '11 at 16:30
    
@Jared StackMobile.com –  Searock Jan 9 '11 at 16:35
1  
@Jared If you are not comfortable with the api you can use a library –  Searock Jan 9 '11 at 16:44
    
Thanks, that is exactly what I needed. I feel a little more comfortable doing what I already know. :) Now if I created a website similar to this and used one of those libraries, it will only take data from stack overflow, will users on my site be able to ask questions from my site? –  Jared Jan 10 '11 at 6:17
    
@Jared will users on my site be able to ask questions from my site? It's not possible with the current version (1.0). I guess they may introduce these features in the next version. –  Searock Jan 10 '11 at 7:17
    
I see, thanks for your help. –  Jared Jan 14 '11 at 17:54
add comment

You must log in to answer this question.

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