/api/astro/tarot/deck/1 кредитДовідник колоди Таро
Уся колода й усі розклади як довідкові дані. Усі сімдесят вісім карт — двадцять два старші аркани і чотири масті по чотирнадцять карт — кожна зі своєю мастю, стихією, номером і ключовими словами для обох положень. Також усі розклади з підписами позицій: лише так можна дізнатися, які значення приймає `spread`. Ендпоінт потрібен, щоб клієнт міг показати витягнуту карту без власної копії колоди, яка з часом почала б розходитися з нашою.
https://api.occultapi.com/api/astro/tarot/deck/Автентифікація
Передавайте ключ у заголовку X-API-Key. Ключ — це серверні облікові дані: ніколи не вставляйте його в JavaScript, що виконується в браузері, чи в мобільний застосунок.
X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/jsonПоля запиту
| Поле | Тип | Обов’язкове | Примітки |
|---|---|---|---|
| arcana | string | необов’язковий | Звузити список. Двадцять два старші аркани часто потрібні окремо — деякі тарологи працюють лише з ними. bothmajorminor |
| suit | string | необов’язковий | Повернути лише одну масть. Ігнорується, якщо arcana має значення 'major'. allWandsCupsSwordsPentacles |
Приклад запиту
curl -X POST https://api.occultapi.com/api/astro/tarot/deck/ \
-H "X-API-Key: $OCCULT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"arcana":"both","suit":"all"}'Відповідь
{
"_truncated": true,
"_note": "Response shortened for the catalogue.",
"preview": "{\"data\": {\"deck\": \"Rider-Waite-Smith\", \"arcana\": \"both\", \"suit\": \"all\", \"count\": 78, \"deck_size\": 78, \"suits\": [{\"suit\": \"Wands\", \"element\": \"fire\", \"covers\": \"action, ambition, creativity, drive\"}, {\"suit\": \"Cups\", \"element\": \"water\", \"covers\": \"emotion, relationship, intuition, the inner life\"}, {\"suit\": \"Swords\", \"element\": \"air\", \"covers\": \"thought, conflict, truth, communication\"}, {\"suit\": \"Pentacles\", \"element\": \"earth\", \"covers\": \"work, money, the body, the material world\"}], \"ranks\": [\"Ace\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Page\", \"Knight\", \"Queen\", \"King\"], \"cards\": [{\"id\": 0, \"name\": \"The Fool\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 0, \"element\": null, \"upright\": \"beginnings, innocence, spontaneity, a leap taken\", \"reversed\": \"naivety, recklessness, a risk not thought through\"}, {\"id\": 1, \"name\": \"The Magician\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 1, \"element\": null, \"upright\": \"manifestation, resourcefulness, power, focused will\", \"reversed\": \"manipulation, untapped talent, scattered effort\"}, {\"id\": 2, \"name\": \"The High Priestess\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 2, \"element\": null, \"upright\": \"intuition, mystery, the inner voice, patience\", \"reversed\": \"secrets withheld, disconnection from instinct\"}, {\"id\": 3, \"name\": \"The Empress\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 3, \"element\": null, \"upright\": \"abundance, nurturing, fertility, creation\", \"reversed\": \"dependence, smothering, creative block\"}, {\"id\": 4, \"name\": \"The Emperor\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 4, \"element\": null, \"upright\": \"authority, structure, control, established order\", \"reversed\": \"domination, rigidity, authority misused\"}, {\"id\": 5, \"name\": \"The Hierophant\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 5, \"element\": null, \"upright\": \"tradition, institutions, guidance, orthodoxy\", \"reversed\": \"rebellion, dogma questioned, going your own way\"}, {\"id\": 6, \"name\": \"The Lovers\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 6, \"element\": null, \"upright\": \"union, choice, alignment of values\", \"reversed\": \"disharmony, misalignment, a choice avoided\"}, {\"id\": 7, \"name\": \"The Chariot\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 7, \"element\": null, \"upright\": \"determination, momentum, willpower, control held\", \"reversed\": \"lack of direction, aggression, momentum lost\"}, {\"id\": 8, \"name\": \"Strength\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 8, \"element\": null, \"upright\": \"courage, patience, gentle power, self-mastery\", \"reversed\": \"self-doubt, force misapplied, inner weakness\"}, {\"id\": 9, \"name\": \"The Hermit\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 9, \"element\": null, \"upright\": \"introspection, solitude, the search, inner guidance\", \"reversed\": \"isolation, withdrawal, refusing counsel\"}, {\"id\": 10, \"name\": \"Wheel of Fortune\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 10, \"element\": null, \"upright\": \"luck, cycles, a turning point, fate moving\", \"reversed\": \"bad luck, resistance to change, a cycle repeating\"}, {\"id\": 11, \"name\": \"Justice\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 11, \"element\": null, \"upright\": \"fairness, truth, cause and effect, accountability\", \"reversed\": \"unfairness, dishonesty, consequences dodged\"}, {\"id\": 12, \"name\": \"The Hanged Man\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 12, \"element\": null, \"upright\": \"pause, surrender, a new perspective, suspension\", \"reversed\": \"stalling, indecision, delay without purpose\"}, {\"id\": 13, \"name\": \"Death\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 13, \"element\": null, \"upright\": \"endings, transformation, transition, what must go\", \"reversed\": \"resistance to change, stagnation, holding on\"}, {\"id\": 14, \"name\": \"Temperance\", \"arcana\": \"major\", \"suit\": null, \"rank\": null, \"number\": 14, \"element\": null, \"upright\": \"b"
}Записано з реального виклику з точно таким запитом, як вище. Результати лежать у data.
Помилки
Помилки обліку кредитів мають вигляд { "error": "…", "message": "<code>", "is_error": true }. Людям показуйте error, а логіку будуйте на message. Детальніше — у довіднику помилок.