Skip to content

REST Against Humanity

REST Against Humanity is a public API for Cards Against Humanity. You can use it to programatically obtain cards from any of Cards Against Humanity's 71 official packs.

You should probably read the rules of Cards Against Humanity before using this API.

REST Against Humanity is accessible at restagainsthumanity.com/api/graphql.

This is a GraphQL API

This version of REST Against Humanity uses GraphQL. You should familiarize yourself with the GraphQL language before using it.

Introspection

You can explore the API's schema and build queries from the comfort of your browser with GraphiQL.

Open GraphiQL

Query Fields

packs Pack

List Cards Against Humanity packs.

Argument Type Description Required?
where PackFilter! Criteria by which to filter the packs returned. No

Objects

Pack

A Cards Against Humanity pack.

Field Type Description
name String! The name of the pack.
id Int! The ID of the pack.
black [BlackCard!]! The pack's black cards.
white [WhiteCard!]! The pack's white cards.

For the black field:

Argument Type Description Required?
where BlackCardFilter! Criteria by which to filter the cards returned. No

For the white field:

Argument Type Description Required?
where WhiteCardFilter! Criteria by which to filter the cards returned. No

BlackCard

A Cards Against Humanity black card.

Field Type Description
text String! The text of the card.
pick Int! The number of blank spaces the card has.
pack Pack! The pack the card belongs to.

WhiteCard

A Cards Against Humanity white card.

Field Type Description
text String! The text of the card.
pack Pack! The pack the card belongs to.

Inputs

PackFilter

Criteria by which to filter packs.

Field Type Description Required?
name String The name of the pack. No
id Int The ID of the pack. No

BlackCardFilter

Criteria by which to filter black cards.

Field Type Description Required?
text String The text of the card. No
pick Int The number of blank spaces the card has. No

WhiteCardFilter

Criteria by which to filter white cards.

Field Type Description Required?
text String The text of the card. No

Examples

Listing all pack names

query {
  packs {
    name
  }
}

Listing all packs and cards

query {
  packs {
    name
    black {
      text
      pick
    }
    white {
      text
    }
  }
}

Listing all black cards with a pick of 2

query {
  packs {
    name
    black(where: { pick: 2 }) {
      text
      pick
    }
  }
}

Listing all packs with the word "expansion" in their name

query {
  packs(where: { name: "expansion" }) {
    name
  }
}