/serpapi-pack:serpapi-reference-architecturefrom serpapi-pack
Production architecture for SerpApi search services with caching, monitoring, and multi-engine support. Use when designing search features, building SERP tracking systems, or architecting search-powered applications.
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.
Production architecture for search-powered applications using SerpApi. Core components: cached search service, multi-engine abstraction, SERP monitoring pipeline, and credit budget management.
┌──────────────────────────────────┐
│ API Layer │
│ /search /track /health │
├──────────────────────────────────┤
│ Search Service │
│ Multi-engine Caching Parsing │
├──────────────────────────────────┤
│ SerpApi Client │
│ Rate Limiting Retry Archive │
├──────────────────────────────────┤
│ Infrastructure │
│ Redis Cache PostgreSQL Cron │
└──────────────────────────────────┘
│
▼
┌──────────────────────────────────┐
│ SerpApi REST API │
│ google youtube bing news │
│ 1 credit/search, 100-50K/mo │
└──────────────────────────────────┘
search-service/
├── src/
│ ├── serpapi/
│ │ ├── client.ts # Cached search with rate limiting
│ │ ├── engines.ts # Engine-specific param mapping
│ │ └── types.ts # Typed result interfaces
│ ├── services/
│ │ ├── search.ts # Multi-engine search facade
│ │ ├── tracking.ts # Keyword rank tracking
│ │ └── credits.ts # Usage monitoring
│ ├── api/
│ │ ├── search.ts # /search proxy endpoint
│ │ └── health.ts # /health with credit check
│ └── jobs/
│ └── rank-tracker.ts # Daily keyword monitoring
├── tests/
│ ├── fixtures/ # Recorded SerpApi responses
│ └── search.test.ts # Fixture-based tests
└── config/
class SearchService {
constructor(private client: CachedSerpApiClient, private db: Database) {}
async search(query: string, options?: { engine?: string; num?: number }) {
const engine = options?.engine || 'google';
const result = await this.client.cachedSearch({
engine, q: query, num: options?.num || 5,
});
// Normalize across engines
return {
results: result.organic_results || result.video_results || [],
answer_box: result.answer_box || null,
knowledge_graph: result.knowledge_graph || null,
search_id: result.search_metadata.id,
cached: result._cached || false,
};
}
async trackKeyword(keyword: string, domain: string) {
const result = await this.client.cachedSearch({
engine: 'google', q: keyword, num: 100,
});
const position = result.organic_results?.findIndex(
(r: any) => r.link?.includes(domain)
);
await this.db.saveRanking(keyword, domain, position >= 0 ? position + 1 : null);
}
}
class CreditBudget {
async check(): Promise<{ ok: boolean; remaining: number }> {
const account = await fetch(
`https://serpapi.com/account.json?api_key=${process.env.SERPAPI_API_KEY}`
).then(r => r.json());
return {
ok: account.plan_searches_left > 100,
remaining: account.plan_searches_left,
};
}
}
| Component | Failure | Recovery |
|---|---|---|
| Search API | Credits exhausted | Return cached results, alert ops |
| Cache | Redis down | Fall through to API (graceful degradation) |
| Rank tracker | Query fails | Skip and retry next cycle |
| Health check | API unreachable | Report degraded status |
See individual skill docs for deep-dives on each component.
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