Skip to content

crhallberg/json-against-humanity

Repository files navigation

CC BY-NC-SA 4.0

JSON Against Humanity

Finally, Cards Against Humanity as plain text and JSON.

FAQ

How many cards are there?

There are 31,700 cards available from 205 different packs and boxes.

  • That's all 5,702 official cards from 71 different products
  • Plus 25,998 even worse cards from fans around the world

Wha— where the heck did you find all those cards??

The primary source is this Google Sheet I found through Board Game Geek. Previous sources included Hangouts Against Humanity, Pretend You're Xyzzy, and contributions from viewers like you.

What font is CAH?

Cards Against Humanity® cards are printed in Helvetica® Neue. It's not free. I use Inter Medium. You're looking at it now.

Who are you?

Chris Hallberg.

I'm just getting started and I have a lot of questions

You can reach me by opening an Issue on GitHub or by email at [email protected]. I'd love to hear from you!

I have the best feature idea! Can you add this?

Sure! Open a pull request.

I want to give you money.

That's very nice of you but you legally can't. More on that later. You should instead donate to local community bail funds.

File formats

Plaintext

White, answer cards.
Putting a new card on each line.
Adding a divider after the white cards.
----------
I love it when my _ are in plaintext.
How are these cards styled?
Are **you** telling **me** that _these cards_ are styled with Markdown and _?

full.json

[
  {
    "name": "The Base Set",
    "description": "Sweet dirty vanilla",
    "official": true,
    "white": [
      {
        "text": "Answer cards in plain text, formatted with **Markdown**",
        "pack": 0
      }
    ],
    "black": [
      {
        "text": "_Prompt_ cards\nwith _ for blanks!",
        "pick": 1,
        "pack": {pack index}
      }
    ]
  },
  { "white": [ { "pack": 1 }, ... ], ... },
  { "white": [ { "pack": 2 }, ... ], ... }
]

compact.json

I wrote a small library to take advantage of this concise format: CAHDeck.js.

{
  "white": ["Answer cards in plain text, formatted with **Markdown**"],
  "black": [
    { "text": "_Prompt_ cards\nformatted with _.", "pick": 1 },
    { "text": "I want a _ **and** _ sandwich! No corners!", "pick": 2 }
  ],
  "packs": {
    "abbreviation": {
      "name": "The Base Set",
      "description": "Sweet dirty vanilla",
      "official": true,
      "white": [0, 1, 2, "indexes for every white card in this pack"],
      "black": [0, 1, 2, "indexes for every black card in this pack"]
    }
  }
}

Examples

Canvas Deck Sampler. Demonstration of ingesting the cah-all-compact.json file with the basic Javascript library and displaying cards on a canvas element.

This Very Webpage. Ingesting from compact.json, listing decks, combining selected decks, and exporting files.

Fine Print

Is this legal?

Yes. Cards Against Humanity® is distributed under a Creative Commons BY-NC-SA 4.0 license. I think their website puts it best:

We give you permission to use the Cards Against Humanity® writing under a limited Creative Commons BY-NC-SA 4.0 license. That means you can use our writing if (and only if) you do all of these things:

  1. Make your work available totally for free.
  2. Share your work with others under the same Creative Commons license that we use.
  3. Give us credit in your project.

If you have questions or paperwork that says otherwise, contact me, we can work this out.