How to hit the xkcd API

xkcd publishes each comic's title, image URL, and alt text as JSON. It sends no CORS headers, so from a browser these run through the PostTaco extension.

Authentication

None — no key, no signup. Every example runs as-is.

Full reference: https://xkcd.com/json.html

Latest comic

curl https://xkcd.com/info.0.json
Run in PostTaco
Example response (trimmed)
{
  "month": "9",
  "num": 3301,
  "link": "",
  "year": "2026",
  "news": "<br />Previously: <a href=\"https://xkcd.com/1644/\">Stargazing</a> • <a href=\"https://xkcd.com/2017/\">Stargazing 2</a> • <a href=\"https://xkcd.com/2274/\">Stargazing 3</a> • <a href=\"https://xkcd.com/3072/\">Stargazing 4</a>",
  "safe_title": "Stargazing 5",
  "transcript": "",
  "alt": "The sun and the moon appear the same size in the sky, even though in real life the sun is more than twice as big. Some call this lucky alignment coincidence; others say it's proof that sometimes things can be the same size.",
  "img": "https://imgs.xkcd.com/comics/stargazing_5.png",
  "title": "Stargazing 5",
  "day": "21"
}

A comic by number

curl https://xkcd.com/927/info.0.json
Run in PostTaco
Example response (trimmed)
{
  "month": "7",
  "num": 927,
  "link": "",
  "year": "2011",
  "news": "",
  "safe_title": "Standards",
  "alt": "Fortunately, the charging one has been solved now that we've all standardized on mini-USB. Or is it micro-USB? Shit.",
  "img": "https://imgs.xkcd.com/comics/standards.png",
  "title": "Standards",
  "day": "20"
}