Gyazo API
List
ユーザーの画像一覧を取得するAPI。
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",
"metadata": {
"app": null,
"title": null,
"url": null,
"desc": null
}
},
{
"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",
"metadata": {
"app": null,
"title": null,
"url": null,
"desc": null
}
},
...
]Image
画像の情報を取得するAPI。
URL
GET https://api.gyazo.com/api/images/:image_id
parameters
| Key | Type | Required | Default | Remarks |
|---|---|---|---|---|
| access_token | string | ◯ | User's access token | |
| image_id | string | ◯ |
response body
{
"image_id": "27a9dca98bcf5cafc0bd84a80ee9c0a1",
"permalink_url": null,
"thumb_url": null,
"type": "png",
"created_at": "2018-07-24T07:33:24.771Z",
"metadata": {
"app": null,
"title": null,
"url": null,
"desc": null
},
"ocr": {
"locale": "en",
"description": "Gyazo\n",
}
}Upload
画像をアップロードするAPI。
NOTICE
- multipart/form-data を使うこと
- URLが他のAPIとは異なるため注意
URL
POST https://upload.gyazo.com/api/upload
parameters
| Key | Type | Required | Default | Remarks |
|---|---|---|---|---|
| access_token | string | ◯ | ユーザーのアクセストークン | |
| imagedata | binary | ◯ | multipart/form-dataのContent-Dispositionにおける`filename`を忘れずに付与してください。`filename`は必須です。 | |
| access_policy | string anyone or only_me | anyone | 画像の公開範囲を指定する文字列。 デフォルトは anyone で、リンクを知っている全員が閲覧可能です。 only_me を指定すると、アップロードしたユーザーのみが閲覧可能になります。 | |
| metadata_is_public | string 'true' or 'false' | URLやタイトルなどのメタデータを公開するか否かの真偽値の文字列 | ||
| referer_url | string | キャプチャをしたサイトのURL | ||
| app | string | キャプチャをしたアプリケーション名 | ||
| title | string | キャプチャをしたサイトのタイトル | ||
| desc | string | 任意のコメント | ||
| created_at | float | 画像の作られた日時(Unix time) | ||
| collection_id | string | ユーザーが所有している/参加しているコレクションにのみ追加できます |
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"
}Delete
画像を削除するAPI。
URL
DELETE https://api.gyazo.com/api/images/:image_id
parameters
| Key | Type | Required | Default | Remarks |
|---|---|---|---|---|
| access_token | string | ◯ | User's access token | |
| image_id | string | ◯ | ユーザーが所有している画像のみ削除できます。 |
response
{
"image_id": "8980c52421e452ac3355ca3e5cfe7a0c",
"type": "png"
}oEmbed
Webサイトにコンテンツを埋めこむための仕組みである oEmbedの仕様に則って画像のURLやサイズなどを取得することができます
URL
GET https://api.gyazo.com/api/oembed?url=:image_url
parameters
| Key | Type | Required | Default | Remarks |
|---|---|---|---|---|
| url | string | ◯ | 画像ページのURL ( 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
}備考
リクエストURLは画像ページ内の下記の形式のlinkタグのhref属性に格納されています。<link href="https://gyazo.com/api/oembed?url=http://gyazo.com/XXXXXXXXXXXX" rel="alternate" title="Image shared with Gyazo" type="application/json+oembed" />