Skip to main content
5 of 22
added 59 characters in body
Jeff Atwood
  • 960
  • 1
  • 12
  • 18

Getting Started with the API

The Stack Exchange API is based on standard HTTP and URLs, just like the web page you're browsing now. Except instead of HTML, the responses are all in JSON.

Let's say we wanted to call the stats method:

http://api.stackoverflow.com/0.8/stats

  • api.stackoverflow.com - the site to query
  • 0.8 - the api version
  • stats - the method

The response:

{
  "statistics": [
    {
      "total_questions": 680175,
      "total_unanswered": 104562,
      "total_answers": 1910940,
      "total_comments": 2678849,
      "total_votes": 6720440,
      "total_badges": 688675,
      "total_users": 242593,
      "questions_per_minute": 1.75,
      "answers_per_minute": 3.76,
      "badges_per_minute": 1.55,
      "api_version": {
        "version": "0.8",
        "revision": "1.0.1234.5678"
      }
    }
  ]
}

(for a full list of possible API methods, refer to the documentation.)

##Do I need an API key?

A single IP can only make a limited number of requests per day to the API. This limit is determined at first request time, and is dependent upon the presence of an API key.

API daily limits:

  • Key: 10,000
  • No Key: 300

The No Key limit is meant to facilitate experimentation, not for deployed apps.

Requests with invalid or revoked keys are not completed, they are not stepped down to the No Key limit.

##Register for an API Key


##How do I announce my applicaton, library, or wrapper?

Create a question here and tag it [app] or [library]. Please refer to How to list your application on Stack Apps for suggested formatting.

Kevin Montrose
  • 18.7k
  • 6
  • 35
  • 62