lesson learned

I hit 205 of a 250 call daily API cap and never saw it coming

The service that posts my content to social media caps API usage at 250 calls a day. I did not know that number existed until I was five calls from it.

The account had been quietly showing an “approaching usage limit” banner. I had never opened the usage page, so I had never seen it. That is the first lesson, and it is a boring one: if a vendor gives you a usage dashboard, look at it before you need to.

The second lesson is the one worth writing down. Once I went looking for where the calls were going, almost all of them traced back to one habit: every nightly pass through my content pipeline checked on the status of every scheduled post, by calling the API and asking “did this go out yet?”

That sounds reasonable until you look at what “every scheduled post” actually meant. It included posts scheduled for next week. A post due next Tuesday has, definitionally, not gone out yet. Asking the API about it tonight is not caution. It is a question with a foregone answer, paid for anyway.

One night, seventeen scheduled rows across three channels turned into 51 API calls, a fifth of the entire daily budget, spent on questions the calendar could have answered for free.

The fix took one line: filter the check to only rows whose scheduled time is already in the past. Same coverage. Same nightly check. The difference is asking the question only when the answer might actually be no. That same run now costs 6 calls instead of 51.

Nothing about this pattern is exotic. It shows up anywhere you poll an external system “just in case”: a cron job that checks every record instead of the ones due for action, a health check that pings every endpoint instead of the ones flagged unhealthy last time, a sync job that re-fetches everything instead of what changed. The API cap is what made this one visible. Most versions of this mistake never hit a hard limit, so they just sit there burning a slower budget, quota or compute or your own attention, for years.

The cheap version of this lesson: before you loop over “everything,” ask whether the loop already knows which items could possibly need the work. If it does, filter first. The API did not care that I was asking a question with a known answer. It billed me for it anyway.

> I send a short AI report every week. What shipped, what matters if you build with AI.

Subscribe free →