Tarot Cards API
Tarot Cards API will help you to get random tarot cards with upright and reversed cards. Not random but calculated based on your numerology meaning (name, date of birth, question).
API Endpoints Reference
draw_cards async
| Method | Path | Description |
|---|---|---|
POST | /tarot-cards/draw | Get shuffled tarot cards |
| PARAMETER | DESCRIPTION |
|---|---|
request | The request object containing the name, dob, and count. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CardsAPIResponse | The response object containing the cards. TYPE: |
Note
This function uses the get_shuffled_cards function to get the shuffled tarot cards.
Example Response
{
"cards": [
{
"name": "Eight of Pentacles",
"is_upright": false,
"image_url": "/tarot-cards/images/72.jpg",
"full_card_name": "Eight of Pentacles (REVERSED)"
},
{
"name": "King of Cups",
"is_upright": false,
"image_url": "/tarot-cards/images/36.jpg",
"full_card_name": "King of Cups (REVERSED)"
},
...
]
}
Source code in api/index.py
get_card_info
| Method | Path | Description |
|---|---|---|
GET | /tarot-cards/get-card-info | Get card info by number |
| PARAMETER | DESCRIPTION |
|---|---|
card_number | The card number (Range: 1-78). TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CardInfoAPIResponse | The response object containing the card info. TYPE: |
Note
This function uses the TarotDeck class to get the card info.
Example Response
{
"name": "The Fool",
"number": "1",
"arcana": "The Fool",
"suit": "Major Arcana",
"image_url": "/tarot-cards/images/1.jpg",
"fortune_telling": ["..."],
"keywords": ["..."],
"meanings": {...},
"archetype": "...",
"hebrew_alphabet": "...",
"numerology": "...",
"elemental": "...",
"mythical_spiritual": "...",
"questions_to_ask": ["..."]
}
Source code in api/index.py
Models Reference
TarotCard pydantic-model
Show JSON schema:
{
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"is_upright": {
"title": "Is Upright",
"type": "boolean"
},
"image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image Url"
}
},
"required": [
"name",
"is_upright"
],
"title": "TarotCard",
"type": "object"
}
Fields:
-
name(str) -
is_upright(bool) -
image_url(Optional[str])
CardsAPIRequest pydantic-model
Show JSON schema:
{
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"dob": {
"title": "Dob",
"type": "string"
},
"count": {
"default": 10,
"title": "Count",
"type": "integer"
},
"follow_numerology": {
"default": false,
"title": "Follow Numerology",
"type": "boolean"
}
},
"required": [
"name",
"dob"
],
"title": "CardsAPIRequest",
"type": "object"
}
Fields:
-
name(str) -
dob(str) -
count(int) -
follow_numerology(bool)
Validators:
-
validate_dob_format→dob
CardsAPIResponse pydantic-model
Show JSON schema:
{
"$defs": {
"TarotCard": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"is_upright": {
"title": "Is Upright",
"type": "boolean"
},
"image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image Url"
}
},
"required": [
"name",
"is_upright"
],
"title": "TarotCard",
"type": "object"
}
},
"properties": {
"cards": {
"items": {
"$ref": "#/$defs/TarotCard"
},
"title": "Cards",
"type": "array"
}
},
"required": [
"cards"
],
"title": "CardsAPIResponse",
"type": "object"
}
Fields:
-
cards(List[TarotCard])
CardInfoAPIResponse pydantic-model
Show JSON schema:
{
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"number": {
"title": "Number",
"type": "string"
},
"arcana": {
"title": "Arcana",
"type": "string"
},
"suit": {
"title": "Suit",
"type": "string"
},
"image_url": {
"title": "Image Url",
"type": "string"
},
"fortune_telling": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Fortune Telling"
},
"keywords": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Keywords"
},
"meanings": {
"anyOf": [
{
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Meanings"
},
"archetype": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Archetype"
},
"hebrew_alphabet": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Hebrew Alphabet"
},
"numerology": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Numerology"
},
"elemental": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Elemental"
},
"mythical_spiritual": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Mythical Spiritual"
},
"questions_to_ask": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Questions To Ask"
}
},
"required": [
"name",
"number",
"arcana",
"suit",
"image_url"
],
"title": "CardInfoAPIResponse",
"type": "object"
}
Fields:
-
name(str) -
number(str) -
arcana(str) -
suit(str) -
image_url(str) -
fortune_telling(Optional[List[str]]) -
keywords(Optional[List[str]]) -
meanings(Optional[Dict[str, List[str]]]) -
archetype(Optional[str]) -
hebrew_alphabet(Optional[str]) -
numerology(Optional[str]) -
elemental(Optional[str]) -
mythical_spiritual(Optional[str]) -
questions_to_ask(Optional[List[str]])