{"openapi":"3.1.0","info":{"title":"xkcd API","version":"1.0.0","description":"Randall Munroe's legendary webcomic xkcd as an API. Fetch the latest comic, any comic by its number (e.g. #353 \"Python\"), or a random one — each with the title, the famous hover (alt) text, the full transcript, the image URL, the publication date and links to both xkcd and explainxkcd. A clean JSON wrapper over xkcd.com with no scraping and no surprises. Ideal for Discord and Slack bots, \"comic of the day\" widgets, dashboards and screensavers, newsletters, and any app that wants a daily dose of xkcd.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/xkcd-api","description":"oanor gateway"}],"tags":[{"name":"Comics"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/comic":{"get":{"operationId":"get_v1_comic","tags":["Comics"],"summary":"A comic by number","description":"","parameters":[{"name":"number","in":"query","required":true,"description":"Comic number, e.g. 353","schema":{"type":"string"},"example":"353"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"comic":{"alt":"I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I'm leaving you.","date":"2007-12-05","image":"https://imgs.xkcd.com/comics/python.png","title":"Python","number":353,"comic_url":"https://xkcd.com/353/","safe_title":"Python","transcript":"[[ Guy 1 is talking to Guy 2, who is floating in the sky ]] Guy 1: You're flying! How? Guy 2: Python! Guy 2: I learned it last night! Everything is so simple! Guy 2: Hello world is just 'print \"Hello, World!\" ' Guy 1: I dunno... Dynamic typing? Whitespace? Guy 2: Come join us! Programming is fun again! It's a whole new world up here! Guy 1: But how are you flying? Guy 2: I just typed 'import antigravity' Guy 1: That's it? Guy 2: ...I also sampled everything in the medicine cabinet for comparison. Guy 2: But i think this is the python. {{ I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I'm leaving you. }}","explain_url":"https://www.explainxkcd.com/wiki/index.php/353"}},"meta":{"timestamp":"2026-06-01T00:04:28.749Z","request_id":"4d84ec2d-3603-49b8-922f-717cde6b6932"},"status":"ok","message":"Comic retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/latest":{"get":{"operationId":"get_v1_latest","tags":["Comics"],"summary":"The most recent comic","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"comic":{"alt":"SUGGESTIONS FOR FUTURE RESEARCH: No further research is needed as it is frankly none of our business.","date":"2026-05-29","image":"https://imgs.xkcd.com/comics/ancestral_genomes.png","title":"Ancestral Genomes","number":3252,"comic_url":"https://xkcd.com/3252/","safe_title":"Ancestral Genomes","explain_url":"https://www.explainxkcd.com/wiki/index.php/3252"}},"meta":{"timestamp":"2026-06-01T00:04:28.832Z","request_id":"38672f42-4890-4500-a0e2-86611a7e88e1"},"status":"ok","message":"Latest comic retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/random":{"get":{"operationId":"get_v1_random","tags":["Comics"],"summary":"A random comic","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"comic":{"alt":"An occasional source of mild Thanksgiving tension in my family is that my mother is a die-hard fan of The Core (2003), and various family members sometimes have differing levels of enthusiasm for her annual tradition of watching it.","date":"2023-11-22","image":"https://imgs.xkcd.com/comics/thanksgiving_arguments.png","title":"Thanksgiving Arguments","number":2858,"comic_url":"https://xkcd.com/2858/","safe_title":"Thanksgiving Arguments","explain_url":"https://www.explainxkcd.com/wiki/index.php/2858"}},"meta":{"timestamp":"2026-06-01T00:04:29.229Z","request_id":"d8be89c3-4a9e-4cfd-800f-8ef38b59be85"},"status":"ok","message":"Random comic retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Usage notes","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"xkcd webcomic. /v1/latest = the most recent comic; /v1/comic?number=353 = a specific comic by number; /v1/random = a random comic. Each returns the title, hover (alt) text, transcript, image URL, publication date and links to xkcd and explainxkcd. xkcd is licensed CC BY-NC 2.5 by Randall Munroe.","source":"xkcd.com (Randall Munroe)","endpoints":["/v1/latest","/v1/comic","/v1/random","/v1/meta"]},"meta":{"timestamp":"2026-06-01T00:04:29.276Z","request_id":"9d91034f-ede2-48fd-b66e-505ad62c6c93"},"status":"ok","message":"Meta retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":13500,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":280,"monthly_call_quota":195000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":940,"monthly_call_quota":840000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":2960,"monthly_call_quota":3450000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/xkcd-api"}