PHPackages                             ghanem/giphy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ghanem/giphy

ActiveLibrary[API Development](/categories/api)

ghanem/giphy
============

A package that provides an interface between Laravel and Giphy API, includes Gifs.

v1.6(4y ago)0366↓33.3%MITPHPPHP ^7.3|^8.0

Since Jul 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AbdullahGhanem/laravel-giphy)[ Packagist](https://packagist.org/packages/ghanem/giphy)[ Docs](https://github.com/abdullahghanem/giphy)[ RSS](/packages/ghanem-giphy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (0)

Giphy and Stickers
==================

[](#giphy-and-stickers)

[![Latest Stable Version](https://camo.githubusercontent.com/3f4d5202e81d50bb53a19ffc4795cda67c93d5e9485d7d221c8141a6c4a2ac1f/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f67697068792f762f737461626c65)](https://packagist.org/packages/ghanem/giphy) [![Total Downloads](https://camo.githubusercontent.com/aa441e198cff5f6e2b685f23604a71fc6dae6afba9a9d3473a05f08de588cc4b/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f67697068792f646f776e6c6f616473)](https://packagist.org/packages/ghanem/giphy) [![Latest Unstable Version](https://camo.githubusercontent.com/53d11e4afa4fa0fbef07ad124e559e6239ddc91edcb1eea793c422cc32f4f807/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f67697068792f762f756e737461626c65)](https://packagist.org/packages/ghanem/giphy) [![License](https://camo.githubusercontent.com/922bb37171499a9edea82689026318383a8e585ec2b23f9eeddeedab8a5b3311/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f67697068792f6c6963656e7365)](https://packagist.org/packages/ghanem/giphy)

A package that provides an interface between [Laravel](https://laravel.com/docs/8.x) and [Giphy API](http://api.giphy.com/), includes Gifs and Stickers.

Installation
------------

[](#installation)

- [Giphy and Stickers on Packagist](https://packagist.org/packages/ghanem/giphy)
- [Giphy and Stickers on GitHub](https://github.com/abdullahghanem/giphy)

You can install the package via composer:

```
composer require ghanem/giphy
```

now you need to publish the config file with:

```
php artisan vendor:publish --provider="Ghanem\Giphy\GiphyServiceProvider" --tag="config"
```

###### Parameters

[](#parameters)

- q - search query term or phrase
- s - search query term or phrase
- limit - (optional) number of results to return, maximum 100. Default 25.
- offset - (optional) results offset, defaults to 0.
- rating - (optional) limit results to those rated (y,g, pg, pg-13 or r).
- lang - (optional) specify default country for regional content; format is 2-letter ISO 639-1 country code. See list of supported langauges [here](https://github.com/Giphy/GiphyAPI#language-support)

### Endpoints

[](#endpoints)

- [Gifs](#gifs)
    - [Search](#search)
    - [Translate](#translate)
    - [Trending](#trending)
    - [Random](#random)
    - [By id](#by-id)
    - [By id](#by-ids)
- [Stickers](#stickers)
    - [Sticker Search](#sticker-search)
    - [Sticker Translate](#sticker-translate)
    - [Sticker Trending](#sticker-trending)
    - [Sticker Random](#sticker-random)

### Gifs

[](#gifs)

#### Search

[](#search)

Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored. On this case, `$giphys` is an array.

Method: Giphy::search($query, $limit = 25, $offset = 0, $rating = null, $lang = null)

```
$giphys = Giphy::search('cat');

foreach ($giphys->data as $giphy) {
    // Get id
	$giphy->id;

	// Get image original url
	$giphy->images->original->url;

	// Get image original mp4 url
	$giphy->images->original->mp4;

	//etc
}
```

You can do a `dd($giphys)` to see all attributes:

```
{#162 ▼
  +"data": array:25 [▼
    0 => {#163 ▼
      +"type": "gif"
      +"id": "W80Y9y1XwiL84"
      +"slug": "gift-W80Y9y1XwiL84"
      +"url": "http://giphy.com/gifs/gift-W80Y9y1XwiL84"
      ...
    }
    1 => {#182 ▶}
    2 => {#202 ▶}
    ...
```

#### Translate

[](#translate)

The translate API draws on search, but uses the Giphy "special sauce" to handle translating from one vocabulary to another.

Method: Giphy::translate($query, $rating = null, $lang = null)

```
$giphy= Giphy::translate('cat');

// Get id
$giphy->data->id;

// Get image original url
$giphy->data->images->original->url;

// Get image original mp4 url
$giphy->data->images->original->mp4;

//etc
```

You can do a `dd($giphy)` to see all attributes:

```
{#162 ▼
  +"data": {#163 ▼
    +"type": "gif"
    +"id": "3oz8xQQP4ahKiyuxHy"
    ...
    +"images": {#165 ▼
      ...
      +"original": {#180 ▼
        +"url": "http://media3.giphy.com/media/3oz8xQQP4ahKiyuxHy/giphy.gif"
        +"width": "480"
        +"height": "352"
        +"size": "3795005"
        +"frames": "33"
        +"mp4": "http://media3.giphy.com/media/3oz8xQQP4ahKiyuxHy/giphy.mp4"
        +"mp4_size": "132229"
        +"webp": "http://media3.giphy.com/media/3oz8xQQP4ahKiyuxHy/giphy.webp"
        +"webp_size": "756840"
      }
      ...
```

#### Trending

[](#trending)

Fetch GIFs currently trending online. On this case, `$giphys` is an array.

Method: Giphy::trending($limit = 25, $rating = null)

```
$giphys = Giphy::trending();

foreach ($giphys->data as $giphy) {
    // Get id
	$giphy->id;

	// Get image original url
	$giphy->images->original->url;

	// Get image original mp4 url
	$giphy->images->original->mp4;

	//etc
}
```

You can do a `dd($giphys)` to see all attributes:

```
{#162 ▼
  +"data": array:25 [▼
    0 => {#163 ▼
      +"type": "gif"
      +"id": "l2SqiAELInKQ8rF0Q"
      +"slug": "2dopequeens-podcast-2-dope-queens-l2SqiAELInKQ8rF0Q"
      +"url": "http://giphy.com/gifs/2dopequeens-podcast-2-dope-queens-l2SqiAELInKQ8rF0Q"
      ...
    }
    1 => {#183 ▶}
    2 => {#203 ▶}
    ...
```

#### Random

[](#random)

Returns a random GIF, limited by tag.

Method: Giphy::random($query, $rating = null)

```
$giphy = Giphy::random('cat');

// Get id
$giphy->data->id;

// Get image original url
$giphy->data->image_original_url;

// Get image mp4 url
$giphy->data->image_mp4_url;

//etc
```

You can do a `dd($giphy)` to see all attributes:

```
{#162 ▼
  +"data": {#163 ▼
    +"type": "gif"
    +"id": "qbpRDgYI5JoKk"
    +"url": "http://giphy.com/gifs/cat-qbpRDgYI5JoKk"
    +"image_original_url": "https://media0.giphy.com/media/qbpRDgYI5JoKk/giphy.gif"
    ...
  }
  +"meta": {#164 ▼
    +"status": 200
    +"msg": "OK"
  }
}
```

#### By ID

[](#by-id)

Returns meta data about a GIF, by GIF id.

Method: Giphy::getByID($id)

```
$giphy= Giphy::getByID('qbpRDgYI5JoKk');

// Get id
$giphy->data->id;

// Get image original url
$giphy->data->images->original->url;

// Get image original mp4 url
$giphy->data->images->original->mp4;

//etc
```

You can do a `dd($giphy)` to see all attributes:

```
{#162 ▼
  +"data": {#163 ▼
    +"type": "gif"
    +"id": "qbpRDgYI5JoKk"
    ...
    +"images": {#164 ▼
      ...
      +"original": {#179 ▼
        +"url": "https://media1.giphy.com/media/qbpRDgYI5JoKk/giphy.gif"
        +"width": "500"
        ...
```

#### By IDs

[](#by-ids)

A multiget version of the get GIF by ID endpoint. On this case, `$giphys` is an array.

Method: Giphy::getByIDs(array $ids)

```
$giphys = Giphy::getByIDs(['qbpRDgYI5JoKk','FiGiRei2ICzzG']);

foreach ($giphys->data as $giphy) {
    // Get id
	$giphy->id;

	// Get image original url
	$giphy->images->original->url;

	// Get image original mp4 url
	$giphy->images->original->mp4;

	//etc
}
```

You can do a `dd($giphys)` to see all attributes:

```
{#162 ▼
  +"data": array:2 [▼
    0 => {#163 ▼
      +"type": "gif"
      +"id": "qbpRDgYI5JoKk"
      +"slug": "cat-qbpRDgYI5JoKk"
      ...
    }
    1 => {#182 ▼
      +"type": "gif"
      +"id": "FiGiRei2ICzzG"
      +"slug": "funny-cat-FiGiRei2ICzzG"
      ...
```

### Stickers

[](#stickers)

The methods of Stickers are similar to the methods Giphy, so I will omit the examples of `dd()`, but also you can use it to view all the attributes of objects.

#### Sticker Search

[](#sticker-search)

Search all Sticker for a word or phrase. Punctuation will be stripped and ignored. On this case, `$stickers` is an array.

Method: Stickers::search($query, $limit = 25, $offset = 0, $rating = null, $lang = null)

```
$stickers = Stickers::search('dog');

foreach ($stickers->data as $sticker) {
    // Get id
	$sticker->id;

	// Get image original url
	$sticker->images->original->url;

	// Get image original mp4 url
	$sticker->images->original->mp4;

	//etc
}
```

#### Sticker Translate

[](#sticker-translate)

The translate API draws on search, but uses the Stickers "special sauce" to handle translating from one vocabulary to another.

Method: Stickers::translate($query, $rating = null, $lang = null)

```
$sticker= Stickers::translate('cat');

// Get id
$sticker->data->id;

// Get image original url
$sticker->data->images->original->url;

// Get image original mp4 url
$sticker->data->images->original->mp4;

//etc
```

#### Sticker Trending

[](#sticker-trending)

Fetch Stickers currently trending online. On this case, `$stickers` is an array.

Method: Stickers::trending($limit = 25, $rating = null)

```
$stickers = Stickers::trending();

foreach ($stickers->data as $sticker) {
    // Get id
	$sticker->id;

	// Get image original url
	$sticker->images->original->url;

	// Get image original mp4 url
	$sticker->images->original->mp4;

	//etc
}
```

#### Sticker Random

[](#sticker-random)

Returns a random Sticker, limited by tag.

Method: Stickers::random($query, $rating = null)

```
$sticker = Stickers::random('cat');

// Get id
$sticker->data->id;

// Get image original url
$sticker->data->image_original_url;

// Get image mp4 url
$sticker->data->image_mp4_url;

//etc
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

9

Last Release

1740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fafeedb68c6ad2ddbb249caed67289c8c74073d25fcfb210534a9769d393dda4?d=identicon)[ghanem](/maintainers/ghanem)

---

Top Contributors

[![AbdullahGhanem](https://avatars.githubusercontent.com/u/5055892?v=4)](https://github.com/AbdullahGhanem "AbdullahGhanem (16 commits)")

---

Tags

apigifsgiphygiphy-apigiphy-gifslaravelphpapilaravelgifgiphy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ghanem-giphy/health.svg)

```
[![Health](https://phpackages.com/badges/ghanem-giphy/health.svg)](https://phpackages.com/packages/ghanem-giphy)
```

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[jeroen-g/flickr

Modern PHP package to make Flickr API calls. Ships with Laravel implementation.

2559.9k2](/packages/jeroen-g-flickr)[exlo89/laravel-sevdesk-api

A helpful Sevdesk API client for Laravel.

1116.5k](/packages/exlo89-laravel-sevdesk-api)[dystcz/lunar-api

Dystore API layer for Lunar e-commerce package

411.1k3](/packages/dystcz-lunar-api)[yxx/laravel-quick

agile development

145.3k](/packages/yxx-laravel-quick)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
