Inspirational Quotes
Forismatic offers an API to fetch inspirational quotes and expressions in various formats for websites and applications.
import requests
url = "http://api.forismatic.com/api/1.0/"
params = {
"method": "getQuote",
"format": "json",
"lang": "en"
}
try:
response = requests.get(url, params=params)
response.raise_for_status() # Raise an exception for HTTP errors
quote_data = response.json()
print(quote_data)
except requests.exceptions.RequestException as e:
print(f"Error fetching quote: {e}")Last 50 checks (10 min intervals)