Quote Generator

Are there any examples or projects to do a quote generator from API with Python?

To build a quote generator API, I would look into Flask.

More on Flask here. Welcome to Flask — Flask Documentation (3.0.x)

Maybe one day Flask can be covered at FreeCodeCamp in the curriculum.

1 Like

What type of project? Web based, gui, or some other platform?

Here is a basic example using the api from here

import requests
import json
from random import choice

url = 'https://type.fit/api/quotes'
quotes = json.loads(requests.get(url).text)

quote = choice(quotes)
print(f'Random Quote: {quote.get('text')}')
print(f'Author: {quote.get('author').split(',')[0]}')

1 Like