Giter Site home page Giter Site logo

cah-api's Introduction

Cards Against Humanity API

Base URL

This API can be accessed at https://cards-against-humanity-api.herokuapp.com/

Overview

The Cards Against Humanity API allows a user to get raw JSON data of the entire card base of the card game Cards Against Humanity, as well as propose new cards to just the API.

We are in no way affiliated with Cards Against Humanity, but full credit to all of the cards in our current sets to them.

If you have not played and/or do not know how to play, we strongly urge you to check out the Orignal Game. But we do have an explanation of the rules here(at the bottom of the page)

Card Types

Black Cards

A black card is a prompt card and will often have a blank spot represented by an underscore in the JSON. Not every set contains black cards and the sets that do contain many more white cards than black cards. Often a black card will require 2 white cards instead of just one, because of this, they are stored in the database as an object with their card text and how many you need to pick

{"text": "why can't I sleep at night?", "pick": 1}
White Cards

A white card is a response card, played in after the black card played. White cards are in every card set and are very abundant. There are more white cards because at least 2 white cards get played every round while only 1 black card gets played. Players also need to have 10 of these in their hands at a time.
White cards are stored in the database simply as a string
'Being fabulous.'

Endpoints

GET
  • '/sets' - gives you a list of all the different card sets
{"cardsets": ["Base","90s","Box","Canadian" "..."]}
  • '/sets/:set' - gives you the data of just one card set
{
  "setName": "Base",
  "blackCards": [{"text": "Why can't I sleep at night?", "pick": 1}, {"text": "I got 99 problems but _ ain't one.", "pick": 1} "..."],
  "whiteCards": ["Coat hanger abortions.", "Man meat.", "Autocannibalism." "..."]
  }
  • '/sets/multi?sets=[set1],[set3],[set3]...' - gives you all the cards from multiple sets
{[
  {"setName": "Base", "blackCards": ["..."], "whiteCards": ["..."]},
  {"setName": "90s", "blackCards": ["..."], "whiteCards": ["..."]},
   "..."
]}
  • '/sets/:set?n=[numcards]' - gives you a [numcards] random white cards from a given set
{"cards": ["Coat hanger abortions.", "Man meat.", "Autocannibalism."]}

Cards Against Humanity Rules

Again, you would get a much better grasp of the rules by actually playing the game. That being said, the game is incredibly simple and played just like Apples to Apples.

The game is played with 3 or more players, you decide on one random "Card Czar" who then deals 10 white cards to each player including themselves. Then turns over one black card.

Everyone except for the Card Czar puts a white card face down in the center when everyone has played, the Card Czar flips all of the white cards over and reads them out. Then the Card Czar decides on which white card goes with the black card the best, or is the funniest.

The player who played that white card then gets the black card, all the white cards go to the bottom of the deck, and the next player counter-clockwise is the new Card Czar. Everyone then draws white cards until they get back to 10.

This keeps going until one player gets to an agreed upon final number of black cards.

cah-api's People

Contributors

dependabot[bot] avatar drakevorndran avatar spglancy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.