How to hit the Stack Exchange API

The Stack Exchange API at https://api.stackexchange.com/2.3 covers Stack Overflow and every other Stack Exchange site; pick one with site. Responses are gzipped (curl and browsers decompress them).

Authentication

None for reading: 300 requests a day per IP without a key. A free app key raises that to 10,000.

Full reference: https://api.stackexchange.com/docs

Top questions for a tag

curl "https://api.stackexchange.com/2.3/questions?order=desc&sort=votes&tagged=curl&site=stackoverflow&pagesize=2"
Run in PostTaco
Example response (trimmed)
{
  "items": [
    {
      "tags": [
        "json",
        "rest"
      ],
      "owner": {
        "account_id": 205049,
        "reputation": 76219,
        "user_id": 453596,
        "user_type": "registered",
        "accept_rate": 76,
        "profile_image": "https://i.sstatic.net/leAsu.jpg?s=256",
        "display_name": "kamaci",
        "link": "https://stackoverflow.com/users/453596/kamaci"
      },
      "is_answered": true,
      "view_count": 4930208,
      "protected_date": 1431514152,
      "accepted_answer_id": 7173011,
      "answer_count": 31,
      "score": 3968,
      "last_activity_date": 1767473899,
      "creation_date": 1314175871,
      "last_edit_date": 1742005955,
      "question_id": 7172784,
      "content_license": "CC BY-SA 4.0",
      "link": "https://stackoverflow.com/questions/7172784/how-do-i-post-json-data-with-curl",
      "title": "How do I POST JSON data with cURL?"
    },
    {
      "tags": [
        "php",
        "curl"
      ],
      "owner": {
        "account_id": 87055,
        "reputation": 48911,
        "user_id": 241654,
        "user_type": "registered",
        "accept_rate": 74,
        "profile_image": "https://www.gravatar.com/avatar/23efd8fa757f521bb602c8fc1d47b176?s=256&d=identicon&r=PG",
        "display_name": "CodeOverload",
        "link": "https://stackoverflow.com/users/241654/codeoverload"
      },
      "is_answered": true,
      "view_count": 2127150,
      "protected_date": 1374426778,
      "accepted_answer_id": 2068371,
      "answer_count": 31,
      "score": 2857,
      "last_activity_date": 1740473299,
      "creation_date": 1263512064,
      "last_edit_date": 1609377543,
      "question_id": 2068344,
      "content_license": "CC BY-SA 4.0",
      "link": "https://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api",
      "title": "How do I get a YouTube video thumbnail from the YouTube API?"
    }
  ],
  "has_more": true,
  "quota_max": 300,
  "quota_remaining": 298
}

Get a user

curl "https://api.stackexchange.com/2.3/users/22656?site=stackoverflow"
Run in PostTaco
Example response (trimmed)
{
  "items": [
    {
      "badge_counts": {
        "bronze": 9362,
        "silver": 9321,
        "gold": 895
      },
      "collectives": [
        {
          "role": "member"
        }
      ],
      "account_id": 11683,
      "is_employee": false,
      "last_modified_date": 1789478427,
      "last_access_date": 1790183278,
      "reputation_change_year": 8016,
      "reputation_change_quarter": 1490,
      "reputation_change_month": 350,
      "reputation_change_week": 160,
      "reputation_change_day": 30,
      "reputation": 1529830,
      "creation_date": 1222430705,
      "user_type": "registered",
      "user_id": 22656
    }
  ],
  "has_more": false,
  "quota_max": 300,
  "quota_remaining": 298
}