# xkcd API

> Retrieve xkcd comics as JSON.

xkcd is a games & comics API from xkcd.com. It needs no API key. It is served over HTTPS and does not allow direct browser requests (no CORS). Its OpenAPI description documents 2 endpoints.

## At a glance

- Category: [Games & Comics](https://www.openparable.com/apis/category/games-comics)
- Provider: xkcd.com
- Authentication: None (no API key)
- HTTPS: Yes
- CORS: No
- Base URL: http://xkcd.com/
- Documentation: https://xkcd.com/json.html
- OpenAPI description: https://api.apis.guru/v2/specs/xkcd.com/1.0.0/openapi.json
- Version: 1.0.0
- Specification updated: 2021-04-07

## Example request

```bash
curl -X GET "http://xkcd.com/info.0.json" \
  -H "Accept: application/json"
```

## Endpoints

- `GET /info.0.json` — Fetch current comic and metadata.
- `GET /{comicId}/info.0.json` — Fetch comics and metadata by comic id.

## Questions

### Does the xkcd API need an API key?

No. The xkcd API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

### Can I call the xkcd API from the browser?

Not directly. The xkcd API does not send CORS headers, so call it from your server or a proxy instead of browser JavaScript.

### Does the xkcd API support HTTPS?

Yes, the xkcd API is served over HTTPS.

### How many endpoints does the xkcd API have?

Its OpenAPI description lists 2 endpoints in version 1.0.0. All of them are shown on this page.

### What are alternatives to the xkcd API?

Other Games & Comics APIs include Chess.com, Scryfall, Riot Games, Lichess, Comic Vine.

## Similar games & comics APIs

- [Chess.com](https://www.openparable.com/apis/chess-com): Chess.com read-only REST API
- [Scryfall](https://www.openparable.com/apis/scryfall): Magic: The Gathering database
- [Riot Games](https://www.openparable.com/apis/riot-games): League of Legends Game Information
- [Lichess](https://www.openparable.com/apis/lichess): Access to all data of users, games, puzzles and etc on Lichess
- [Comic Vine](https://www.openparable.com/apis/comic-vine): The largest comic database online, Comic Vine features Comic Reviews, News, Videos, and Forums for the latest in and more!
- [RuneScape](https://www.openparable.com/apis/runescape): RuneScape and OSRS RPGs information
- [Digimon Information](https://www.openparable.com/apis/digimon-information): Provides information about digimon creatures
- [Wargaming.net](https://www.openparable.com/apis/wargaming-net): Wargaming.net info and stats
- [Pokéapi](https://www.openparable.com/apis/pokeapi): An open RESTful API for Pokémon data
- [Hypixel](https://www.openparable.com/apis/hypixel): Hypixel player stats
- [RAWG.io](https://www.openparable.com/apis/rawg-io): 500,000+ games for 50 platforms including mobiles
- [Clash of Clans](https://www.openparable.com/apis/clash-of-clans): Clash of Clans Game Information

Listed from: public-apis (MIT), public-apis database (MIT), Free Public APIs, APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/xkcd (OpenParable). Cite the canonical URL above.
