rfreebern/giphy-php
Composer 安装命令:
composer require rfreebern/giphy-php
包简介
A library implementing access to the Giphy API.
README 文档
README
A library providing a PHP interface to the Giphy API.
Installation
composer require rfreebern/giphy-php Example
There is a file named giphy in the bin directory. Use it like this:
$ ./bin/giphy whiskey GIF Usage
$giphy = new \rfreebern\Giphy(); $result = $giphy->random('whiskey'); print $result->data->image_original_url; By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:
$giphy = new \rfreebern\Giphy($my_giphy_api_key); In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments.
search($query, $limit = 25, $offset = 0)
Searches for gifs matching $query.
getByID($id)
Fetches a specific GIF by its Giphy ID.
getByIDs(array $ids)
Fetches one or more specific GIFs by their Giphy IDs.
translate($query)
Translates a query to a matching GIF. See the docs for more information.
random($tag = null)
Fetches a random GIF, optionally matching the given tag.
trending($limit = 25)
Fetches a list of trending GIFs.
Sticker Usage
$sticker = new \rfreebern\Sticker(); $result = $sticker->random('whiskey'); print $result->data->image_original_url; By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:
$giphy = new \rfreebern\Giphy($my_giphy_api_key); In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments.
search($query, $limit = 25, $offset = 0)
Searches for stickers matching $query.
translate($query)
Translates a query to a matching sticker. See the docs for more information.
random($tag = null)
Fetches a random sticker, optionally matching the given tag.
trending($limit = 25)
Fetches a list of trending stickers.
Credits
- This library was created by Ryan Freebern / @rfreebern.
统计信息
- 总下载量: 89.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: CC0-1.0
- 更新时间: 2026-01-04