← 娱乐

指定 xkcd 漫画

GET /xkcd/:num

按编号获取特定 xkcd 漫画。返回漫画标题、编号、图片 URL、alt 文字和发布日期。适用于构建漫画浏览器、在讨论中链接到特定条目、创建精选 xkcd 合集和引用特定科学或数学相关漫画的教育参考。

参数

num 必填

Comic number

请求示例

基本用法
curl https://nordapi.ee/api/v1/xkcd/327
Bobby Tables (SQL injection comic #327)
curl https://nordapi.ee/api/v1/xkcd/327
Standards comic #927
curl https://nordapi.ee/api/v1/xkcd/927
Compiling comic #303
curl https://nordapi.ee/api/v1/xkcd/303

实时响应

{
  "data": {
    "alt": "Her daughter is named Help I'm trapped in a driver's license factory.",
    "date": "2007-10-10",
    "img": "https://imgs.xkcd.com/comics/exploits_of_a_mom.png",
    "link": "",
    "num": 327,
    "title": "Exploits of a Mom",
    "transcript": "[[A woman is talking on the phone, holding a cup]]\nPhone: Hi, this is your son's school. We're having some computer trouble.\nMom: Oh dear—did he break something?\nPhone: In a way—\nPhone: Did you really name your son \"Robert'); DROP TABLE Students;--\" ?\nMom: Oh, yes. Little Bobby Tables, we call him.\nPhone: Well, we've lost this year's student records. I hope you're happy.\nMom: And I hope you've learned to sanitize your database inputs.\n{{title-text: Her daughter is named Help I'm trapped in a driver's license factory.}}"
  },
  "success": true
}