This API returns quotes using 3 different providers:
- Random quotes found on the internet
- Inspirational quotes by inspirobot
- Famous quotes from the tv show kaamelott
This API can easily be deployed as a Cloudflare Worker or a Netlify Edge Function. Other integrations might be added in the future.
# pnpm is needed in package scripts
npm install --global pnpm
npm install --global wrangler
# dev
pnpm cloudflare:dev
# ⎔ Starting local server...
# Ready on http://127.0.0.1:8787
# deploy
pnpm cloudflare:deploy
npm install --global netlify
# dev
pnpm netlify:dev
# ◈ Server now ready on http://localhost:8888
# ◈ Loaded edge function index
# deploy using dashboard
All endpoints return a list of quotes with the same type
type Quotes = {
author: string
content: string
}[]
Returns 20 random english quotes
GET /classic
[
{
"author": "Joseph Campbell",
"content": "Find a place inside where there's joy, and the joy will burn out the pain."
},
{
"author": "Theodore Roosevelt",
"content": "With self-discipline most anything is possible."
},
// ...
]
Returns 20 random quotes from a specified language
GET /classic/:lang
[
{
"author": "Socrate",
"content": "Tout ce que je sais, c'est que je ne sais rien."
},
{
"content": "L’enthousiasme a toujours engendré la certitude.",
"author": "Alfred Espinas"
},
// ...
]
Returns at least 10 quotes from Inspirobot
GET /inspirobot
[
{
"author": "Inspirobot",
"content": "Depressions can become memorable."
},
{
"author": "Inspirobot",
"content": "Notice how your left nostril is connecting to your heart."
},
// ...
]
Returns 20 quotes from a list of kaamelott quotes shamelessly stolen from sin0light/api-kaamelott.
GET /kaamelott
[
{
"author": "Le Roi Burgonde",
"content": "Arthour !… Pas changer assiette pour fromage !"
},
{
"author": "Perceval",
"content": "Là, vous faites sirop de vingt-et-un et vous dites: beau sirop, mi-sirop, siroté, gagne-sirop, sirop-grelot, passe-montagne, sirop au bon goût."
},
// ...
]