Magic 8 Ball
The Magic 8 Ball API brings the time-honored tradition of shaking a plastic sphere to the digital age. Ask any yes-or-no question and receive a definitive answer from our proprietary blue-liquid algorithm. Features configurable cynicism levels for the modern professional and a corporate mode for when you need to justify decisions in a board meeting.
Try It — No Seriously
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
question |
string |
Required | — | Your burning question. We recommend keeping it to yes/no format, but we won't stop you from asking open-ended existential queries. |
cynical |
boolean |
Optional | false |
Enable cynical mode. Answers skew negative because life is like that sometimes. |
corporate |
boolean |
Optional | false |
Rephrase answers in corporate-speak. Useful for quarterly reviews and strategy meetings. |
Examples
curl "https://api.stupidapis.com/magic-8-ball/ask?question=Should+I+learn+Rust"
import requests
response = requests.get(
"https://api.stupidapis.com/magic-8-ball/ask",
params={"question": "Should I learn Rust"}
)
print(response.json())
const response = await fetch( "https://api.stupidapis.com/magic-8-ball/ask?question=Should+I+learn+Rust" ); const data = await response.json(); console.log(data);
Response Schema
| Field | Type | Description |
|---|---|---|
question |
string |
Your original question, echoed back for posterity |
answer |
string |
The 8 Ball's definitive response |
confidence |
number |
How confident the ball is (0-1). Unrelated to accuracy. |
shake_count |
number |
Number of shakes performed. More shakes = more accurate (not really). |
Example Response
{
"question": "Should I learn Rust?",
"answer": "Reply hazy, try again",
"confidence": 0.42,
"shake_count": 3
}