giphy-wrapi

0.1.0 • Public • Published

Giphy API Wrapper

Client interface for accessing Giphy API.

NPM version

Installation

Install via npm

npm install giphy-wrapi --save

Usage

Create a client object to connect to Giphy API endpoints.

var giphyWrapi = require('giphy-wrapi');
 
var client = new giphyWrapi(GIPHY_API_KEY);
 
// Now you are ready to make API calls to Giphy.

Provide parameters and a callback.

API calls follow this syntax:

client.apigroup.action(queryString, callback);

  • queryString - (as required) API method parameters as key-value pairs.

Examples

Search all Giphy GIFs for a word or phrase.

client.gifs.search(
  {
    q: 'lol cats'
  },
  function(err, data) {
    if (!err) {
      console.log(data);
    } 
  }
);

Get GIF by ID.

client.gifs.get('feqkVgjJpYtjy', function(err, data) {
  if (!err) {
    console.log(data);
  } 
});

Fetch GIFs currently trending online.

client.gifs.trending(function(err, data) {
  if (!err) {
    console.log(data);
  } 
});

Get a random sticker from Giphy's sticker collection.

client.stickers.random(function(err, data) {
  if (!err) {
    console.log(data);
  } 
});

API Functions

gifs

stickers

License

MIT

Package Sidebar

Install

npm i giphy-wrapi

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • palanik