Finally, Cards Against Humanity compiled and organized as clean plain text and structured JSON.
This repository contains tools and datasets for the complete Cards Against Humanity card corpus, aggregating over 64,000+ unique cards across 420+ official and fan-made packs.
Check out the web interface demo at jah.firer.at to browse, search, filter, combine, and export packs!
- Aggregated Card Corpus: Consolidates official sets, discontinued expansions, limited holiday releases, PAX promo decks, third-party commercial cards, and fan expansions side-by-side.
- Intelligent Deduplication: Automatically deduplicates card text globally and inside individual packs, meaning the data loads cleanly into relational databases (like SQLite or Postgres) with unique relational constraints.
- Text Normalization: Exotic unicode characters, quote marks, and spaces are normalized and cleaned up.
- Optimized Formats: Includes both flat-file JSON formats (
full.json) and a highly-optimized indexed format (compact.json) that saves bandwidth by referencing a shared card pool. - Active Sheets Builder: Includes a Node.js utility to fetch, parse, validate, and build the card datasets directly from public Google Spreadsheets.
Optimized for minimum file size and web deployment. It uses a shared pool of unique white, black (prompt), and mechanic cards. Individual packs reference these cards by their index positions in the global arrays.
{
"white": [
"Being black.",
"Irritable Bowel Syndrome.",
"A room full of nightmares."
],
"black": [
{ "text": "Next from J.K. Rowling: Harry Potter and the chamber of _.", "pick": 1 }
],
"mechanic": [
"The Ultimate TRUMP Card"
],
"packs": [
{
"name": "Babies Against Parenthood",
"official": false,
"sheetName": "Fan Expansions",
"white": [2],
"black": [0],
"mechanic": [0],
"code": "BAP",
"author": "John Doe",
"language": "en"
}
]
}A straightforward format where every pack object is fully self-contained. Card text is fully duplicated inside each pack, making it extremely easy to parse in simple client scripts.
[
{
"name": "Cards Against Humanity: Main Deck (All Versions)",
"official": true,
"white": [
{ "text": "Being black.", "pack": 0 }
],
"black": [
{ "text": "Next from J.K. Rowling: Harry Potter and the chamber of _.", "pick": 1, "pack": 0 }
]
}
]Ideal for grep queries or simple text processing. White cards and black cards are separated by a divider, with one card printed per line:
White, answer cards.
Another white card on this line.
----------
I love it when my _ are in plaintext.
The card database is compiled from the community's Google Sheets (like the Card Listing Spreadsheet and the ManyDecks spreadsheet).
You can run the script under tools/update-from-sheets.mjs to fetch sheet columns, validate card counts against the Index, deduplicate records, and rebuild cah-all-compact.json.
- Node.js (v16+)
The script uses OAuth 2.0 to access the Google Sheets API:
- Go to the Google Cloud Console.
- Create or select a project and enable the Google Sheets API.
- Create credentials: click + Create Credentials → OAuth client ID (Application type: Desktop app).
- Download the client secret JSON file, rename it to
credentials.json, and place it in the project root astools/credentials.json. (This file is ignored by git).
To build the dataset:
npm install
npm run update-cards- First Run: The script will launch a browser window asking you to authenticate with Google. Once authorized, it will save
tools/token.jsonso you do not need to authenticate again. - Caching: Sheet data is cached under
temp_sheet_data/to make subsequent runs much faster. To force a complete fetch from the API, delete thetemp_sheet_data/directory. - Deduplication Warnings: During compilation, any duplicate cards found within a single pack are automatically skipped. The compiler prints out a warning detailing the exact cell coordinates (e.g.
cell=Etsy!G3182), making it easy to identify and clean up the spreadsheet.
A lightweight helper library is provided under web/CAHDeck.js to parse the compact indexed JSON format and reconstitute it in client-side Javascript.
The website itself (code in web/site.js) is an example implementation of:
- Fetching and loading
cah-all-compact.json. - Rendering available card packs and allowing users to select/deselect them.
- Combining the selected decks in-memory.
- Exporting combined card collections to plain text or JSON files.
This project is free, open-source, and provided under the CC BY-NC-SA 4.0 license.
Cards Against Humanity® is distributed under a Creative Commons BY-NC-SA 4.0 license. You can copy, modify, and redistribute their content as long as you:
- Make your work available completely for free.
- Share it under the same Creative Commons license (CC BY-NC-SA 4.0).
- Provide attribution to Cards Against Humanity.
If you have questions, feedback, or need to report any issues, please open a GitHub issue.