This content originally appeared on DEV Community and was authored by Vamsi Krishna
We can create Awesome Projects If we know how to fetch an API in python.
We all know python is the most easiest and widely used programming language even though it is slow.
so in this blog we will learn how to fetch an API in python.
we will use an API which will give us a list of words.
API -- Click Here
import requests
import json
# fetching API
response_API = requests.get('https://www.randomlists.com/data/words.json')
data = response_API.text # gives in a text format
# converting it into json object
json_data = json.loads(data)
# getting list of words
words = json_data["data"]
print(words)
This content originally appeared on DEV Community and was authored by Vamsi Krishna

Vamsi Krishna | Sciencx (2022-07-23T12:07:39+00:00) How to fetch API in Python 🔥. Retrieved from https://www.scien.cx/2022/07/23/how-to-fetch-api-in-python-%f0%9f%94%a5/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.