I trying to make a request GET to https://randomuser.me/api/
import requests
import json
url = "https://randomuser.me/api/"
data = requests.get(url).json
print data
I kept getting
# <bound method Response.json of <Response [200]>>
How do I see the json response ? Something like this
{
"results": [
{
"user": {
"gender": "female",
"name": {
"title": "ms",
"first": "kerttu",
"last": "tervo"
},
"location": {
"street": "9102 aleksanterinkatu",
"city": "eurajoki",
"state": "pirkanmaa",
"zip": 67561
},
"email": "[email protected]",
"username": "silvercat709",
"password": "papa",
"salt": "tOCPX2GL",
"md5": "86c60371eeb94596916d66cee898c869",
"sha1": "d06c4f2e43f8c0e53d88e538655f1152169ce575",
"sha256": "5a6b011841b27b08c38d2091dfb3d7ca50f55192ca0fcf6929dae098316c9aae",
"registered": 1419602511,
"dob": 1266822680,
"phone": "03-479-964",
"cell": "047-950-61-69",
"HETU": "220210A290R",
"picture": {
"large": "https://randomuser.me/api/portraits/women/68.jpg",
"medium": "https://randomuser.me/api/portraits/med/women/68.jpg",
"thumbnail": "https://randomuser.me/api/portraits/thumb/women/68.jpg"
}
}
}
],
"nationality": "FI",
"seed": "7d24284202c2cfdb06",
"version": "0.8"
}
Actually you should call it (since there is method).
data = requests.get(url).json()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With