|
FortuneKookie.com API Page
This API pulls one or more random fortune cookie fortunes from the database hosted on FortuneKookie.com, which has over 1500 unique fortunes. Each fortune includes the front message, the back word(s), and the lucky numbers.
We ask that you follow the following guidelines when using the API:
Only make requests that are necessary.
XML Specifications:
Sample XML: fortunekookie.xml
Sample Schema: fortunekookie.xsd
Sample PHP code for FortuneKookie.com API:
FortuneKookie.com API Class for PHP: fortunekookie.api.class.php
Sample PHP Code using FortuneKookie API: get_your_fortune.php
Error Status Codes:
- 100 - ERROR: Access code is incorrect
- 101 - ERROR: Number of fortunes [nbr] parameter is mal-formed
- 102 - ERROR: Number of requested fortunes must be 1 or more
- 103 - ERROR: Number of requested fortunes must be 10 or fewer
- 104 - ERROR: Could not connect to the database. Please try again later.
- 105 - ERROR: Database error. Please try again later.
- 106 - ERROR: No data rows found
- 200 - ERROR: Request a 32-digit security code at our website api [dot] fortunekookie [dot] com
Sample of Returned Error XML:
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error_nbr>103</error_nbr>
<error>ERROR: Number of requested fortunes must be 10 or fewer</error>
</hash>
Simply enter you e-mail address (website and comments are optional, but encouraged) and we'll send to you a 32-digit code for your installation of the FortuneKookie API. At some point, we are going to showcase websites that use the FortuneKookie API, but we need to know the URL...
We do not engage in any sort of SPAM and we do not sell your email address. Please do see our Privacy Policy for details. We collect your email address for two reasons:
To verify you really want the FortuneKookie security code (i.e., you are not a bot).
To collect technical statistics; such as, how many connects are made from your site and when the most recent connection was made.
|