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.
Use translator for other language:
Update translator: https://divineapi.com/translator
en For English
hi For Hindi
pt For Portuguese
fr For French
es For Spanish
ru For Russian
de For German
nl For Dutch
it For Italian
pl For Polish
ar For Arabic
ja For Japanese
zh For Chinese
tm for Tamil
tl for Telugu
tr for Turkish
ta for Filipino/Tagalog
bn For Bengali
ma For Marathi
ml For Malayalam
kn For Kannada
POST
https://astroapi-5.divineapi.com/api/v2/fortune-cookie
Returns Fortune Cookie in response
your API Access Token
eg: Bearer {token}
Request Body
Your API Key (can be found on your Divineapi dashboard)
200: OK Successful
Copy {
"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 NodeJs Javascript-JQuery Python
Copy 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"'
Copy 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);
});
Copy 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);
});
Copy 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 22 hours ago