Pelican API
September 2026 · api, cloudflare, llms
How I built this with Claude Code ↓
Simon Willison benchmarks new AI models by asking each one for an SVG of a pelican riding a bicycle. Pelican API is a small read-only API over those posts: which model, which vendor, when, and a link back to the original.
A daily cron job reads the Atom feed, stores new posts in Cloudflare D1, and serves them through Hono with an OpenAPI spec and interactive docs.
The scoreboard below reads the live API.
Building it with an agent
I built Pelican API with Claude Code in one afternoon, then spent the next nine days making it trustworthy. The first commit landed at 12:14 on September 25 and the API was live before 5pm. Everything after that went on tests, cleanup, and the problems you only find once something runs on its own.
The agent wrote almost all of the code. My job was to write down what I wanted, make the calls only I could make, and say yes or no before anything left my machine.
The spec came first
I had the agent interview me first, and SPEC.md came out of my answers.
The first commit was SPEC.md, and every later session started by reading it. It pinned down the things an agent would otherwise guess at:
- A post and a pelican are different things. One post can review four models; another shows a pelican in a film and none from a model.
- Metadata only. No copies of Simon’s images or text, every record links back, and the API reads the feed at most once a day.
- The free plan’s limits: 50 database queries and 10 ms of CPU per run, so the design had to fit inside them from the start.
- A definition of done, including “the daily refresh has run on its own for 7 days”.
The part that paid off most was the Decisions section. Each time something changed, the decision went in with its reason: why the backfill reads Simon’s Datasette mirror instead of scraping, and why model names come from a hand-kept catalog instead of an LLM call. A new session could pick up from there without me explaining it all again.
How the work went
The build was a run of small, tested steps. Feed parsing, storage, the routes, the cron job and the backfill each came in their own commit, a few minutes apart. By 12:57 there was a README covering how to develop, curate, deploy and check the daily runs.
The catalog was the slow part. Simon had 144 tagged posts, and each needed a judgment: which pelicans count, which model drew them, how to spell its name. Four agents drafted entries with quotes from the posts as evidence, one pass settled a single spelling per model, and I spot-checked. Writing those judgments down as rules (one pelican per model per post; a pelican shown again in a later post doesn’t count) made later posts quick to catalog.
I kept a few gates for myself. Deploys waited for my yes, I owned the Cloudflare login, and the agent asked before every commit and push.
Then came the second pass. Mutation testing with Stryker on September 29 and 30 showed where the tests passed without checking anything, and 14 test commits followed. On October 1 a cleanup sweep made 18 small refactoring commits in about seven minutes, each with the suite still green. The test count went from 103 to 134 along the way.
Giving it a pipeline
Three weeks after the first commit, I asked the agent to bring the repo up to the standard of my other projects. It compared the repos, listed nine gaps, then argued against half of them. The project was done, and every extra piece needs upkeep, so we kept the ones that pay for themselves: an AGENTS.md for the agent, one command that runs every check, CI on every push, and a daily check on production.
Deploying from CI was the real tradeoff. A token that can deploy now sits in a public repo’s secrets, where before there was only my laptop login, which expired about a day after each sign-in. I chose CI, so merging to main is now my yes.
The first deploy from CI turned up four posts that had sat unclassified since October 6. Nobody had looked in nine days. The production watch went in next, and its first run failed on exactly those four. Now a failed run emails me, and the four catalog entries shipped through the new pipeline the same afternoon.
A few days later I added a review step. Claude Code now reads every pull request and leaves comments, using a workflow shared across my repos. It paid off on a one-line catalog entry. Simon wrote “DeepSeek 4.1 Flash 1017”, the agent stored “DeepSeek-V4.1-Flash-1017”, and the reviewer pointed out that our rule says to use the name as Simon writes it, and that the pull request cited no source. I kept the agent’s name, since the catalog already turns Simon’s spacing into DeepSeek’s own hyphenated form. The sources and that precedent went into the pull request, so the reasoning sits next to the change instead of in a chat I’ll never reopen.
What went wrong
Nothing broke the live API, but five things surprised me, and none of them showed up in the tests.
- The login kept expiring. Checking the daily runs needed my Cloudflare login, which stopped working about a day after each sign-in. A read-only API token fixed it for good.
- The scoreboard looked wrong while the tests passed. The vendor bars were empty because a
spanignores width unless it’s a block, and narrow screens scrolled sideways. I only saw it when I opened the page in a browser. - My local database had no tables. The first local smoke test before a deploy returned 500s, because the migrations had only ever run against the live database.
- The token screen had changed. Cloudflare reworked its API token page in September, and both the agent and Cloudflare’s own AI described the old one. I couldn’t find the permissions either of them named.
- Every new post looked like an outage. The production check sent the same failure email for a post waiting to be cataloged as for a real breakage. Splitting it into two alarms made each email say what it means.
What I’d do differently
Most of these come down to checking the real thing sooner.
- Look at every page in a browser before calling it done. Green tests said the scoreboard was fine; my eyes would have said otherwise in ten seconds.
- Set up the read-only token on day one. Anything that has to keep working unattended shouldn’t depend on a login that expires.
- Run mutation testing from the start. The 14 test commits it triggered mean the first round of tests passed more often than it checked.
- Put an alarm on anything I’d otherwise have to remember to check. Four posts waited nine days because noticing them depended on me.
Running it for a year
I’d never run a public API before, so I’m keeping this one running for a year to see what maintaining it teaches me.