{"_id":"56cf8c9f8629f91300fd984b","user":"56cf8c788629f91300fd9843","version":"56cf8c9d8629f91300fd9848","__v":19,"link_external":false,"link_url":"","project":"56cf8c9c8629f91300fd9845","githubsync":"","hidden":false,"slug":"getting-started","title":"Introducing the gifs.com API","updates":[],"createdAt":"2016-02-25T23:22:07.139Z","excerpt":"...to gifinity and beyond!","order":0,"sync_unique":"","type":"basic","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"*Everyone wishes for something...*\n>*\"...I wish I could make gifs from vines or instagram videos.\"*\n>*\"...I wish I could convert gifs to optimized HTML5 videos, .webm's, or .mp4s.\"*\n>*\"...I wish the transcoding was the fastest in the world.\"*\n\n*Your wishes have been granted.*\n\nThe [gifs.com](https://gifs.com) API makes it dead simple to convert and transcode a vast array of media into our HTML5 optimized gifs.com player, a compressed .gif, .webm and .mp4.\n\nSend us any `instagram`, `twitter`, `facebook`, `vine`, `.gif`, `.mp4`, `.webm`, `giphy`, `imgur`, `gfycat`, or `streamable` links and we transcode your media lightning fast and serve it up in our awesome gifs player :zap:.","category":"56cf8c9e8629f91300fd9849","childrenPages":[]}

Introducing the gifs.com API

...to gifinity and beyond!

*Everyone wishes for something...* >*"...I wish I could make gifs from vines or instagram videos."* >*"...I wish I could convert gifs to optimized HTML5 videos, .webm's, or .mp4s."* >*"...I wish the transcoding was the fastest in the world."* *Your wishes have been granted.* The [gifs.com](https://gifs.com) API makes it dead simple to convert and transcode a vast array of media into our HTML5 optimized gifs.com player, a compressed .gif, .webm and .mp4. Send us any `instagram`, `twitter`, `facebook`, `vine`, `.gif`, `.mp4`, `.webm`, `giphy`, `imgur`, `gfycat`, or `streamable` links and we transcode your media lightning fast and serve it up in our awesome gifs player :zap:.
*Everyone wishes for something...* >*"...I wish I could make gifs from vines or instagram videos."* >*"...I wish I could convert gifs to optimized HTML5 videos, .webm's, or .mp4s."* >*"...I wish the transcoding was the fastest in the world."* *Your wishes have been granted.* The [gifs.com](https://gifs.com) API makes it dead simple to convert and transcode a vast array of media into our HTML5 optimized gifs.com player, a compressed .gif, .webm and .mp4. Send us any `instagram`, `twitter`, `facebook`, `vine`, `.gif`, `.mp4`, `.webm`, `giphy`, `imgur`, `gfycat`, or `streamable` links and we transcode your media lightning fast and serve it up in our awesome gifs player :zap:.
{"_id":"56d744f836dd840b00cef12b","updates":[],"createdAt":"2016-03-02T19:54:32.144Z","next":{"description":"","pages":[]},"hidden":false,"project":"56cf8c9c8629f91300fd9845","user":"56cf8c788629f91300fd9843","version":"56cf8c9d8629f91300fd9848","__v":11,"githubsync":"","link_external":false,"slug":"authentication-key","sync_unique":"","isReference":false,"category":"56cf8c9e8629f91300fd9849","excerpt":"","link_url":"","order":999,"title":"Authentication","type":"basic","api":{"auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","url":""},"body":"The gifs API is open to the public and can be used with or without an API key.\n\n*Why would I want a key?* \n\n1) Links to your gifs.com account.\n2) Ability to delete and manage your gifs.\n3) Increased duration limit for all media being added.\n4) Increased rate limit for importing or uploading gifs.\n5) Ability to beta test API as we release future updates. \n\n**To get a free API key, go to your [gifs.com API dashboard](https://gifs.com/dashboard/api), and hit generate key.**","childrenPages":[]}

Authentication


The gifs API is open to the public and can be used with or without an API key. *Why would I want a key?* 1) Links to your gifs.com account. 2) Ability to delete and manage your gifs. 3) Increased duration limit for all media being added. 4) Increased rate limit for importing or uploading gifs. 5) Ability to beta test API as we release future updates. **To get a free API key, go to your [gifs.com API dashboard](https://gifs.com/dashboard/api), and hit generate key.**
The gifs API is open to the public and can be used with or without an API key. *Why would I want a key?* 1) Links to your gifs.com account. 2) Ability to delete and manage your gifs. 3) Increased duration limit for all media being added. 4) Increased rate limit for importing or uploading gifs. 5) Ability to beta test API as we release future updates. **To get a free API key, go to your [gifs.com API dashboard](https://gifs.com/dashboard/api), and hit generate key.**
{"_id":"56cf9a978acacb1300814918","user":"56cf8c788629f91300fd9843","hidden":false,"link_url":"","slug":"mediaimport","githubsync":"","order":0,"sync_unique":"","title":"/media/import","type":"post","__v":4,"api":{"params":[{"required":true,"desc":"The source URL of the media to add","default":"","type":"string","name":"source","in":"body","_id":"56cfa22c287eb20b009f9fe1"},{"name":"title","in":"body","_id":"56cfa2b5287eb20b009f9fe7","required":false,"desc":"The title of the media","default":"","type":"string"},{"desc":"The tags relating the the media","default":"","type":"array_string","name":"tags","in":"body","_id":"56cfa2b5287eb20b009f9fe6","required":false},{"type":"boolean","name":"nsfw","in":"body","_id":"56cfa2b5287eb20b009f9fe5","required":false,"desc":"If the media is not safe for work","default":""},{"_id":"56cfa2b5287eb20b009f9fe4","required":false,"desc":"Any attribution you want displayed","default":"","type":"object","name":"attribution","in":"body"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n    \"success\": {\n        \"page\": \"https://gifs.com/gif/YEV5Jp\",\n        \"files\": {\n            \"gif\": \"https://j.gifs.com/YEV5Jp.gif\",\n            \"jpg\": \"https://j.gifs.com/YEV5Jp.jpg\",\n            \"mp4\": \"https://j.gifs.com/YEV5Jp.mp4\",\n            \"webm\": \"https://j.gifs.com/YEV5Jp.webm\"\n        },\n        \"oembed\": \"https://gifs.com/oembed/YEV5Jp\",\n        \"embed\": \"<iframe src='https://gifs.com/embed/YEV5Jp' frameborder='0' scrolling='no' width='720' height='720' style='-webkit-backface-visibility: hidden;-webkit-transform: scale(1);' ></iframe>\",\n        \"meta\": {\n            \"duration\": \"6.5s\",\n            \"height\": \"720\",\n            \"width\": \"720\"\n        }\n    }\n}"},{"language":"json","code":"{\n    \"errors\": {\n        \"message\": \"We've encountered an unexpected issue, please try again.\"\n    }\n}","name":"","status":400}]},"settings":"","url":"/media/import","auth":"optional","examples":{"codes":[{"code":"POST /media/import HTTP/1.1\nHost: api.gifs.com\nGifs-API-Key: gifs56d63999f0f34\nContent-Type: application/json\nAccept: application/json\nAccept-Charset: utf-8\n{\n \"source\": \"https://vine.co/v/ibAU6OH2I0K\",\n \"title\": \"2015 Craziness\",\n \"tags\": [\"2015\", \"crazy\", \"hand drawn\", \"art\"],\n \"attribution\": {\n   \"site\": \"vine\",\n   \"user\": \"AliciaHerber\"\n }\n}","name":"HTTP","language":"json"},{"language":"curl","code":"curl -X POST -H \"Gifs-API-Key: gifs56d63999f0f34\" -H \"Content-Type: application/json\" -d '{\n \"source\": \"https://vine.co/v/ibAU6OH2I0K\",\n \"title\": \"2015 Craziness\",\n \"tags\": [\"crazy\", \"hand drawn\", \"2015\", \"art\"],\n \"attribution\": {\n   \"site\": \"vine\",\n   \"user\": \"AliciaHerber\"\n }\n}' \"https://api.gifs.com/media/import\""},{"language":"php","code":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.gifs.com/media/import');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n  'Gifs-API-Key' => 'gifs56d63999f0f34'\n  'Content-Type' => 'application/json'\n));\n\n$request->setBody('{\n \"source\": \"https://vine.co/v/ibAU6OH2I0K\",\n \"title\": \"2015 Craziness\",\n \"tags\": [\"crazy\", \"hand drawn\", \"2015\", \"art\"],\n \"attribution\": {\n   \"site\": \"vine.co\",\n   \"user\": \"AliciaHerber\"\n }\n}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"language":"java","code":"HttpResponse<String> response = Unirest.post(\"https://api.gifs.com/media/import\")\n  .header(\"Gifs-API-Key\", \"gifs56d63999f0f34\")\n  .header(\"Content-Type\", \"application/json\")\n  .body(\"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\")\n  .asString();"},{"language":"go","code":"url := \"https://api.gifs.com/media/import\"\n\npayload := strings.NewReader(\"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\")\n\nreq, _ := http.NewRequest(\"POST\", url, payload)\nreq.Header.Add(\"Gifs-API-Key\", \"gifs56d63999f0f34\")\nreq.Header.Add(\"Content-Type\", \"application/json\")\n\nres, _ := http.DefaultClient.Do(req)\n\ndefer res.Body.Close()\nbody, _ := ioutil.ReadAll(res.Body)\n\nfmt.Println(res)\nfmt.Println(string(body))"},{"language":"javascript","code":"var http = require(\"https\");\n\nvar options = {\n  \"method\": \"POST\",\n  \"hostname\": \"api.gifs.com\",\n  \"port\": null,\n  \"path\": \"/media/import\",\n  \"headers\": {\n    \"Gifs-API-Key\": \"gifs56d63999f0f34\",\n    \"Content-Type\": \"application/json\"\n  }\n};\n\nvar req = http.request(options, function (res) {\n  var chunks = [];\n\n  res.on(\"data\", function (chunk) {\n    chunks.push(chunk);\n  });\n\n  res.on(\"end\", function () {\n    var body = Buffer.concat(chunks);\n    console.log(body.toString());\n  });\n});\n\nreq.write(JSON.stringify({ source: 'https://vine.co/v/ibAU6OH2I0K',\n  title: '2015 Craziness',\n  tags: [ 'cat', 'hand drawn', 'cat flip', 'art' ],\n  attribution: { site: 'vine.co', user: 'AliciaHerber' } }));\nreq.end();","name":"Nodejs"},{"code":"var settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https://api.gifs.com/media/import\",\n  \"method\": \"POST\",\n  \"headers\": {\n    \"Gifs-API-Key\": \"gifs56d63999f0f34\",\n    \"Content-Type\": \"application/json\"\n  },\n  \"processData\": false,\n  \"data\": \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\"\n}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});","name":"jQuery","language":"javascript"},{"language":"python","code":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.gifs.com\")\n\npayload = \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\"\n\nheaders = { 'Gifs-API-Key': \"gifs56d63999f0f34\", 'Content-Type': \"application/json\" }\n\nconn.request(\"POST\", \"/media/import\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"language":"ruby","code":"require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.gifs.com/media/import\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Gifs-API-Key\"] = 'gifs56d63999f0f34'\nrequest[\"Content-Type\"] = 'application/json'\nrequest.body = \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"language":"swift","code":"import Foundation\n\nlet parameters = [\n  \"source\": \"https://vine.co/v/ibAU6OH2I0K\",\n  \"title\": \"2015 Craziness\",\n  \"tags\": [\"crazy\", \"hand drawn\", \"2015\", \"art\"],\n  \"attribution\": [\n    \"site\": \"vine.co\",\n    \"user\": \"AliciaHerber\"\n  ]\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: \"https://api.gifs.com/media/import\")!,\n                                        cachePolicy: .UseProtocolCachePolicy,\n                                    timeoutInterval: 10.0)\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = [ \"Gifs-API-Key\": \"gifs56d63999f0f34\", \"Content-Type\": \"application/json\" ]\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSDictionary *headers = @{ @\"Gifs-API-Key\": @\"gifs56d63999f0f34\",\n                        @\"Content-Type\": @\"application/json\" };\n\nNSDictionary *parameters = @{ @\"source\": @\"https://vine.co/v/ibAU6OH2I0K\",\n                              @\"title\": @\"2015 Craziness\",\n                              @\"tags\": @[ @\"crazy\", @\"hand drawn\", @\"2015\", @\"art\" ],\n                              @\"attribution\": @{ @\"site\": @\"vine.co\", @\"user\": @\"AliciaHerber\" } };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://api.gifs.com/media/import\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\n                                                   timeoutInterval:10.0];\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n                                                if (error) {\n                                                    NSLog(@\"%@\", error);\n                                                } else {\n                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n                                                    NSLog(@\"%@\", httpResponse);\n                                                }\n                                            }];\n[dataTask resume];"},{"language":"c","code":"CURL *hnd = curl_easy_init();\n\ncurl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_easy_setopt(hnd, CURLOPT_URL, \"https://api.gifs.com/media/import\");\n\nstruct curl_slist *headers = NULL;\nheaders = curl_slist_append(headers, \"Gifs-API-Key: gifs56d63999f0f34\");\nheaders = curl_slist_append(headers, \"Content-Type: application/json\");\ncurl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);\n\ncurl_easy_setopt(hnd, CURLOPT_POSTFIELDS, \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\");\n\nCURLcode ret = curl_easy_perform(hnd);"},{"language":"csharp","code":"var client = new RestClient(\"https://api.gifs.com/media/import\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Content-Type\", \"Gifs-API-Key: gifs56d63999f0f34\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"name":"OCaml","language":"shell","code":"open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://api.gifs.com/media/import\" in\nlet headers = Header.init ()\n  |> fun h -> Header.add h \"Gifs-API-Key\" \"gifs56d63999f0f34\"\n  |> fun h -> Header.add h \"Content-Type\" \"application/json\"\nin\nlet body = Cohttp_lwt_body.of_string \"{\\n \\\"source\\\": \\\"https://vine.co/v/ibAU6OH2I0K\\\",\\n \\\"title\\\": \\\"2015 Craziness\\\",\\n \\\"tags\\\": [\\\"crazy\\\", \\\"hand drawn\\\", \\\"2015\\\", \\\"art\\\"],\\n \\\"attribution\\\": {\\n   \\\"site\\\": \\\"vine.co\\\",\\n   \\\"user\\\": \\\"AliciaHerber\\\"\\n }\\n}\" in\n\nClient.call ~headers ~body `POST uri\n>>= fun (res, body_stream) ->\n  (* Do stuff with the result *)"}]},"method":"post"},"category":"56cf9a2a44c5700b0095c24c","version":"56cf8c9d8629f91300fd9848","excerpt":"We support importing the following file mime types: `image/gif`, `video/mp4`, `video/webm` and you can also link directly to a `giphy`, `imgur`, `gfycat`, `streamable`, `instagram`, `twitter`, `facebook`, or `vine` web page and we'll automagically find the best quality file to import.\n\nUse your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.","project":"56cf8c9c8629f91300fd9845","createdAt":"2016-02-26T00:21:43.421Z","editedParams2":true,"link_external":false,"updates":["57a599702f7eaf0e00e11d6d"],"body":"Attribution object schema is:\n\n| Parameter       | Type         | Required?  | Description                                 |\n| -------------   |--------------|------------|---------------------------------------------|\n| site            | string       | required   | twitter, reddit, instagram, vine, or a custom URL |\n| user            | string       | optional   | The username for social media sites         |\n| url             | string       | optional   | The url if site != social media             |","editedParams":true,"isReference":false,"childrenPages":[]}

post/media/import

We support importing the following file mime types: `image/gif`, `video/mp4`, `video/webm` and you can also link directly to a `giphy`, `imgur`, `gfycat`, `streamable`, `instagram`, `twitter`, `facebook`, or `vine` web page and we'll automagically find the best quality file to import. Use your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.

Body Params

source:
required
string
The source URL of the media to add
title:
string
The title of the media
tags:
array of strings
The tags relating the the media
nsfw:
boolean
If the media is not safe for work
attribution:
object
Any attribution you want displayed
Attribution object schema is: | Parameter | Type | Required? | Description | | ------------- |--------------|------------|---------------------------------------------| | site | string | required | twitter, reddit, instagram, vine, or a custom URL | | user | string | optional | The username for social media sites | | url | string | optional | The url if site != social media |

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Attribution object schema is: | Parameter | Type | Required? | Description | | ------------- |--------------|------------|---------------------------------------------| | site | string | required | twitter, reddit, instagram, vine, or a custom URL | | user | string | optional | The username for social media sites | | url | string | optional | The url if site != social media |
{"_id":"56cfa3cf287eb20b009f9fe9","order":1,"project":"56cf8c9c8629f91300fd9845","body":"[block:textarea]\n{\n  \"text\": \"## Request\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"language\": \"curl\",\n      \"code\": \"curl \\\\\\n  -H \\\"Gifs-API-Key: gifs56d63999f0f34\\\" \\\\\\n  -F \\\"file=@/media/gifs/awesome.gif\\\" \\\\\\n  -F \\\"title=The most awesome gif eva\\\" \\\\\\n  -F \\\"tags=awesome, cool, fun, gnarly\\\" \\\\\\n  https://api.gifs.com/media/upload\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n[block:textarea]\n{\n  \"text\": \"## Results\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"status\": 200,\n      \"language\": \"json\",\n      \"code\": \"{\\n \\\"success\\\":{\\n    \\\"page\\\": \\\"https://gifs.com/gif/2k9BMv\\\",\\n    \\\"files\\\": {\\n        \\\"gif\\\": \\\"https://j.gifs.com/2k9BMv.gif\\\",\\n        \\\"jpg\\\": \\\"https://j.gifs.com/2k9BMv.jpg\\\",\\n        \\\"mp4\\\": \\\"https://j.gifs.com/2k9BMv.mp4\\\",\\n        \\\"webm\\\": \\\"https://j.gifs.com/2k9BMv.webm\\\"\\n    },\\n    \\\"oembed\\\": \\\"https://gifs.com/oembed/2k9BMv\\\",\\n    \\\"embed\\\": \\\"<iframe src='https://gifs.com/embed/2k9BMv' frameborder='0' scrolling='no' width='640' height='360' style='-webkit-backface-visibility: hidden;-webkit-transform: scale(1);' ></iframe>\\\",\\n    \\\"meta\\\": {\\n        \\\"duration\\\": \\\"4.104s\\\",\\n        \\\"frames\\\": \\\"123\\\",\\n        \\\"height\\\": \\\"360\\\",\\n        \\\"width\\\": \\\"640\\\"\\n    }\\n }\\n}\",\n      \"name\": 200\n    },\n    {\n      \"status\": 400,\n      \"language\": \"json\",\n      \"code\": \"{\\n    \\\"errors\\\": {\\n        \\\"message\\\": \\\"We've encountered an unexpected issue, please try again.\\\"\\n    }\\n}\",\n      \"name\": 400\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","editedParams2":true,"githubsync":"","version":"56cf8c9d8629f91300fd9848","__v":1,"createdAt":"2016-02-26T01:01:03.264Z","link_external":false,"title":"/media/upload","updates":["56dde37c94d5570e0024474b"],"user":"56cf8c788629f91300fd9843","link_url":"","slug":"mediaupload","api":{"results":{},"settings":"","url":"/media/upload","auth":"optional","examples":{},"method":"post","params":[{"_id":"56cfa3cf287eb20b009f9ff0","required":true,"desc":"The file being uploaded","default":"","type":"file","name":"file","in":"body"},{"_id":"56cfa3cf287eb20b009f9fef","required":false,"desc":"The title of the media","default":"","type":"string","name":"title","in":"body"},{"_id":"56cfa3cf287eb20b009f9fee","required":false,"desc":"The tags relating the the media","default":"","type":"array_string","name":"tags","in":"body"},{"_id":"56cfa3cf287eb20b009f9fed","required":false,"desc":"If the media is not safe for work","default":"","type":"boolean","name":"nsfw","in":"body"},{"in":"body","_id":"56cfa3cf287eb20b009f9fec","required":false,"desc":"twitter, reddit, instagram, or a custom URL","default":"","type":"string","name":"attribution_site"},{"default":"","type":"string","name":"attribution_user","in":"body","_id":"56cfa3cf287eb20b009f9feb","required":false,"desc":"The username for social media sites"},{"required":false,"desc":"The url if site != social media","default":"","type":"string","name":"attribution_url","in":"body","_id":"56cfa3cf287eb20b009f9fea"}]},"category":"56cf9a2a44c5700b0095c24c","editedParams":true,"excerpt":"You can upload `image/gif`, `video/mp4`, and `video/webm` media by sending a `POST` `multipart/form-data` request. \n\nUse your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.","hidden":false,"isReference":false,"sync_unique":"","type":"post","childrenPages":[]}

post/media/upload

You can upload `image/gif`, `video/mp4`, and `video/webm` media by sending a `POST` `multipart/form-data` request. Use your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.

Body Params

file:
required
file
The file being uploaded
title:
string
The title of the media
tags:
array of strings
The tags relating the the media
nsfw:
boolean
If the media is not safe for work
attribution_site:
string
twitter, reddit, instagram, or a custom URL
attribution_user:
string
The username for social media sites
attribution_url:
string
The url if site != social media
[block:textarea] { "text": "## Request", "sidebar": true } [/block] [block:code] { "codes": [ { "language": "curl", "code": "curl \\\n -H \"Gifs-API-Key: gifs56d63999f0f34\" \\\n -F \"file=@/media/gifs/awesome.gif\" \\\n -F \"title=The most awesome gif eva\" \\\n -F \"tags=awesome, cool, fun, gnarly\" \\\n https://api.gifs.com/media/upload" } ], "sidebar": true } [/block] [block:textarea] { "text": "## Results", "sidebar": true } [/block] [block:code] { "codes": [ { "status": 200, "language": "json", "code": "{\n \"success\":{\n \"page\": \"https://gifs.com/gif/2k9BMv\",\n \"files\": {\n \"gif\": \"https://j.gifs.com/2k9BMv.gif\",\n \"jpg\": \"https://j.gifs.com/2k9BMv.jpg\",\n \"mp4\": \"https://j.gifs.com/2k9BMv.mp4\",\n \"webm\": \"https://j.gifs.com/2k9BMv.webm\"\n },\n \"oembed\": \"https://gifs.com/oembed/2k9BMv\",\n \"embed\": \"<iframe src='https://gifs.com/embed/2k9BMv' frameborder='0' scrolling='no' width='640' height='360' style='-webkit-backface-visibility: hidden;-webkit-transform: scale(1);' ></iframe>\",\n \"meta\": {\n \"duration\": \"4.104s\",\n \"frames\": \"123\",\n \"height\": \"360\",\n \"width\": \"640\"\n }\n }\n}", "name": 200 }, { "status": 400, "language": "json", "code": "{\n \"errors\": {\n \"message\": \"We've encountered an unexpected issue, please try again.\"\n }\n}", "name": 400 } ], "sidebar": true } [/block]

Definition

{{ api_url }}{{ page_api_url }}


[block:textarea] { "text": "## Request", "sidebar": true } [/block] [block:code] { "codes": [ { "language": "curl", "code": "curl \\\n -H \"Gifs-API-Key: gifs56d63999f0f34\" \\\n -F \"file=@/media/gifs/awesome.gif\" \\\n -F \"title=The most awesome gif eva\" \\\n -F \"tags=awesome, cool, fun, gnarly\" \\\n https://api.gifs.com/media/upload" } ], "sidebar": true } [/block] [block:textarea] { "text": "## Results", "sidebar": true } [/block] [block:code] { "codes": [ { "status": 200, "language": "json", "code": "{\n \"success\":{\n \"page\": \"https://gifs.com/gif/2k9BMv\",\n \"files\": {\n \"gif\": \"https://j.gifs.com/2k9BMv.gif\",\n \"jpg\": \"https://j.gifs.com/2k9BMv.jpg\",\n \"mp4\": \"https://j.gifs.com/2k9BMv.mp4\",\n \"webm\": \"https://j.gifs.com/2k9BMv.webm\"\n },\n \"oembed\": \"https://gifs.com/oembed/2k9BMv\",\n \"embed\": \"<iframe src='https://gifs.com/embed/2k9BMv' frameborder='0' scrolling='no' width='640' height='360' style='-webkit-backface-visibility: hidden;-webkit-transform: scale(1);' ></iframe>\",\n \"meta\": {\n \"duration\": \"4.104s\",\n \"frames\": \"123\",\n \"height\": \"360\",\n \"width\": \"640\"\n }\n }\n}", "name": 200 }, { "status": 400, "language": "json", "code": "{\n \"errors\": {\n \"message\": \"We've encountered an unexpected issue, please try again.\"\n }\n}", "name": 400 } ], "sidebar": true } [/block]
{"_id":"56d0b3cc167e1e1b00807a41","user":"56cf8c788629f91300fd9843","order":0,"api":{"params":[],"url":"","results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"createdAt":"2016-02-26T20:21:32.922Z","link_url":"","__v":0,"project":"56cf8c9c8629f91300fd9845","title":"Bulk Uploader","type":"basic","version":"56cf8c9d8629f91300fd9848","category":"56d0b271b2cb7013004de659","excerpt":"Add your entire collection of short media to gifs.com from the command line.","githubsync":"","hidden":false,"link_external":false,"slug":"bulk-uploader","sync_unique":"","updates":[],"body":"![](https://j.gifs.com/jRnpx5.gif)\n\n### Usage:\n\n```\n# Clone this repo\ngit clone git@github.com:gifs/api.git; cd api/examples/bulk-uploader\n\n# Upload a directory\ngo run main.go ~/Gifs\n```","childrenPages":[]}

Bulk Uploader

Add your entire collection of short media to gifs.com from the command line.

![](https://j.gifs.com/jRnpx5.gif) ### Usage: ``` # Clone this repo git clone git@github.com:gifs/api.git; cd api/examples/bulk-uploader # Upload a directory go run main.go ~/Gifs ```
![](https://j.gifs.com/jRnpx5.gif) ### Usage: ``` # Clone this repo git clone git@github.com:gifs/api.git; cd api/examples/bulk-uploader # Upload a directory go run main.go ~/Gifs ```
{"_id":"56d0b4181ecc471500f179be","hidden":false,"link_external":false,"order":1,"project":"56cf8c9c8629f91300fd9845","slug":"reddit-importer","api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"![](https://j.gifs.com/kRoqvJ.gif)\n\n### Usage:\n\n```\n# Get the clone of this repo\ngit clone git@github.com:gifs/api.git\n\n# Enter the directory\ncd api/examples/reddit-importer\n\n# Import /r/reactiongifs\ngo run main.go /r/reactiongifs\n\n# Import /r/reactiongifs and /r/politicalreactiongifs\ngo run main.go /r/reactiongifs+politicalreactiongifs\n\n# Import a user created multi-reddit\ngo run main.go /user/bgny/m/50gif\n```","createdAt":"2016-02-26T20:22:48.428Z","link_url":"","type":"basic","__v":0,"excerpt":"Import media found on one or more sub-reddits or user created multi-reddits.","githubsync":"","sync_unique":"","category":"56d0b271b2cb7013004de659","title":"Reddit Importer","updates":[],"user":"56cf8c788629f91300fd9843","version":"56cf8c9d8629f91300fd9848","childrenPages":[]}

Reddit Importer

Import media found on one or more sub-reddits or user created multi-reddits.

![](https://j.gifs.com/kRoqvJ.gif) ### Usage: ``` # Get the clone of this repo git clone git@github.com:gifs/api.git # Enter the directory cd api/examples/reddit-importer # Import /r/reactiongifs go run main.go /r/reactiongifs # Import /r/reactiongifs and /r/politicalreactiongifs go run main.go /r/reactiongifs+politicalreactiongifs # Import a user created multi-reddit go run main.go /user/bgny/m/50gif ```
![](https://j.gifs.com/kRoqvJ.gif) ### Usage: ``` # Get the clone of this repo git clone git@github.com:gifs/api.git # Enter the directory cd api/examples/reddit-importer # Import /r/reactiongifs go run main.go /r/reactiongifs # Import /r/reactiongifs and /r/politicalreactiongifs go run main.go /r/reactiongifs+politicalreactiongifs # Import a user created multi-reddit go run main.go /user/bgny/m/50gif ```
{"_id":"56d0b46b376b040b005b3094","__v":4,"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"link_url":"","title":"Save to gifs.com","user":"56cf8c788629f91300fd9843","createdAt":"2016-02-26T20:24:11.874Z","excerpt":"Saves and converts media to your gifs.com account","githubsync":"","hidden":false,"slug":"save-to-gifscom","body":"![](https://j.gifs.com/PNMk8A.gif)\n\n**Step 1: ** *Put \"gifs.com/save/\" in front of any URL (see example above).*\n\n**Step 2: ** *Your instagram, twitter, facebook videos, vines, etc. are gif'd and saved to your my gifs*. \n\n**Step 3:** *Profit.*","category":"56d0b271b2cb7013004de659","project":"56cf8c9c8629f91300fd9845","sync_unique":"","version":"56cf8c9d8629f91300fd9848","link_external":false,"order":2,"type":"basic","updates":[],"childrenPages":[]}

Save to gifs.com

Saves and converts media to your gifs.com account

![](https://j.gifs.com/PNMk8A.gif) **Step 1: ** *Put "gifs.com/save/" in front of any URL (see example above).* **Step 2: ** *Your instagram, twitter, facebook videos, vines, etc. are gif'd and saved to your my gifs*. **Step 3:** *Profit.*
![](https://j.gifs.com/PNMk8A.gif) **Step 1: ** *Put "gifs.com/save/" in front of any URL (see example above).* **Step 2: ** *Your instagram, twitter, facebook videos, vines, etc. are gif'd and saved to your my gifs*. **Step 3:** *Profit.*