- Request must be encoded as multipart/boundary or application/x-www-form-urlencoded.
- Binary data (video, pictures, etc.) must be encoded using data-URI (see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs).
Makeagif api Basics
GET Categories
Retrieve list of all GIF categories
GET /api/categories
Request:
No any parameter
Example query:
GET /api/categories
Example Response:
{
"status": "done",
"categories": [
{
"id": 4,
"name": "cartoon gifs",
"code": "cartoon-gifs"
},
{
"id": 3,
"name": "entertainment gifs",
"code": "entertainment-gifs"
},
{
"id": 1,
"name": "funny gifs",
"code": "funny-gifs"
}
]
}
Response parameters:
| Possible Key | Possible Values |
|---|---|
| status |
"done" - request is complete, see "categories" content "error" - request was not completed successfully; see "error" key value |
| categories | list of categories of GIFs; where "id" and "code" values may be used in another API requests |
| error | detailed information about error that occurred |
GIF Search
Allows users to search GIFs using various methods
POST /api/find
Request:
| Key | Example value | Description |
|---|---|---|
| q | Awkward | Search query |
| category | action-gifs | Category code |
| start | 0 | Skip results count |
| limit | 50 | Maximum results count (default: 25, maximum: 100) |
You can define one or more conditions to search - "q" and "category". You must set at least one search criteria.
Response:
{
"status": "done",
"total": 234,
"result": [{
"category": {
"code": "action-gifs",
"name": "action gifs"
},
"code": "0B34nF",
"title": "Awkward David Bowie Dancing: A Tribute",
"width": "245",
"height": "310",
"gif_url": "https://i.makeagif.com/media/1-14-2016/0B34nF.gif",
"thumb_url": "https://i.makeagif.com/media/1-14-2016/t0B34nF.jpg",
"mp4_url": "https://i.makeagif.com/media/1-14-2016/0B34nF.mp4"
},
{
"category": {
"code": "action-gifs",
"name": "action gifs"
},
"code": "L5Ncq2",
"title": "Awkward David Bowie Dancing: A Tribute",
"width": "480",
"height": "270",
"gif_url": "https://i.makeagif.com/media/1-14-2016/L5Ncq2.gif",
"thumb_url": "https://i.makeagif.com/media/1-14-2016/tL5Ncq2.jpg",
"mp4_url": "https://i.makeagif.com/media/1-14-2016/L5Ncq2.mp4"
}]
}
GIF information
Allows users to get information about GIFs
GET /api/gif/{code}
Query string parameters:
| Key | Example value | Description |
|---|---|---|
| {code} | nUzGB9 | Gif Code to retrieve |
Example query:
GET /api/gif/nUzGB9
Response:
{
"status":"done",
"result":[{
"category": {
"code": "action-gifs",
"name": "action gifs"
},
"code":"RfX5XF",
"title":"Original GIF by Doze",
"width":"500",
"height":"459",
"gif_url":"https://i.makeagif.com/media/1-14-2016/RfX5XF.gif",
"thumb_url":"https://i.makeagif.com/media/1-14-2016/tRfX5XF.jpg",
"mp4_url":"https://i.makeagif.com/media/1-14-2016/RfX5XF.mp4"
}]
}
Random GIF
Allows users to get information about a random GIF
Query:
GET /api/random-gif
Request:
| Key | Example value | Description |
|---|---|---|
| category* | 1 | ID of category |
* - required query keys
Response:
{
"status":"done",
"result":[{
"code":"RfX5XF",
"title":"Original GIF by Doze",
"width":"500",
"height":"459",
"gif_url":"https://i.makeagif.com/media/1-14-2016/RfX5XF.gif",
"thumb_url":"https://i.makeagif.com/media/1-14-2016/tRfX5XF.jpg",
"mp4_url":"https://i.makeagif.com/media/1-14-2016/RfX5XF.mp4"
}]
}
GIF Creation
Allows users to create GIFs using various methods (video URL, video, and images)
To use the GIF creation endpoints, attach the `Authorization` HTTP header to your requests. We support the `Bearer` authentication method and the value is the API token which you can generate on your settings page (available to accounts with API access).
POST /api/create-gif/source/url
Allow users to create GIFs using a provided URL (YouTube or another video URL)
Request:
| Key | Example value | Description |
|---|---|---|
| category* | 1 | ID of category |
| start* | 0 | Start time in sec |
| end* | 5 | End time in sec |
| title | New Video | Title of video |
| url* | https://www.youtube.com/watch/?v=UIrEM_9qvZU | Video URL (can be YouTube Link) |
| private | 0 | If video should be private (only for authenticated users) |
| nsfw | 0 | If video is not safe for work (boolean) |
| tags[] | cat | Array of tags |
| watermark_type** | none | Remove default watermark (none) or use default watermark (default) |
* - required query keys
** - available only for Premium users
Response:
{"id":"7836dbef0de534c3fc5ee4693f802934","success":true}
POST /api/create-gif/source/video
Allow users to create GIFs using provided video file
Request:
| Key | Example value | Description |
|---|---|---|
| start* | 0 | Start time in sec |
| private | 0 | If video should be private (only for authenticated users) |
| nsfw | 0 | If video is not safe for work (boolean) |
| category* | 1 | ID of category |
| end* | 5 | End time in sec |
| tags[] | cat | Array of tags |
| title* | New Video | Title of video |
| video* | data:video/mpeg;base64,CiVBORw0KGgoAA... | data-url |
| watermark_type** | none | Remove default watermark (none) or use default watermark (default) |
* - required query keys
** - available only for Premium users
Response:
{"id":"7836dbef0de534c3fc5ee4693f802934","success":true}
POST /api/create-gif/source/pictures
Allow users to create GIFs using pictures
Request:
| Key | Example value | Description |
|---|---|---|
| category* | 1 | ID of category |
| delay | 500 | Delay in ms (1000-100) between frames |
| height* | 200 | Height of GIF in pixels |
| private | 0 | If video should be private (only for authenticated users) |
| nsfw | 0 | If video not safe for work (boolean) |
| pictures[]* | data:image/gif;base64,CiVBORw0KGgoAA... | data-url for each picture (min: 2) |
| resize* | 0 | Resize each frame of GIF (boolean) |
| tags[] | cat | Array of tags |
| title* | New Video | Title of video |
| width* | 300 | Width of GIF in pixels |
| watermark_type** | none | Remove default watermark (none) or use default watermark (default) |
* - required query keys
** - available only for Premium users
Response:
{"id":"7836dbef0de534c3fc5ee4693f802934","success":true}
Task Status
Retrieve status of async task
GET /api/status/{task}
Request:
| Key | Example value | Description |
|---|---|---|
| {task} | 7836dbef0de534c3fc5ee4693f802934 | Retrieval task ID status |
Example query:
GET /api/status/7836dbef0de534c3fc5ee4693f802934
Example Response:
{"status":"done","result":{"code":"dyHsY4","url": "/gif/-dyHsY4"}}
Response parameters:
| Possible Key | Possible Values |
|---|---|
| status |
"done" - task is complete, see "url" if needed "waiting" - task is in pending state "processing" - task is currently processing "error" - task was not completed successfully; see "error" key value |
| url | generated GIF code you can access GIF via https://makeagif.com/{code} |
| error | detailed information about error that occurred |