← Развлечения

Случайный комикс xkcd

GET /xkcd/random

Получение случайного комикса xkcd из полного архива из 2 900+ комиксов за почти два десятилетия. Возвращает название комикса, номер, URL изображения, альтернативный текст (скрытый текст при наведении) и дату публикации. Идеально для функций «удиви меня», лент случайного контента, развлекательных виджетов и функций борьбы со скукой.

Примеры запросов

Базовое использование
curl https://nordapi.ee/api/v1/xkcd/random

Ответ в реальном времени

{
  "data": {
    "alt": "The MythBusters need to tackle whether a black hole from the LHC could REALLY destroy the world.",
    "date": "2008-11-26",
    "img": "https://imgs.xkcd.com/comics/induced_current.png",
    "link": "",
    "num": 509,
    "title": "Induced Current",
    "transcript": "[[A man wearing a beret, extension cord in hand, approaches Randall as he works at his computer.]]\nBeret: Can I plug my extension cord over here?\nRandall: No.\nBeret: Why?\nRandall: Solar Flares.\n[[A diagram is displayed, illustrating the Earth's magnetic field being permanently impacted by a large solar flare (represented by a large arrow).]]\n[[A second diagram is presented, illustrating the Earth's rotation and the resulting impact that the solar flare would have on the earth's magnetic field. ]]\nRandall: A large solar flare could dent the Earth's magnetic field inwards. The Earth's spin could then induce a strong current in any long conductors, melting them and starting fires. By extending your cord, you could kill us all.\n[[Stunned, the man wearing the beret looks down at the cord he carries.]]\nBeret: Really?\nRandall: Warn your friends.\n[[Dejected, the man walks away, cord in tow.]]\n[[Randall looks up from his computer as he is braced by his girlfriend, a stern look in her face.]]\nGirlfriend: That was MEAN.\nRandall: Listen, SOMEBODY has to keep MythBusters in business. Next season should be fun.\n{{title text: The MythBusters need to tackle whether a black hole from the LHC could REALLY destroy the world.}}"
  },
  "success": true
}