im9.eu Image Hosting » API

  1. Random image
  2. Me

Uploading an image How to perform image upload trough im9 API

API input: (and preparation)

  • Create an album
  • In the album manager, go to the "API" tab, and copy your API key
  • POST image and key to http://api.im9.eu/upload/ to preform a basic upload

API use example: (sending filename.jpg to our "test" album using curl)

$ curl -s -F "image=@filename.jpg" -F "key=test/1234567890qwertyuiopasdfghjklzxc" http://api.im9.eu/upload/

API output: (text/plain in UTF-8 with standard HTTP headers)

OK
http://im9.eu/picture/filename

OK can be replaced by "ERROR" (2nd line contains the error description then). picture can be "animation" if the image has multiple frames and filename (URI) is based on the posted image file name (will contain only alphanumerics and "-").

API tip: (easily convert an image page URL into a direct file or thumbnail URL)

Page to file:
http://im9.eu/picture/filename » http://p.im9.eu/filename.jpg
http://im9.eu/animation/filename » http://a.im9.eu/filename.gif
Page to thumbnail (it's never animated, always .jpg):
http://im9.eu/picture/filename » http://t.im9.eu/filename.jpg
http://im9.eu/animation/filename » http://t.im9.eu/filename.jpg

Getting an image data How to obtain image data trough im9 API

API use example: (getting http://im9.eu/picture/thats-my-cat data using curl)

$ curl -s http://api.im9.eu/stat/?image=thats-my-cat

API output: (text/plain in UTF-8 with standard HTTP headers)

OK
NAME: Thats my cat!
URL: http://p.im9.eu/thats-my-cat.jpg
SIZE: 77623
MD5: 816cdcea208c92e6be95f701d754dff8
WIDTH: 500
HEIGHT: 750
ANIMATED: 0
DATE: 1356083820
VIEWS: 249
TODAY: 35
LATEST: 1357765919
ALBUM: Rehost
ALBUMURL: http://im9.eu/album/rehost
COLORS: 171616 4f413b 555454 746457 6e6d6d 80776e 918072 808080 888988 9f9080 909090 9e9790 9e9e9e b0a298 ababab b6b0ab b6b6b6 bbbcbc c1b6ad c8c0b7 c1c1c1 cbc6c0 cacaca d4cec7 d4d4d4 dbdad5 dcdcdc e2e2de e9e9e9 eff1f3 f4f4f4 fdfdfd
TAGS: cat metal funny

OK can be replaced by "ERROR" (2nd line contains the error description then). ANIMATED is a Boolean value. DATE is a UNIX timestamp for when the image has been uploaded. TODAY is a views counter restarted every midnight (see time on our servers). LATEST is a UNIX timestamp for when the image has been latest viewed. COLORS is a list of max. 32 most common colors of the image (HEX notation).

Getting a random image URL How to get a random image URL trough im9 API

API use example: (getting a direct image file link using curl)

$ curl -s http://api.im9.eu/random/

API output: (text/plain in UTF-8 with standard HTTP headers)

OK
http://p.im9.eu/thats-my-cat.jpg

OK can be replaced by "ERROR" (2nd line contains the error description then).

©2017 SublimeStar