Images API

■List

Summary

The API request to get a list of a user’s saved images.

URL

GET https://api.gyazo.com/api/images

parameters

KeyTypeRequiredDefaultRemarks
access_tokenstringUser's access token
pageinteger1
per_pageinteger201 to 100

response header

X-Total-Count:  350
X-Current-Page: 1
X-Per-Page:     20
X-User-Type:    lite

response body

[
    {
        "image_id": "8980c52421e452ac3355ca3e5cfe7a0c",
        "permalink_url": "http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c",
        "thumb_url": "https://i.gyazo.com/thumb/afaiefnaf.png",
        "url": "https://i.gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c.png",
        "type": "png",
        "created_at": "2014-05-21 14:23:10+0900"
    },
    {
        "image_id": "8980c52421e452ac3355ca3e5cfe7a0c",
        "permalink_url": "http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c",
        "thumb_url": "https://i.gyazo.com/thumb/afaiefnaf.png",
        "url": "https://i.gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c.png",
        "type": "png",
        "created_at": "2014-05-21 14:23:10+0900"
    },
    ...
]

■Upload

Summary

The API request to upload an image.

NOTICE

  • Use multipart/form-data
  • Be aware that the URL is different from the other API

URL

POST https://upload.gyazo.com/api/upload

parameters

KeyTypeRequiredDefaultRemarks
access_tokenstringUser's access token
imagedatabinary
referer_urlstringReferer site URL
titlestringSite title
descstringComment
created_atfloatImage's created time, Unix time
collection_idstringYou can add image to collection which enables you to edit.

response

{
    "image_id" : "8980c52421e452ac3355ca3e5cfe7a0c",
    "permalink_url": "http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c",
    "thumb_url" : "https://i.gyazo.com/thumb/180/afaiefnaf.png",
    "url" : "https://i.gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c.png",
    "type": "png"
}

■Upload with Browser Session API

Summary

This API will allow uploads simply by using the Gyazo browser session token. Because there is no need to have a user log in, you can allow uploads from web images very easily.
First, use post with the parameter set as the URL of the image you want to upload, and the server will return a new Gyazo URL that can be used temporarily for verification purposes.
By opening the URL in a browser, the image will be tied to the user session in that browser. The URL will only be active for 30 seconds. After that it will result in an error when accessing the URL.

url

POST https://upload.gyazo.com/api/upload/easy_auth

parameters

KeyTypeRequiredContentRemarks
client_idstringYour application's client id
image_urlstringImage URL
referer_urlstringReferer site URL
titlestringSite title and comment

response

{
    "get_image_url" : "https://gyazo.com/api/upload/8980c52421e452ac3355ca3e5cfe7a0c",
    "expires_at" : 1401178164
}
KeyTypeDescription
get_image_urlstringGet will respond with the access URL so the server can detect which user session is active.
expires_atintegerTime when the URL expires (UNIX Time)

■Delete

Summary

The API request to delete an image.

URL

DELETE https://api.gyazo.com/api/images/:image_id

parameters

KeyTypeRequiredDefaultRemarks
image_idstringYou can only delete your own images

response

{
   "image_id": "8980c52421e452ac3355ca3e5cfe7a0c",
   "type": "png"
}

■oEmbed

Summary

This API provide image's raw URL. This API follows oEmbed. It's a format for allowing an embedded representation of a URL on third party sites.

URL

GET https://api.gyazo.com/api/oembed?url=:image_url

parameters

KeyTypeRequiredDefaultRemarks
urlstringYou can only set URL of Gyazo image page ( http://gyazo.com/XXXXXXXXXXXX )

response

{
  "version":"1.0",
  "type":"photo",
  "provider_name":"Gyazo",
  "provider_url":"https://gyazo.com",
  "url":"http://i.gyazo.com/8c9d9c8ec14dec4631b6ec77d1c85450_1.png",
  "width":617,
  "height":597
}

note

Request URL set href attribute on link tag in image page.
<link href="https://gyazo.com/api/oembed?url=http://gyazo.com/XXXXXXXXXXXX" rel="alternate" title="Screenshot by Gyazo" type="application/json+oembed" />