delegator logo

need some answers?

try the magic eight ball

Make executive decisions easily and efficiently.

  • Accurate, well-formed results, guaranteed
  • Answers any and all questions, regardless of difficulty
  • Free API with response formats and examples
  • Perfect for vital decision making
  • All glory to the Hypnotoad!
  • Great perception and insight, for all occasions
8ball

Endpoint: https://8ball.delegator.com/magic/:format/:question
Example: https://8ball.delegator.com/magic/JSON/Should I pay this employee?
Example: https://8ball.delegator.com/magic/XML/Will I win the lottery?
Example: https://8ball.delegator.com/magic/JSON/Are showers a mandatory thing?

how to use it!

Crystal

#!/usr/bin/env crystal
require "http/client"
require "json"
require "uri"

params = URI.escape("How do I know this is real magic?")
response = HTTP::Client.get("https://8ball.delegator.com/magic/JSON/" + params)
puts JSON.parse(response.body)

Ruby

#!/usr/bin/env ruby
require 'json'
require 'net/http'

params = URI.encode('Can I ask you a question?')
uri = URI.join('https://8ball.delegator.com/magic/JSON/', params)
response = Net::HTTP.get(uri)
puts JSON.parse(response)

JavaScript

/* global fetch */

let params = encodeURIComponent('Is today going to be a good day?')
let uri = 'https://8ball.delegator.com/magic/JSON/' + params

fetch(uri)
  .then((response) => { return response.json() })
  .then((json) => { console.log(json) })

Python

#!/usr/bin/env python3
import http.client
import json
import urllib.parse

conn = http.client.HTTPSConnection("8ball.delegator.com")
question = urllib.parse.quote('Will a black cat cross me today?')
conn.request('GET', '/magic/JSON/' + question)
response = conn.getresponse()
print(json.loads(response.read()))

example data

Question Answer Type
Do I have toothpaste on my sweater? Signs point to yes Affirmative
Like what you see? Don't count on it Contrary
Will the world end this weekend? Reply hazy, try again later Neutral
Are you feeling lucky? You may rely on it Affirmative
Should I ask for a raise? Outlook not so good Contrary
Did the cat drag it in? Very doubtful Contrary
Will there be more snow? It is certain Affirmative
Should I try to skateboard? Concentrate and ask again Neutral
Is it safe to talk in the meeting? Without a doubt Affirmative
Will OP Deliver? Don't count on it Contrary