ponyfac.es - API Reference

Before you read on

If you only want to display the image in your client and already have the number/id of a face, you don't need to use the API at all. Just add /full (for the full-sized image) or /thumb (for the thumbnail) to its URL to get it.

Example:
//ponyfaces.hpcodecraft.me/1/full
//ponyfaces.hpcodecraft.me/1/thumb

How to use the API

A typical API call looks like this:
//ponyfaces.hpcodecraft.me/api.json/tag:happy

The URL parts explained:

The API endpoint URL. It always stays the same, just copy it from above.

The URL parameter, depending on the command. Not every command needs a parameter - see the examples below for more info.

Examples

Get data by id

See the example below to learn how to get a faces data by its id:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/id:1
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/id:1
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/id:1
Response in XML format:

If you want to get data for multiple faces just pass several comma-separated ids like so:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/id:23,42
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/id:23,42
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/id:23,42
Response in XML format:

Get data by tag

You can also receive all faces that match a given tag. To do so, pass in the tag:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/tag:happy
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/tag:happy
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/tag:happy
Response in XML format:

Get list of all available tags

Call the URL from the example below to get a list of all available tags:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/tags
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/tags
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/tags
Response in XML format:

Get data by category

To get all faces in a given category you can pass in a category id:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/category:1
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/category:1
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/category:1
Response in XML format:

Get list of all available categories

See the example below to learn how to get a list of all categories:

Requested URL: //ponyfaces.hpcodecraft.me/api.json/categories
Response in JSON format:
Requested URL: //ponyfaces.hpcodecraft.me/api.jsonp:myJSONPcallback/categories
Response in JSONP format:
Requested URL: //ponyfaces.hpcodecraft.me/api.xml/categories
Response in XML format: