Optimize 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".
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Optimize 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".
allowed-tools
Read, Grep
version
1.4.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","search","seo","serpapi"]
compatibility
Designed for Claude Code
SerpApi Cost Tuning
Overview
SerpApi charges per search (1 credit each). Plans: Free (100/mo), Developer ($75, 5K/mo), Business ($200, 15K/mo), Enterprise (custom). Key savings: caching, archive retrieval (free), and Google Light API.
Cost Strategies
Strategy 1: Aggressive Caching (Biggest Savings)
# Search results rarely change within an hour# Cache for 1 hour = up to 24x credit reduction for hourly queries# Cache for 1 day = up to 720x for queries checked every 2 minutesimport hashlib, json, redis, serpapi, os
r = redis.Redis.from_url(os.environ["REDIS_URL"])
client = serpapi.Client(api_key=os.environ["SERPAPI_API_KEY"])
defcached_search(ttl_seconds=3600, **params):
key = f"serpapi:{hashlib.md5(json.dumps(params, sort_keys=True).encode()).hexdigest()}"
cached = r.get(key)
if cached:
return json.loads(cached) # FREE: no credit consumed
result = client.search(**params) # 1 credit
r.setex(key, ttl_seconds, json.dumps(dict(result)))
return result
Strategy 2: Archive API (Free Retrieval)
# Every search result is stored in the archive# Retrieve by search_id at no cost
archived = client.search(engine="google", search_id="previous_id")
# 0 credits -- use for re-processing or delayed access
Strategy 3: Google Light API (Same Cost, Faster)
# Same 1 credit but faster response (~1s vs 3-5s)# Good for: organic results only, no knowledge graph needed
result = client.search(engine="google_light", q="query")
Strategy 4: Reduce num Parameter
# Default num=10 (10 results). If you only need top 3:
result = client.search(engine="google", q="query", num=3)
# Still 1 credit, but faster response