[Python] I'm using the Giphy API and I was wondering how you could get a GIF's Image URL...

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    Here is the code I have, it works fine, but how could I make it that there is a new variable that is equal to the Image URL of the GIF so that the user can get the Source URL of the GIF?

    import requests

    url = "https://giphy.p.rapidapi.com/v1/gifs/search"

    searchtag = input()

    querystring = {"api_key":"secret_key","q":searchtag,"limit":"1","offset":"0","rating":"pg-13"}

    headers = {
    'x-rapidapi-key': "4005b98f9bmsh977c629b89034a7p19b52fjsn22b7fb5ce3bb",
    'x-rapidapi-host': "giphy.p.rapidapi.com"
    }

    response = requests.request("GET", url, headers=headers, params=querystring)

    print(response.text)

    Continue reading...

Compartilhe esta Página