Zum Inhalt springen
GET /v1/comic

A comic by number

Live testen

10 freie Calls pro Tag — keine Anmeldung, kein API-Key. Geht durchs oanor-Gateway.

Eigene Header (optional)
api.oanor.com/xkcd-api

Funktioniert. Hol dir einen API-Key und nutze sie in deinem Projekt.

API-Key holen

Code-Snippets

curl "https://api.oanor.com/xkcd-api/v1/comic" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/xkcd-api/v1/comic", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/xkcd-api/v1/comic");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/xkcd-api/v1/comic",
    headers={"x-oanor-key": "oanor_test_..."}
)

Beispiel-Response

Echte Antwort dieses Endpoints, erfasst beim letzten Health-Check.

{
    "data": {
        "comic": {
            "alt": "I wrote 20 short programs in Python yesterday. It was wonderful. Perl, I'm leaving you.",
            "date": "2007-12-05",
            "link": null,
            "news": null,
            "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
}