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.
This is the Dart/Flutter client for the Magic 8-Ball API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_magic8ball: ^1.2.6
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
- API Home: Magic 8-Ball API
- Documentation: docs.apiverve.com/ref/magic8ball
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