Halloween Fortune Challenge: Discover Your Future🎃
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
In this Halloween challenge, you’ll become a master of the mystical arts—by calling a Cloud API. No crystal ball needed— just Postman or a bit of code magic.
Call upon the Tarot Card API to draw a card from the deck of fate. Will it predict success, love, or perhaps… something more mysterious?
Once you retrieve your card, share the name, its upright meaning, and its reversed meaning. Who knows what fortune (or misfortune) awaits? 🔮
There are two options for completing this challenge: using Postman, or JavaScript. If you are new to programming, you might find Postman an easier route, but this can be completed either way!
Are you ready to uncover your Halloween fortune? Let’s find out… if you’re brave enough!
Option A: Call the Tarot Card API with Postman
-
Open Postman
-
Download or access the in-browser version here.
-
-
Create a new request.
-
Select “New” in the top left hand corner, and then HTTP request.
-
Select
GET
as your method.-
A
GET
request is used to retrieve data from a server (in this case to retrieve a random tarot card from the server). -
Other common HTTP request types include:
-
POST
: Sends data to the server to create or update resources. For example, when you submit a form on a website, it often uses aPOST
request. -
PUT
: Updates an existing resource with new data. For example, updating an email in a database. -
DELETE
: Removes a specified resource from the server, like deleting an item from a database.
-
-
-
Paste in your URL:
https://tarotapi.dev/api/v1/cards/random?n=1
-
Note: if you wanted to return multiple cards you could change n=1 to a different number (there are 78 cards in a Tarot deck!).
-
-
-
Send the request by clicking the "Send" button.
-
Find your fortune in the response!
-
Look for the "name" of your card.
-
Find the "meaning_up" (for an upright card) and "meaning_rev" (for a reversed card).
Example Response:
{ "nhits": 1, "cards": [ { "name": "Two of Cups", "name_short": "cu02", "value": "two", "value_int": 2, "suit": "cups", "type": "minor", "meaning_up": "Love, passion, friendship, affinity, union, concord, sympathy, the interrelation of the sexes, and--as a suggestion apart from all offices of divination--that desire which is not in Nature, but by which Nature is sanctified.", "meaning_rev": "Lust, cupidity, jealousy, wish, desire, but the card may also give, says W., \"that desire which is not in nature, but by which nature is sanctified.\"", "desc": "A youth and maiden are pledging one another, and above their cups rises the Caduceus of Hermes, between the great wings of which there appears a lion's head. It is a variant of a sign which is found in a few old examples of this card. Some curious emblematical meanings are attached to it, but they do not concern us in this place." } ] }
-
Bonus: your API was automatically formatted with “Pretty” JSON code. Try clicking “Visualize” in Postman and watch it magically format your API call into a table!
Option B: Call the Tarot Card API with JavaScript
-
Set up your local environment
-
First, create a folder for this project. You can name it whatever you want, but I named mine
Fortune Teller
. -
Open your favorite IDE. I like Visual Studio Code.
-
Create an
index.html
file in your IDE.
-
-
Write the code to call the API
-
Open the
index.html
file. Copy and paste the following code:
-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tarot Card API Fortune</title>
</head>
<body>
<!-- Text and styling the page -->
<h1>Reveal Your Halloween Tarot Card!</h1>
<button id="drawCardButton">Draw a Card</button>
<p id="cardName"></p>
<p id="meaningUp"></p>
<p id="meaningRev"></p>
<script>
// Function to call the Tarot Card API
function drawTarotCard() {
fetch('https://tarotapi.dev/api/v1/cards/random?n=1')
.then(response => response.json())
.then(data => {
const card = data.cards[0]; // Get the first card
document.getElementById('cardName').textContent = `Card Name: ${card.name}`;
document.getElementById('meaningUp').textContent = `Upright Meaning: ${card.meaning_up}`;
document.getElementById('meaningRev').textContent = `Reversed Meaning: ${card.meaning_rev}`;
})
.catch(error => console.error('Error:', error));
}
// Add event listener to the button
document.getElementById('drawCardButton').addEventListener('click', drawTarotCard);
</script>
</body>
</html>
-
Run the HTML file
-
Save the
index.html
file. -
Open the folder where your
index.html
file is located. -
Open the file in your web browser (you may need to double click)!
-
-
Draw your Tarot Card
-
On the webpage, you’ll see a button labeled "Draw a Card." Click the button, and it will fetch a random tarot card from the API.
-
Below the button, you’ll see the card name, its upright meaning, and its reversed meaning displayed.
-
Now you’ve conjured your Halloween fortune! Share your fortune below to get your Halloween badge. Keep honing your API skills because we’re brewing up some exciting API improvements. The future is bright, and your Alteryx API wizardry will soon be stronger than ever!
- Labels:
-
API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I got the high priestess! Used the visualize option in Postman--love it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have received the Six of Wands!
Apparently that means either:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How fun - I got the Ace of Cups! The visualize option in Postman was a nice view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So fun! I got the Six of Cups! 🔮
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Fun challenge, but couldn't get the Visualize button to work :(
I drew "the Lovers" card
card up meaning - Attraction, love, beauty, trials overcome
card down meaning - Failure, foolish designs. Another account speaks of marriage frustrated and contrarieties of all kinds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
JavaScript version
But I did this Base A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Four of Wands! Nice!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I got Three of Swords, which seems a bit dark . . .
Meaning upright: Removal, absence, delay, division, rupture, dispersion, and all that the design signifies naturally, being too simple and obvious to call for specific enumeration.
Meaning reversed: Mental alienation, error, loss, distraction, disorder, confusion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I tried it with Alteryx.