This personal site has an overengineered API.
Let's explore what you can do with it ๐
Yes. Of course there's an API.
It started as a simple way to serve some images and somehow evolved into a full-blown JWT-authenticated, Cloudflare Workers-powered, over-engineered monster. But hey, at least it's fast. โก
The API powers various features on this site and provides programmatic access to some services. It's built on Nuxt 3, runs on Cloudflare's edge network, and has more authentication than a government facility.
๐ก Fun fact: This API probably handles more authentication flows than actual requests.
The API uses JWT tokens.
Pass your JWT as a Bearer token or a token
GET parameter.
These endpoints are available to everyone. Use them responsibly, or don't - I'm not your dad.
The classic ping-pong. Confirms the API hasn't caught fire and returns some information about your request.
Could be used as a "what is my IP" at a push.
Generates dashboard data for dashboard apps which display dashboards.
These endpoints require authentication. Without proper tokens, you'll get a 401 faster than you can say "unauthorized".
Generates alt text for an image using AI.
Got a ticket with a description just containing a URL, image, or single sentence of text? Let AI go into detail for you.
Make your image smaller and more better.
Want to use the API? Here's the quickest way to get started:
curl https://dave.io/api/ping
If this works, congrats! The API is alive.
Need a JWT to call any protected endpoints? Ask me.
The API runs on Cloudflare Workers, so it's distributed globally. You'll always hit the nearest edge location.