Skip to content

DivineAPI/fortune-cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Fortune Cookie - DivineAPI

Start your FREE Trial to get your API KEY, https://divineapi.com

Travis Docs Maintenance yes SayThanks Paypal

divineapi logo

What is Fortune Cookie API?

Divine API is for those who are seeking for an excellently built Fortune Cookie API to inculcate in their website or application. It extracts data to predict all about an Individuals life and answers to the question he is seeking.

Why Fortune Cookie API?

Divine API can help the developers to inculcate a finely built fortune cookie API and give their customers a fun experience of cracking their own fortune cookie digitally.

Features

  • Fortune cookie API lets you crack your own fortune cookie digitally.
  • It contains fortunes and quotes related to one’s lives.
  • The attractive user interface captures customers interest greatly.
  • Fun way to get the insights into future predictions.
  • It answers to your questions that have remained unanswered for a while.

Benefits

  • Crack as many cookies as you want with the fortune cookie API.
  • Receive the personalized fortune with the virtually baked fortune cookie.
  • It shall bring vibrancy to your website.

URL

POST: https://divineapi.com/api/1.0/get_fortune_cookie.php

Parameters

api_key :
Your API KEY.

Result Example:

{
    "success": 1,
    "message": "Fortune Cookie result.",
    "data": {
        "prediction": {
            "result": "R1 new"
        }
    }
}

Example

cURL

curl -d "api_key=YOUR_API_KEY" -X POST https://divineapi.com/api/1.0/get_fortune_cookie.php

Python

import requests
from requests.structures import CaseInsensitiveDict

url = "https://divineapi.com/api/1.0/get_fortune_cookie.php"

headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"

data = "api_key=YOUR_API_KEY"


resp = requests.post(url, headers=headers, data=data)

print(resp.status_code)

Javascript

var url = "https://divineapi.com/api/1.0/get_fortune_cookie.php";

var xhr = new XMLHttpRequest();
xhr.open("POST", url);

xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = "api_key=YOUR_API_KEY";

xhr.send(data);

PHP

<?php
 $url = "https://divineapi.com/api/1.0/get_fortune_cookie.php";

 $curl = curl_init($url);
 curl_setopt($curl, CURLOPT_URL, $url);
 curl_setopt($curl, CURLOPT_POST, true);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

 $headers = array(
    "Content-Type: application/x-www-form-urlencoded",
 );
 curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

 $data = "api_key=YOUR_API_KEY";

 curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

 $resp = curl_exec($curl);
 curl_close($curl);
 var_dump($resp);
?>

jQuery Ajax

 $.ajax({
type:'POST',
url:'https://divineapi.com/api/1.0/get_fortune_cookie.php',
data: {api_key:'YOUR_API_KEY'},
success:function(data){
console.log(data);
}
 });

ECMAScript (ES6)

const URL = 'https://divineapi.com/api/1.0/get_fortune_cookie.php?api_key=YOUR_API_KEY';
fetch(URL, {
    method: 'POST'
})
.then(response => response.json())
.then(json => {
    const date = json.current_date;
    console.log(date);
});

Services

Horoscope Daily Tarot Yes No Tarot Fortune Cookie Coffee Cup

License

2021 Divine API

Licensed under the Apache License, Version 2.0 (the "License");

http://www.apache.org/licenses/LICENSE-2.0

Contact

Questions? Suggestions? Feel free to contact me at admin@divineapi.com

Credits

Source of updates - https://divineapi.com/fortune-cookie-api

Please feel free to use and adapt this awesome API.