Learn Before
Code

Using the json Method on a Response Object

The following is an example of the use of the json method.

import requests resp = requests.get('https://baseurl.api.com', params={'title': 'Party Rock Anthem'}) json_object = resp.json() print(type(json_object)) #prints <class 'dict'> print(json_object['artist']) #prints 'LMFAO'

0

1

Updated 2021-05-18

Tags

Python Programming Language

Data Science