NC DMV Appointment
During the pandemic, NC DMV appointments were booked four to six months out. New slots appeared unpredictably and in small batches, so getting one meant refreshing the website like it was a part-time job. I built a bot t…
During the pandemic, NC DMV appointments were booked four to six months out. New slots appeared unpredictably and in small batches, so getting one meant refreshing the website like it was a part-time job. I built a bot to do the refreshing.
The first version watched the site and notified me. People around me wanted in, so it grew into a multi-user service: a FastAPI web app where users register and set alert preferences, a Playwright scraper that polls every 30 minutes, PostgreSQL storing every availability snapshot, and email alerts through Brevo. The UI is bilingual, English and Chinese. Everything runs as three containers (database, web service, scraper) under Docker Compose, with Alembic handling schema migrations.
Two decisions worth noting. Playwright over plain HTTP scraping, because the DMV site is JavaScript-heavy and there's no API; a real browser was the honest way to see what users see. And a 30-minute poll interval, which is the politeness tradeoff: frequent enough to catch releases, light enough to not hammer a public site.
Then the stored snapshots became their own project. Months of data answered a question no amount of refreshing could: when does the DMV release slots? Pandas analysis per appointment type showed most new slots appear in early-morning windows on Mondays and Tuesdays, and time-budget curves showed diminishing returns past a certain checking frequency. The bot got me an appointment; the dataset told everyone else when to look.