The Fonxvard API

Take advantage of the awesome powers of fonxvard with the amazing API interface. Use the documentation below to get started. If you use this API to do something cool, please let us know!
Note: This API is subject to change at any time. There may be a bandwidth limit or request limit if things get out of hand. Check this page for future announcements regarding the API.

Method A: send image in POST, get image back

Post image to the following URL:
http://fonxvard.com/api/post
This method expects data in a file stream named 'image', equivilant to HTML form tag <input type="file" name="image"/>. Supported file types are JPG, GIF, PNG. File size must be no greater than 2MB.
Returns on success:
  • HTTP Status Code 200 OK
  • Header: Content-Type of original image, no caching
  • Image of the same file type and dimensions.
Returns on failure:
  • HTTP Status Code 4xx or 5xx (see status codes below)
  • Nothing else

Method B: send url in GET, get image back

Request the URL:
http://fonxvard.com/api/get?url={URI-encoded location of image file}
This method expects a full path to the image in a URI-encoded string. the 'url' paramter must start with 'http' and will only request the image thorugh that protocol. The image must be freely accessible on the internet, i.e. not behind a log-in or redirect header. Supported file types are JPG, GIF, PNG. File size must be less than 2MB.
Returns on success:
  • HTTP Status Code 200 OK
  • Header: Content-Type of original image, no caching
  • Image of the same file type and dimensions.
Returns on failure:
  • HTTP Status Code 4xx or 5xx (see status codes below)
  • Nothing else

Method C: Get daily information in JSON format.

Request the URL:
http://fonxvard.com/api/info
Returns:
  • HTTP Status Code 200 if succeeded
  • JSON result creates an object with the following props:
    'title' => Title of today's Fonxvard Is
    'creater' => Who made it
    'remaining' => number of minutes remaining

Error Codes

API failure will return HTTP-like error codes in these varieties:
Code Error Problem
400 url paramter required You issued a GET requestwith no ?url= parameter
400 url must use http protocol The GET request method retrieves images through HTTP only
400 source image not found The GET request could not find the image. It might be gone or it might be behind a log-in.
400 source image too large If you send large files, the clowns will get you...
400 no support for content-type ___ Unexpected file type. Only these types are supported: jpg, png, gif.
400 no image posted The POST method didn't receive an image
400 image upload error There was a problem with the image transfer in the POST method. Client network reset or something.
503 fonxvarding error Something happened on our side of things, but will probably be fixed soon.
503 api support modified The API changed without backwards-compatible support. Check this page for details.
503 service unavailable Fonxvard is down for maintenence.