# Magic 8-Ball API

> Magic 8-Ball is a fun tool that provides random predictions and answers like the classic toy. It returns one of 20 classic Magic 8-Ball responses categorized as affirmative, negative, or non-committal.

**Endpoint:** `GET https://api.apiverve.com/v1/magic8ball`  
**Category:** Entertainment  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/magic8ball

## Overview

Magic 8-Ball answers a yes-or-no question with one of the 20 classic Magic 8-Ball responses, from "It is certain" to "Very doubtful". Send a question, or none at all, and get back the answer, your question echoed, a shake count and a timestamp.

It is a light way to add a fortune teller or decision maker to chat bots, Discord and Slack commands, party games, kids' apps and loading screens, without maintaining the answer list yourself.

The Free plan returns the answer text. Paid plans also say whether the answer is affirmative, negative or non-committal, and how certain it sounds, so an app can colour the reply or react differently to a firm no than to "Ask again later".

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/magic8ball?question=Will%20it%20rain%20today%3F" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `question` | string | No | Your question for the Magic 8-Ball (optional). length 0-500 |

## Response fields

- `question` — string · The question asked to the Magic 8-Ball
- `answer` — string · The Magic 8-Ball response prediction
- `type` — string · Category of response: affirmative, negative, or non-committal · (premium)
- `certainty` — string · Certainty level of the prediction response · (premium)
- `shake_count` — number · Number of times the Magic 8-Ball was shaken
- `timestamp` — string · ISO 8601 timestamp when prediction was generated

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "question": "Will it rain today?",
    "answer": "Signs point to yes",
    "type": "affirmative",
    "certainty": "medium",
    "shake_count": 3,
    "timestamp": "2025-12-16T22:25:52.008Z"
  }
}
```

## Use cases

- **Entertainment Apps** — Add fun decision-making features to apps and games with classic Magic 8-Ball responses
- **Chatbots** — Integrate playful response generation in chatbots and conversational interfaces
- **Party Games** — Create interactive party games and decision-making tools for social gatherings
- **Random Choice** — Provide lighthearted random answers for trivial decisions and entertainment

## SDKs

- **npm** — `npm install @apiverve/magic8ball` (https://www.npmjs.com/package/@apiverve/magic8ball)
- **Source** — https://github.com/apiverve/magic8ball-api

## More

- Full reference: https://docs.apiverve.com/ref/magic8ball
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
