Skip to content
Shubham Datarkar

Two lines, and a light left on

Yesterday's only commit flipped a default between two search-data vendors. The 2-line diff was the payoff for a boring interface I wrote weeks ago and half-forgot.

SD
Shubham Datarkar
· 2 min read

Yesterday's only commit was two lines. It flipped a default from one search-data vendor back to another. Sounds like nothing. It was the payoff for a decision I made weeks ago and had half-forgotten.

KalamAI, my SEO writing tool, needs to see what Google actually ranks for a keyword before it writes a word. I don't scrape Google myself -- that way lies pain and IP bans. I pay a vendor, DataForSEO, for clean SERP data. Then their account on my side went inactive, and the whole analysis step started throwing errors. A writing tool that can't see the SERP is just a fancy text box.

The lazy fix at that moment would have been to hardcode a swap to a second vendor, Serper, and move on. I almost did. But I had already built a small SerpProvider interface -- one contract, two implementations behind it -- so switching sources was a config switch, not a rewrite. I set SERP_PROVIDER to Serper in Vercel and KalamAI kept running while DataForSEO was dark.

The interface earned its keep

Serper is fine. Cheaper, even. But it has no AI Overview data, and AI Overviews are half the reason KalamAI exists -- the whole pitch is writing for the AI-search era, so seeing what Google's AI surfaces actually matters. Serper was always the understudy, never the lead.

Yesterday DataForSEO went live again. The fix was to flip the unset-env default in defaultSerp() back to DataForSEO-first. Two lines added, two removed. An explicit SERP_PROVIDER still overrides it, and Serper stays the fallback when only its key is present. Anyone who set the env by hand notices nothing at all.

What I keep relearning: the boring abstraction is the one that pays. When I wrote SerpProvider I wasn't sure it earned its own file -- one real vendor, why bother with an interface? Lazy-brain says don't build flexibility you don't need yet, and usually lazy-brain is right. But SERP vendors are exactly the kind of thing that goes down, gets pricey, or changes its API on you. That is the narrow case where the interface is worth it, and this week it turned an outage into a shrug.

The best abstraction is the one you forget you wrote until the day it saves you an afternoon.

-- me, mildly smug

Thin day otherwise. One commit, two lines, and a lot of relief that past-me left a light on. Next up on KalamAI is the article-quality pass -- the pipeline runs end to end now, but the writing still reads like a robot trying hard. That is the real work. The search data is just the ingredient.

Reactions

How was this article?

Newsletter

Never miss the next one

Get the latest playbooks, build logs, and the occasional unpublished idea straight to your inbox. One signal a week — no noise.