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
| Key | Type | Required | Default | Remarks |
|---|
| access_token | string | ✓ | | User's access token |
| page | integer | | 1 | |
| per_page | integer | | 20 | 1 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
| Key | Type | Required | Default | Remarks |
|---|
| access_token | string | ✓ | | User's access token |
| imagedata | binary | ✓ | | |
| referer_url | string | | | Referer site URL |
| title | string | | | Site title |
| desc | string | | | Comment |
| created_at | float | | | Image's created time, Unix time |
| collection_id | string | | | You 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
| Key | Type | Required | Content | Remarks |
|---|
| client_id | string | ✓ | | Your application's client id |
| image_url | string | ✓ | | Image URL |
| referer_url | string | ✓ | | Referer site URL |
| title | string | | | Site title and comment |
response
{
"get_image_url" : "https://gyazo.com/api/upload/8980c52421e452ac3355ca3e5cfe7a0c",
"expires_at" : 1401178164
}| Key | Type | Description |
|---|
| get_image_url | string | Get will respond with the access URL so the server can detect which user session is active. |
| expires_at | integer | Time 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
| Key | Type | Required | Default | Remarks |
|---|
| image_id | string | ✓ | | You 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
| Key | Type | Required | Default | Remarks |
|---|
| url | string | ✓ | | You 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" />