Giphy API client for searching and retrieving GIFs.
Configuration
config :giphy_api,
api_key: "your-giphy-api-key"Usage
# Search for GIFs
{:ok, results} = GiphyApi.search("funny cat", limit: 20)
# Get trending GIFs
{:ok, results} = GiphyApi.trending(limit: 20)
# Search with a per-call key (overrides app config)
{:ok, results} = GiphyApi.search("funny cat", api_key: "abc123", limit: 20)Results are returned as a list of %GiphyApi.Gif{} structs with
pre-selected URLs for different sizes.
Summary
Functions
@spec get( String.t(), keyword() ) :: {:ok, GiphyApi.Gif.t()} | {:error, term()}
Get a single GIF by its Giphy ID.
Options
:api_key- Override the Giphy API key for this call.
@spec search( String.t(), keyword() ) :: {:ok, [GiphyApi.Gif.t()]} | {:error, term()}
Search for GIFs matching the query.
Options
:api_key- Override the Giphy API key for this call. If omitted, falls back toApplication.get_env(:giphy_api, :api_key). Useful for per-tenant configs stored outside app env.:limit- Max results (default: 20, max: 50):offset- Pagination offset (default: 0):rating- Content rating filter: "g", "pg", "pg-13", "r" (default: "pg-13"):lang- Language code (default: "en")
@spec trending(keyword()) :: {:ok, [GiphyApi.Gif.t()]} | {:error, term()}
Get trending GIFs.
Options
:api_key- Override the Giphy API key for this call.:limit- Max results (default: 20, max: 50):offset- Pagination offset (default: 0):rating- Content rating filter (default: "pg-13")