Upload image

im9.eu Хостинг Изображений

API

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 https://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" https://api.im9.eu/upload/

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

OK
https://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:
https://im9.eu/picture/filename     »   https://p.im9.eu/filename.jpg
https://im9.eu/animation/filename   »   https://a.im9.eu/filename.gif
Page to thumbnail (it's never animated, always .jpg):
https://im9.eu/picture/filename     »   https://t.im9.eu/filename.jpg
https://im9.eu/animation/filename   »   https://t.im9.eu/filename.jpg

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

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

$ curl -s https://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: https://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: https://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 an album data How to obtain album data trough im9 API

API use example: (getting https://im9.eu/album/my-r-funny-favs data using curl)

$ curl -s https://api.im9.eu/stat/?album=my-r-funny-favs

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

OK
    NAME: My r/FUNNY favs
     URL: https://im9.eu/album/my-r-funny-favs
    SIZE: 4231438894
  IMAGES: 6642
    DATE: 1382397392
   VIEWS: 78045
   TODAY: 38
  LATEST: 1491238190
    TAGS: funny gif lol rotfl

OK can be replaced by "ERROR" (2nd line contains the error description then). DATE is a UNIX timestamp for when the album has been created. TODAY is a views counter restarted every midnight (see time on our servers). LATEST is a UNIX timestamp for when the album has been latest viewed.

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 https://api.im9.eu/random/

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

https://p.im9.eu/thats-my-cat.jpg

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