/tarot-api

Tarot API using ExpressJS and Nodejs

Primary LanguageJavaScriptMIT LicenseMIT

Tarot API 🔮

Currently working right now!

Tarot API provides information parsed from AE Waite's The Pictorial Key to the Tarot. This was created using ExpressJS and Nodejs.

Author: @yunkhngn

Quick start

fetch("https://tarotapi.vercel.app/api/")
  .then(function (response) {
    return response.json();
  })
  .then(function (response) {
    //extract data
  })
  .catch(function (error) {
    // handle what went wrong
  });

Documentation

GET path Result Params
/api/ or /api/cards return all cards
/api/cards/:name return card with specified name '/the-magician','/the-fool'...
/api/cards/:name/:search/ search fields of one cards /the-magician/desc
/api/random get 3 random card
/api/answer get random advices or answer for specific questions

JSON format:

{
  "type":"Type majors or minors",
  "slug":"Slug",
  "name_short":"Short name",
  "name":"Name",
  "value":"Card index (string)",
  "value_int": "Card index (number)",
  "meaning_up": "Meaning up.",
  "meaning_rev": "Meaning reverse.",
  "desc": "Descriptions"
}

Local development

  1. Clone this repository and install dependencies locally.
git clone https://github.com/yunkhngn/tarot-api.git
  1. Then
cd tarot-api

cd api

yarn install
#or npm install

node index.js
  1. Install nodemon (optional for hot reload)
yarn add nodemon

nodemon index.js

License & contributions

Contributions to Repository are welcome! To contribute, please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or fix
  3. Make changes and commit them to your branch
  4. Submit a pull request to the main repository.

Tarot API's Repository is licensed under the GNU License. See LICENSE for more information.