Magic 8-Ball API - Dart/Flutter Client

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. For entertainment purposes only.

pub package License: MIT

This is the Dart/Flutter client for the Magic 8-Ball API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_magic8ball: ^1.2.7

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_magic8ball/apiverve_magic8ball.dart';

void main() async {
  final client = Magic8ballClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'question': 'Will it rain today?'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response

{
  "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"
  }
}

API Reference

Authentication

All requests require an API key. Get yours at apiverve.com.

License

MIT License - see LICENSE for details.


Built with Dart for APIVerve

Libraries

apiverve_magic8ball
Magic 8-Ball API client for Dart/Flutter