You can download this code by clicking the button below.
This code is now available for download.
This function uses the requests library to fetch data from a random user information API and returns the result in JSON format.
Technology Stack : requests, JSON parsing
Code Type : Function
Code Difficulty : Intermediate
import requests
import random
def fetch_random_user_info():
url = 'https://randomuser.me/api/'
response = requests.get(url)
data = response.json()
return data