This is the Fastify + TypeScript backend for useragent.one. It exposes a simple HTTP API powered by the excellent user-agents package.
- Serves random user-agent strings via a GET endpoint
- Accepts query params to filter results (device type, platform, etc.)
- Fetches a fresh user-agent list daily using
node-cron - Built for speed, lightweight, and deployed with Docker
- Framework: Fastify
- Language: TypeScript
- Validation: Zod
- Scheduler: node-cron
- User-Agent source:
user-agents
The user-agents package maintains an up-to-date list of real browser user-agent strings, updated daily. This backend uses node-cron to pull a fresh copy of the list every 24 hours, so you always get the latest without redeploying or reinstalling.