From 0aa0ef7cd0f065edcd29051b37ec4da0c6c4c757 Mon Sep 17 00:00:00 2001 From: houston_boston <50076471+HoustonBoston@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:43:44 +0000 Subject: [PATCH] Making API calls in Python! --- other_examples/roshan-spotify/README.md | 1 + other_examples/roshan-spotify/main.py | 10 ++++++++++ other_examples/roshan-spotify/requirements.txt | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 other_examples/roshan-spotify/README.md create mode 100644 other_examples/roshan-spotify/main.py create mode 100644 other_examples/roshan-spotify/requirements.txt diff --git a/other_examples/roshan-spotify/README.md b/other_examples/roshan-spotify/README.md new file mode 100644 index 0000000..0b38781 --- /dev/null +++ b/other_examples/roshan-spotify/README.md @@ -0,0 +1 @@ +My code makes a request to the Art Institute of Chicago. You input whatever art id you want and you can get the thumbnail information. \ No newline at end of file diff --git a/other_examples/roshan-spotify/main.py b/other_examples/roshan-spotify/main.py new file mode 100644 index 0000000..bff4f50 --- /dev/null +++ b/other_examples/roshan-spotify/main.py @@ -0,0 +1,10 @@ +import requests +import json + +print("Chicago art api call example") +id = input("Enter art id\n") + +res = requests.get(f"https://api.artic.edu/api/v1/artworks/{id}") +res_json = res.json() + +print('returned data:\n', res_json["data"]["thumbnail"]) \ No newline at end of file diff --git a/other_examples/roshan-spotify/requirements.txt b/other_examples/roshan-spotify/requirements.txt new file mode 100644 index 0000000..a979e55 --- /dev/null +++ b/other_examples/roshan-spotify/requirements.txt @@ -0,0 +1,3 @@ +maskpass +requests +json