gfycat-sdk
Javascript API wrapper for Gfycat.com API that supports callbacks and promises.
Installation
npm install gfycat-sdk --save
Usage
Obtain a client_id and client_secret for your integration from the Gfycat developers portal.
const Gfycat = ; var gfycat = clientId: YOUR_CLIENT_ID clientSecret: YOUR_CLIENT_SECRET;
For security reasons, we suggest storing the client id and secret in a secure location.
Methods
Authenticate
Returns a callback, or promise that resolves to the api authentication token that is valid for 1 hour
Callback
gfycat
Promise
gfycat;
Search
Returns a promise that resolves to a gfycats object. API supports pagination using cursors and count/first. The optional random attribute will randomize the result returned by the API - do not supply pagination attributes with this.
let options = search_text: 'hello' count: 20 first: 30; gfycat;
Get User Details
Returns user account information by username
let options = userId: 'myUsername'; gfycat;
Get Gfycat Details
Return Gfycat json by gfycat name
let options = gfyId: 'richpepperyferret'; gfycat
Get Related Content
Return a list of Gfycats related to the one provided.
let options = gfyId: 'richpepperyferret'; gfycat
Get User Feed
Return the gfycats uploaded and shared by a given username.
let options = userId: 'myUsername'; gfycat
Get Trending GIFs
Return JSON of currently trending gifs
let options = count: 10 cursor: '' gfycat
Get Trending Tags
Return JSON of currently trending tags
let options = count: 10 populated: false gfycat