Fortune Cookie
Deliver fortune cookie messages with Divine API. Easily integrate personalized, inspirational, and motivational insights into your platform with a simple API.
Introducing our Fortune Cookie API, a delightful way to infuse your website and applications with unexpected wisdom and fun. Easily integrate this API to provide users with random, inspirational, or humorous fortune cookie messages, adding a touch of surprise to their experience.
POST https://astroapi-5.divineapi.com/api/v2/fortune-cookieReturns Fortune Cookie in response
Headers
Name
Type
Description
Authorization*
String
your API Access Token
eg: Bearer {token}
Request Body
Name
Type
Description
api_key*
String
Your API Key (can be found on your Divineapi dashboard)
{
"success": 1,
"data": {
"prediction": {
"result": "Your next journey will take you to a place of peace and joy."
}
}
}Take a look at how you might call this method via cURL, NodeJS, JavaScript jQuery AJAX or Python:
curl --location 'https://astroapi-5.divineapi.com/api/v2/fortune-cookie' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"' \
--form 'lan="en"'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://astroapi-5.divineapi.com/api/v2/fortune-cookie',
'headers': {
'Authorization': 'Bearer {Your Auth Token}'
},
formData: {
'api_key': '{Your API Key}',
'lan': 'en'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var form = new FormData();
form.append("api_key", "{Your API Key}");
form.append("lan", "en");
var settings = {
"url": "https://astroapi-5.divineapi.com/api/v2/fortune-cookie",
"method": "POST",
"timeout": 0,
"headers": {
"Authorization": "Bearer {Your Auth Token}"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});import requests
url = "https://astroapi-5.divineapi.com/api/v2/fortune-cookie"
payload = {'api_key': '{Your API Key}',
'lan': 'en'}
headers = {
'Authorization': 'Bearer {Your Auth Token}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Last updated