Skip to content

module api.py🔗


function search_gifs🔗

search_gifs(
    q: str,
    lang: str = None,
    rating: giphpy.enums.Rating = None,
    limit: int = None,
    offset: int = None,
    api_key: str = None,
    random_id: str = None,
    bundle: giphpy.enums.Bundle = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifListResponse]

Search for gifs by a query string.

https://developers.giphy.com/docs/api/endpoint#search

Args:

  • q: search query term or phrase
  • lang: specify language using a 2-letter ISO 639-1 language code.
  • rating: filters results by specified rating
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • api_key: giphy api key
  • random_id: an ID/proxy for a specific user.
  • bundle: returns only renditions that correspond to the named bundle.
  • serialize: defaults to False. if True, returns a GifListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifListResponse if serialize is True, else httpx.Response


function search_stickers🔗

search_stickers(
    q: str,
    lang: str = None,
    rating: giphpy.enums.Rating = None,
    limit: int = None,
    offset: int = None,
    api_key: str = None,
    random_id: str = None,
    bundle: giphpy.enums.Bundle = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifListResponse]

Search for stickers by using a query string.

https://developers.giphy.com/docs/api/endpoint#search

Args:

  • q: search query term or phrase
  • lang: specify language using a 2-letter ISO 639-1 language code.
  • rating: filters results by specified rating
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • api_key: giphy api key
  • random_id: an ID/proxy for a specific user.
  • bundle: returns only renditions that correspond to the named bundle.
  • serialize: defaults to False. if True, returns a GifListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifListResponse if serialize is True, else httpx.Response


trending_gifs(
    rating: giphpy.enums.Rating = None,
    limit: int = None,
    offset: int = None,
    api_key: str = None,
    random_id: str = None,
    bundle: giphpy.enums.Bundle = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifListResponse]

Get trending gifs.

https://developers.giphy.com/docs/api/endpoint#trending

Args:

  • rating: filters results by specified rating
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • api_key: giphy api key
  • random_id: an ID/proxy for a specific user.
  • bundle: returns only renditions that correspond to the named bundle.
  • serialize: defaults to False. if True, returns a GifListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifListResponse if serialize is True, else httpx.Response


trending_stickers(
    rating: giphpy.enums.Rating = None,
    limit: int = None,
    offset: int = None,
    api_key: str = None,
    random_id: str = None,
    bundle: giphpy.enums.Bundle = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifListResponse]

Get trending stickers.

https://developers.giphy.com/docs/api/endpoint#trending

Args:

  • rating: filters results by specified rating
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • api_key: giphy api key
  • random_id: an ID/proxy for a specific user.
  • bundle: returns only renditions that correspond to the named bundle.
  • serialize: defaults to False. if True, returns a GifListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifListResponse if serialize is True, else httpx.Response


function gif_translate🔗

gif_translate(
    s: str,
    api_key: str = None,
    weirdness: int = None,
    random_id: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifResponse]

Translate words or phrases to a single gif.

https://developers.giphy.com/docs/api/endpoint#translate

Args:

  • s: search term
  • api_key: giphy api key
  • weirdness ('int', optional): value from 0-10 which makes results weirder as you go up the scale
  • random_id: an ID/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifResponse if serialize is True, else httpx.Response


function sticker_translate🔗

sticker_translate(
    s: str,
    api_key: str = None,
    weirdness: int = None,
    random_id: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifResponse]

Translate words or phrases to a single sticker.

https://developers.giphy.com/docs/api/endpoint#translate

Args:

  • s: search term
  • api_key: giphy api key
  • weirdness ('int', optional): value from 0-10 which makes results weirder as you go up the scale
  • random_id: an ID/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifResponse if serialize is True, else httpx.Response


function random_gif🔗

random_gif(
    api_key: str = None,
    tag: str = None,
    rating: giphpy.enums.Rating = None,
    random_id: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifResponse]

Get a single random GIF

https://developers.giphy.com/docs/api/endpoint#random

Args:

  • api_key: giphy api key
  • tag ('str,optional`): filter results by a specified tag
  • rating: filters results by specified rating
  • random_id: an ID/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifResponse if serialize is True, else httpx.Response


function random_sticker🔗

random_sticker(
    api_key: str = None,
    tag: str = None,
    rating: giphpy.enums.Rating = None,
    random_id: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifResponse]

Get a single random sticker

https://developers.giphy.com/docs/api/endpoint#random

Args:

  • api_key: giphy api key
  • tag ('str,optional`): filter results by a specified tag
  • rating: filters results by specified rating
  • random_id: an ID/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifResponse if serialize is True, else httpx.Response


function random_id🔗

random_id(
    api_key: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.RandomIdResponse]

Generate a unique ID you can assign to each new user in your app.

https://developers.giphy.com/docs/api/endpoint#random-id

Args:

  • api_key: giphy api key
  • serialize: defaults to False. if True, returns a RandomIdResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: RandomIdResponse if serialize is True, else httpx.Response


function action_register🔗

action_register(
    url: str,
    random_id: str,
    ts: int,
    api_key: str = None,
    **kwargs
) → Response

Register an impression, click, or send sing a callback url from the analytics object.

https://developers.giphy.com/docs/api/endpoint#action-register

Args:

  • url: an impression, on click, or send callback url from the analytics object
  • random_id: an id/proxy for a specific user
  • ts: a unix timestamp in milliseconds corresponding to when the action occurred
  • api_key: giphy api key
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: httpx.Response


function get_gif_by_id🔗

get_gif_by_id(
    gif_id: str,
    api_key: str = None,
    random_id: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifResponse]

Get a single gif by its unique identifier

https://developers.giphy.com/docs/api/endpoint#get-gif-by-id

Args:

  • gif_id: the unique identifier of the gif you want details for
  • api_key: giphy api key
  • random_id: an id/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifResponse if serialize is True, else httpx.Response


function get_gifs_by_id🔗

get_gifs_by_id(
    *gif_ids: str,
    api_key: str = None,
    random_id: str = None,
    serialize: bool = None,
    **kwargs
) → Union[httpx.Response, giphpy.models.GifListResponse]

Get one or more gifs by their unique identifiers

https://developers.giphy.com/docs/api/endpoint#get-gifs-by-id

Args:

  • *gif_ids: any number of unique identifiers for gifs you want details for
  • api_key: giphy api key
  • random_id: an id/proxy for a specific user
  • serialize: defaults to False. if True, returns a GifListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: GifListResponse if serialize is True, else httpx.Response


function categories🔗

categories(
    api_key: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.CategoryListResponse]

Get a list of gif categories on the giphy network.

https://developers.giphy.com/docs/api/endpoint#categories

Args:

  • api_key: giphy api key
  • serialize: defaults to False. if True, returns a CategoryListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: CategoryListResponse if serialize is True, else httpx.Response


function autocomplete🔗

autocomplete(
    q: str,
    api_key: str = None,
    limit: int = None,
    offset: int = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.SearchTermListResponse]

Provides a list of valid terms that completes the given tag on the giphy network

https://developers.giphy.com/docs/api/endpoint#autocomplete

Args:

  • q: tag term
  • api_key: giphy api key
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • serialize: defaults to False. if True, returns a SearchTermListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: SearchTermListResponse if serialize is True, else httpx.Response


channel_search(
    q: str,
    api_key: str = None,
    limit: int = None,
    offset: int = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.ChannelListResponse]

Returns all the giphy channels matching the query term.

https://developers.giphy.com/docs/api/endpoint#channel-search

Args:

  • q: accepts term to search through giphy’s channels
  • api_key: giphy api key
  • limit: maximum number of objects to return. if not passed, 25
  • offset: the starting position of results. if not passed, 0
  • serialize: defaults to False. if True, returns a ChannelListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: ChannelListResponse if serialize is True, else httpx.Response


function search_suggestions🔗

search_suggestions(
    term: str,
    api_key: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.TermListResponse]

Provides a list of tag terms related to the given tag on the giphy network.

https://developers.giphy.com/docs/api/endpoint#search-suggestions

Args:

  • term: tag term
  • api_key: giphy api key
  • serialize: defaults to False. if True, returns a TermListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: TermListResponse if serialize is True, else httpx.Response


trending_search_terms(
    api_key: str = None,
    serialize: bool = False,
    **kwargs
) → Union[httpx.Response, giphpy.models.TrendingSearchTermsListResponse]

Provides a list of the most popular trending search terms on the giphy network.

https://developers.giphy.com/docs/api/endpoint#trending-search-terms

Args:

  • api_key: giphy api key
  • serialize: defaults to False. if True, returns a TermListResponse object
  • **kwargs: additional kwargs to pass down to httpx.Client.get

Returns: TrendingSearchTermsListResponse if serialize is True, else httpx.Response