XKCD

Webcomic API

xkcd.com/json.html ↗
Version
1.0.0
OpenAPI
3.0.0
Endpoints
2
Schemas
1
Updated
3 days ago
Entertainment entertainment comics
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

http://xkcd.com

Endpoints

Info 2 endpoints

GET /info.0.json

Fetch current comic and metadata.

operationId: Info_getComicMetadata

Responses

200 OK
GET /info.0.json
GET /{comicId}/info.0.json

Fetch comics and metadata by comic id.

operationId: Info_getById

Parameters

Name In Required Type Description
comicId path required number

Responses

200 OK
GET /{comicId}/info.0.json

Schemas

object comic
{
  "type": "object",
  "properties": {
    "alt": {
      "type": "string"
    },
    "day": {
      "type": "string"
    },
    "img": {
      "type": "string"
    },
    "num": {
      "type": "number"
    },
    "link": {
      "type": "string"
    },
    "news": {
      "type": "string"
    },
    "year": {
      "type": "string"
    },
    "month": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "safe_title": {
      "type": "string"
    },
    "transcript": {
      "type": "string"
    }
  }
}