DEV Community

Cover image for Building InsightTrack with SerpApi for the SerpApi India Hackathon
Nishikanta Ray
Nishikanta Ray

Posted on

Building InsightTrack with SerpApi for the SerpApi India Hackathon

A few weeks ago, I was looking at a page whose traffic had suddenly dropped.

The analytics told me exactly what happened:

Traffic was down.

But then I had the question that analytics couldn't answer:

Why?

Did the page lose its Google ranking?
Did a competitor move above me?
Did Google change the search results?
Did an AI Overview start answering the query?

My next step was usually pretty manual. I'd open Google, search the keyword, check my position, look at the competitors, and try to figure out what changed.

That got me thinking:

What if I could connect my traffic data with the search results automatically?

That's how I started building InsightTrack.

Connecting traffic with search

The idea behind InsightTrack is pretty simple.

I already have one side of the story from my analytics:

/guides/email-templates

Last week: 1,240 visits
This week:   719 visits
Enter fullscreen mode Exit fullscreen mode

Now I need the other side.

What happened in Google?

That's where SerpApi comes in.

For the SerpApi India Hackathon, I'm integrating SerpApi with InsightTrack to collect SERP data and track how search visibility changes over time.

For example:

"free email templates"

Last week: #3
This week: #9
Enter fullscreen mode Exit fullscreen mode

Now the two pieces can be connected.

Instead of simply saying:

“Traffic dropped 42%.”

InsightTrack can say:

“Traffic dropped because the page moved from #3 to #9, while other websites moved above it.”

That's a much more useful answer.

I didn't want it to always invent a reason

This became one of the most important parts of the project.

Imagine traffic drops by 30%, but the ranking stays exactly the same.

A system that always needs to produce an explanation might blame search anyway.

I didn't want that.

InsightTrack uses deterministic rules to compare traffic and SERP changes.

If the evidence points to a ranking change, it reports that.

If a competitor moved above you, it can identify that.

But if search didn't really change, it can say:

“Search visibility didn't change enough to explain this. Check your referrers, campaigns, or recent deployment.”

The goal isn't to always have an answer.

The goal is to have an answer that can be explained.

A small example

Suppose we have:

Traffic:       -42%
Ranking:       #3 → #9
Competitor:    moved above us
AI Overview:   appeared
Enter fullscreen mode Exit fullscreen mode

InsightTrack combines those observations and produces a finding instead of making me investigate each piece manually.

Under the hood, the attribution engine is just a pure function:

traffic data + keyword findings → finding
Enter fullscreen mode Exit fullscreen mode

No database or API calls inside that layer.

That makes it easy to test and, more importantly, makes the result reproducible.

Then I added MCP

I also wanted this information to be accessible to AI agents.

So InsightTrack exposes the same functionality through MCP.

Now I can ask:

“Who is ranking above me for ‘free email templates’, and why did they overtake me?”

The Gemini API handles the natural-language interaction, while InsightTrack provides the underlying search and traffic data.

The AI doesn't decide the attribution rules.

It asks the tools for the evidence.

The unexpected challenge: search credits

One thing I underestimated was API usage.

Every SERP check costs credits.

If I have 8 keywords and check them every day, that's roughly:

8 × 30 = 240 searches/month
Enter fullscreen mode Exit fullscreen mode

So the search budget became part of the product design.

Instead of making users calculate everything themselves, InsightTrack can work out a collection schedule based on their available credits.

That was a good reminder that API limits aren't just infrastructure problems. They can affect the product itself.

What I'm building next

I want to make the search history more useful over longer periods, improve competitor tracking, and expand AI Overview monitoring.

Because search is changing.

A page can keep the same traditional ranking while the actual search experience around it changes dramatically.

That's the gap I'm trying to explore with InsightTrack.

Analytics tells you what changed.

SerpApi tells you what changed in search.

InsightTrack connects the two.

Built for the SerpApi India Hackathon.

🔗 insightstrack.dev

GitHub: github.com/NishikantaRay/InsightTrack

Built with: SerpApi · PostgreSQL · DuckDB · Node.js · React · MCP · Gemini API

Top comments (0)