Skip to content

Commit c53bc00

Browse files
Create giphy_trending.py
1 parent c18a5b4 commit c53bc00

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import requests
2+
3+
# Replace the following with the API key generated above.
4+
api_key = "API_KEY"
5+
endpoint = "https://api.giphy.com/v1/gifs/trending"
6+
params = {"api_key": api_key, "limit": 3, "rating": "g"}
7+
8+
response = requests.get(endpoint, params=params).json()
9+
for gif in response["data"]:
10+
title = gif["title"]
11+
trending_date = gif["trending_datetime"]
12+
url = gif["url"]
13+
print("%s | %s | %s" % (title, trending_date, url))

0 commit comments

Comments
 (0)