/serpapi-pack:serpapi-webhooks-eventsfrom serpapi-pack
Implements SerpApi async search callbacks and scheduled SERP monitoring with change detection for tracking keyword rankings over time.
Ships in serpapi-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
SerpApi does not have traditional webhooks, but supports async searches and the Searches Archive API. Build SERP monitoring by combining scheduled searches with change detection. Common use case: track keyword rankings over time.
import serpapi, os, time
client = serpapi.Client(api_key=os.environ["SERPAPI_API_KEY"])
# Submit async search (returns immediately)
result = client.search(engine="google", q="your keyword", async_search=True)
search_id = result["search_metadata"]["id"]
print(f"Submitted: {search_id}")
# Poll for completion
while True:
archived = client.search(engine="google", search_id=search_id)
status = archived["search_metadata"]["status"]
if status == "Success":
break
elif status == "Error":
raise Exception(f"Search failed: {archived.get('error')}")
time.sleep(2)
print(f"Results: {len(archived.get('organic_results', []))}")
import json, hashlib
from datetime import datetime
class SerpMonitor:
def __init__(self, client, db):
self.client = client
self.db = db
def track_keyword(self, keyword: str, domain: str):
"""Track a domain's ranking position for a keyword."""
result = self.client.search(engine="google", q=keyword, num=100)
organic = result.get("organic_results", [])
position = None
for r in organic:
if domain in r.get("link", ""):
position = r["position"]
break
self.db.insert({
"keyword": keyword,
"domain": domain,
"position": position, # None if not in top 100
"total_results": result.get("search_information", {}).get("total_results"),
"checked_at": datetime.utcnow().isoformat(),
"search_id": result["search_metadata"]["id"],
})
return position
def detect_changes(self, keyword: str, domain: str):
"""Compare current vs previous ranking."""
current = self.track_keyword(keyword, domain)
previous = self.db.get_previous_position(keyword, domain)
if previous and current:
change = previous - current # Positive = improved
if abs(change) >= 3:
self.notify(f"Ranking change for '{keyword}': {previous} -> {current} ({'+' if change > 0 else ''}{change})")
// Run daily keyword tracking
import cron from 'node-cron';
import { getJson } from 'serpapi';
const keywords = ['react framework', 'next.js tutorial', 'typescript guide'];
const targetDomain = 'yoursite.com';
cron.schedule('0 8 * * *', async () => { // Daily at 8 AM
for (const keyword of keywords) {
const result = await getJson({
engine: 'google', q: keyword, num: 100,
api_key: process.env.SERPAPI_API_KEY,
});
const position = result.organic_results?.findIndex(
(r: any) => r.link?.includes(targetDomain)
);
console.log(`${keyword}: Position ${position >= 0 ? position + 1 : 'Not found'}`);
// Save to database, send alerts on changes
}
});
| Issue | Cause | Solution |
|---|---|---|
| Async search never completes | Server issue | Timeout after 60s, retry |
| Position tracking uses many credits | 100 results per search | Run daily not hourly |
| Ranking fluctuates | Normal SERP volatility | Track 7-day moving average |
For performance optimization, see serpapi-performance-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/serpapi-ci-integrationSet up CI/CD for SerpApi integrations with fixture-based testing.
Use when automating SerpApi tests without consuming credits,
or validating search result parsing in CI.
Trigger: "serpapi CI", "serpapi GitHub Actions", "serpapi automated tests".
/serpapi-common-errorsDiagnose and fix SerpApi errors: invalid keys, exhausted credits, blocked searches.
Use when SerpApi returns errors, empty results, or unexpected status codes.
Trigger: "serpapi error", "fix serpapi", "serpapi not working", "serpapi empty results".
/serpapi-core-workflow-aGoogle Search scraping with SerpApi -- organic results, knowledge graph, answer boxes.
Use when building search-powered features, SEO monitoring,
or extracting structured data from Google results.
Trigger: "serpapi google search", "scrape google", "serpapi organic results".
/serpapi-core-workflow-bSearch Bing, YouTube, Google Shopping, Google News, and Google Maps with SerpApi.
Use when scraping non-Google engines, building multi-engine search,
or extracting video/news/shopping/maps data.
Trigger: "serpapi youtube", "serpapi bing", "serpapi news", "serpapi shopping".
/serpapi-cost-tuningOptimize SerpApi costs by reducing credit consumption and choosing the right plan.
Use when analyzing search usage, reducing monthly costs,
or implementing credit-saving strategies.
Trigger: "serpapi cost", "serpapi pricing", "reduce serpapi costs", "serpapi credits".
/serpapi-debug-bundleCollect SerpApi debug diagnostics: account status, recent searches, and error logs.
Use when troubleshooting SerpApi issues, checking credit usage,
or preparing support tickets.
Trigger: "serpapi debug", "serpapi diagnostic", "serpapi support".
npx claudepluginhub flight505/skill-forge --plugin serpapi-packOther plugins' skills for the same job