
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
JavaScript module for the giphy.com API that supports promises and callbacks.
JavaScript module for the giphy.com API that supports promises and callbacks. All search parameters and endpoints can be found on the Giphy API documentation.
npm install giphy-api --save
JavaScript browser bundles are built to dist/giphy-api.bundle.js
and
dist/giphy-api.bundle.min.js
using:
npm run build
// Require with custom API key
var giphy = require('giphy-api')('API KEY HERE');
// Require with the public beta key
var giphy = require('giphy-api')();
var giphy = require('giphy-api')({
...
});
Search all Giphy GIFs for a word or phrase. Supported parameters:
// Search with a plain string using callback
giphy.search('pokemon', function (err, res) {
// Res contains gif data!
});
// Search with options using promise
giphy.search('pokemon').then(function (res) {
// Res contains gif data!
});
// Search with options using callback
giphy.search({
q: 'pokemon',
rating: 'g'
}, function (err, res) {
// Res contains gif data!
});
Search all Giphy gifs for a single Id or an array of Id's
//Search with a single Id using callback
giphy.id('feqkVgjJpYtjy', function (err, res) {
});
//Search with a single Id using promise
giphy.id('feqkVgjJpYtjy').then(function (res) {
});
// Search with an array of Id's
giphy.id([
'feqkVgjJpYtjy',
'7rzbxdu0ZEXLy'
], function (err, res) {
});
Experimental search endpoint for gif dialects. Supported parameters:
// Translate search with a plain string using callback
giphy.translate('superman', function (err, res) {
});
// Translate search with a plain string using promise
giphy.translate('superman').then(function (res) {
});
// Translate search with options
giphy.translate({
s: 'superman',
rating: 'g',
fmt: 'html'
}, function (err, res) {
});
Random gif(s) filtered by tag. Supported parameters:
// Random gif by tag using callback
giphy.random('superman', function (err, res) {
});
// Random gif by tag using promise
giphy.random('superman').then(function (res) {
});
// Random gif with options
giphy.random({
tag: 'superman',
rating: 'g',
fmt: 'json'
}, function (err, res) {
});
Trending gifs on The Hot 100 list
// Trending Hot 100 gifs using callback
giphy.trending(function (err, res) {
});
// Trending Hot 100 gifs using promise
giphy.trending().then(function (res) {
});
// Trending Hot 100 gifs with options
giphy.trending({
limit: 2,
rating: 'g',
fmt: 'json'
}, function (err, res) {
});
Animated stickers are gifs with transparent backgrounds. All giphy-api functions
support stickers except id, which is not a supported Giphy sticker endpoint.
In order to use the sticker API instead of the gif API, simply pass the api
property to a giphy-api function.
// Sticker search using callback
giphy.search({
api: 'stickers',
q: 'funny'
}, function (err, res) {
});
// Sticker search using promise
giphy.search({
api: 'stickers',
q: 'funny'
}).then(res) {
});
FAQs
JavaScript module for the giphy.com API that supports promises and callbacks.
The npm package giphy-api receives a total of 6,310 weekly downloads. As such, giphy-api popularity was classified as popular.
We found that giphy-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.