Overview
The ImageHost API allows users to upload images from whatever programming language they choose. Please note that this API is currently in beta testing, and more features will be added soon.
Commercial Usage
Not allowed. This is a free service, and if you're considered a commercial service then you should have enough money to pay for your own hosting!
URL's
Point your requests towards this URL:
http://imagehost.co.nz/api/
A secure version is coming soon.
Authentication
Included in your POST request are two parameters: API_KEY and API_EMAIL. These are to authenticate yourself with our servers and to accept your upload. If you lose your Developer API key, then fire off an email here from the email address you used to sign up, and we'll send you a new key.
I know authentication is a bitch, but I've tried to make it as simple as possible. For bandwidth reasons, you are limited to 50 uploads a day. The counter is reset at midnight each day. There is no limit for uploading images via the homepage; the limit only applies to the API.
If you feel that you deserve more than 50 uploads a day, then flick me an email, and we'll talk.
Uploading an Image
You will need to obtain an Developer API key to use this service first. Requests to this URL must be POST.
POST: http://imagehost.co.nz/api/upload/
| Parameter | Description |
| API_KEY | Your API developer key |
| API_EMAIL | The email address your API key was emailed to |
| image | The image file (JPG, GIF or PNG; 2MB max) |
Response
Every request made will result in a XML response (JSON coming soon). An example response of a successful POST:
<result>
<response>
<image>
<hash>lBk9oQN7G4</hash>
<extension>.jpg</extension>
<size>125889</size>
<adult>false</adult>
</image>
<links>
<page_url>http://imagehost.co.nz/i/lBk9oQN7G4</page_url>
<image_url>http://imagehost.co.nz/images/lBk9oQN7G4.jpg</image_url>
</links>
</response>
</result>
| Node | Description |
| hash | A unique filename that is generated upon upload |
| extension | Type of the image uploaded |
| size | The size of the image in bytes |
| adult | Whether the image has been marked as containing adult content via the uploader |
| page_url | A URL to the image page (includes various links/snippets) |
| image_url | The location of the image uploaded |
Any errors follow the same formatting style as the response above. An example response of a failed POST:
<result>
<response>No API Key specified</response>
</result>