1. Learn
  2. /
  3. Kurse
  4. /
  5. Introduction to APIs in Python

Connected

Übung

Receiving JSON with the requests package

When requesting JSON data from an API, the requests library makes it really easy to decode the JSON string you received from the API back into a Python object. In this exercise you'll first need to request data in the JSON format from the API, then decode the response into a Python object to retrieve and print the album Title property.

Note: The requests package has been imported for you, and because the albums API is protected by authentication, the correct header has already been added.

Anleitung

100 XP
  • Add the correct header to request JSON from the API.
  • Decode the JSON response into an album object.
  • Print the album Title property.