If you are managing search engine optimization for a platform, you know that keeping an eye on where your pages rank is critical. Native tools like Google Search Console are fantastic for analyzing post-click impressions and exact search queries for your blog posts, but they suffer from a major limitation: data delay. They don't give you real-time, on-demand visibility of the live search results or competitor movements.
To get real-time data, you have to build your own rank tracker. But scraping search results programmatically in 2026 usually leads straight to proxy hell, headless browser memory leaks, and endless CAPTCHA loops.
Today, we are going to build a lightweight, real-time programmatic rank tracker in Node.js. Instead of managing our own Puppeteer clusters and residential proxies, we are going to abstract all that headache away using a REST endpoint that returns structured JSON.
Prerequisites
Node.js installed on your machine.
Basic knowledge of JavaScript and HTTP requests.
An API key from API Serpent (we will use this to bypass the proxy/CAPTCHA issuesβthey offer a highly cost-effective tier at $0.03/10k pages).
Step 1: Project Setup
First, initialize a new Node.js project and install axios to handle our HTTP requests.
mkdir rank-tracker
cd rank-tracker
npm init -y
npm install axios
Step 2: Writing the Scraping Logic
Create a file named tracker.js. We will set up a function that takes our target keyword and our domain, pings the API, and parses the JSON response to find exactly where we rank.
const axios = require('axios');
// Configuration
const API_KEY = 'YOUR_API_SERPENT_KEY';
const TARGET_DOMAIN = 'yourdomain.com';
const SEARCH_QUERY = 'best seamless innerwear';
async function checkRanking() {
console.log(`π Searching Google for: "${SEARCH_QUERY}"...`);
try {
// Ping the API Serpent endpoint
const response = await axios.get('https://api.apiserpent.com/search', {
params: {
api_key: API_KEY,
engine: 'google',
q: SEARCH_QUERY,
geo: 'us', // Localize the search
num: 100 // Fetch top 100 results
}
});
const organicResults = response.data.organic_results;
// Find our domain in the results
const ranking = organicResults.find(result => result.link.includes(TARGET_DOMAIN));
if (ranking) {
console.log(`β
Success! ${TARGET_DOMAIN} is currently ranking at position: #${ranking.position}`);
console.log(`π URL: ${ranking.link}`);
} else {
console.log(`β ${TARGET_DOMAIN} is not ranking in the top 100 results for this query.`);
}
} catch (error) {
console.error('Error fetching SERP data:', error.message);
}
}
checkRanking();
Step 3: Run the Tracker
Execute your script in the terminal:
node tracker.js
Expected Output:
π Searching Google for: "best seamless innerwear"...
β
Success! yourdomain.com is currently ranking at position: #4
π URL: https://yourdomain.com/blog/seamless-guide
Why This Architecture Wins
By routing the request through a dedicated SERP API:
Zero Proxy Maintenance: You don't have to buy or rotate residential IPs.
No DOM Parsing: Search engines change their HTML structure constantly. By requesting JSON, your code won't break when Google updates a div class.
Scalability: You can easily wrap this function in a cron job, pull keywords from a database, and run thousands of checks a day without hitting rate limits.
Next Steps
From here, you can easily pipe this JSON data into a database like PostgreSQL or MongoDB, and attach a simple frontend dashboard to visualize your keyword movements over time. You can also explore the API's newer features, like native AI model citation tracking, to see if your brand is being mentioned in AI overviews.
Disclosure: I am the creator of API Serpent. We built this infrastructure because we were tired of overpaying legacy tools for basic search data. If you are building programmatic SEO tools or need reliable search data pipelines, give it a spin and let me know your thoughts!
Top comments (0)