Skip to content
Skillv1.0.0

serpapi-rate-limits

Handle SerpApi rate limits and credit-based usage quotas. Use when managing API credit consumption, implementing request throttling, or optimizing search volume for your plan tier. Trigger: "serpapi r

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (plugins/saas-packs/serpapi-pack/skills/serpapi-rate-limits/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-rate-limits. Copyright stays with the author (MIT).

SerpApi Rate Limits

Overview

SerpApi uses credit-based pricing (each search = 1 credit) plus per-second rate limits. Retrieving cached/archived searches does not consume credits. Plans range from 100 searches/month (free) to unlimited (enterprise).

Plan Limits

Plan Searches/Month Rate Limit Price
Free 100 1/second $0
Developer 5,000 5/second $75/mo
Business 15,000 10/second $200/mo
Enterprise 50,000+ 15/second Custom

Instructions

Step 1: Monitor Credit Usage

import serpapi, os

client = serpapi.Client(api_key=os.environ["SERPAPI_API_KEY"])

# Check remaining credits before batch operations
account = client.account()
remaining = account["plan_searches_left"]
used = account["this_month_usage"]
total = account["total_searches_left"]

print(f"Used: {used}, Remaining: {remaining}")
if remaining < 100:
    print("WARNING: Low credits remaining")

Step 2: Request Throttling

import time
from threading import Semaphore

class ThrottledSerpApi:
    def __init__(self, api_key: str, max_per_second: int = 5):
        self.client = serpapi.Client(api_key=api_key)
        self.semaphore = Semaphore(max_per_second)
        self.last_request = 0

    def search(self, **params) -> dict:
        with self.semaphore:
            # Enforce minimum interval
            elapsed = time.time() - self.last_request
            if elapsed < 0.2:  # 5/sec max
                time.sleep(0.2 - elapsed)
            self.last_request = time.time()
            return self.client.search(**params)

Step 3: Use Archive to Avoid Credit Waste

# Retrieve a previous search result by ID (FREE, no credit charge)
archived = client.search(engine="google", search_id="previous_search_id")

# Check if a query was recently searched before spending a credit
# Store search IDs in your database keyed by query+params hash

Step 4: Node.js Rate Limiter

import PQueue from 'p-queue';
import { getJson } from 'serpapi';

const queue = new PQueue({
  concurrency: 3,       // Max parallel requests
  interval: 1000,       // Per second
  intervalCap: 5,       // Max 5 per second
});

async function throttledSearch(params: Record<string, any>) {
  return queue.add(() => getJson({
    ...params,
    api_key: process.env.SERPAPI_API_KEY,
  }));
}

// Batch search with automatic throttling
const queries = ['query1', 'query2', 'query3'];
const results = await Promise.all(
  queries.map(q => throttledSearch({ engine: 'google', q }))
);

Error Handling

Error Cause Solution
429 Too Many Requests Rate limit exceeded Slow down, check plan tier
Searches exhausted Monthly credits used up Cache results, upgrade plan
Account disabled Payment issue or abuse Contact SerpApi support

Resources

Next Steps

For security configuration, see serpapi-security-basics.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-serpapi-rate-limits/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-serpapi-rate-limits.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-serpapi-rate-limits",
  "kind": "skill",
  "name": "serpapi-rate-limits",
  "description": "Handle SerpApi rate limits and credit-based usage quotas. Use when managing API credit consumption, implementing request throttling, or optimizing search volume for your plan tier. Trigger: \"serpapi rate limit\", \"serpapi credits\", \"serpapi quota\", \"serpapi throttle\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "finance",
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "search",
      "seo",
      "serpapi",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Handle SerpApi rate limits and credit-based usage quotas. Use when managing API credit consumption, implementing request throttling, or optimizing search volume for your plan tier. Trigger: \"serpapi rate limit\", \"serpapi credits\", \"serpapi quota\", \"serpapi throttle\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/serpapi-pack/skills/serpapi-rate-limits/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/serpapi-pack/skills/serpapi-rate-limits/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/serpapi-pack/skills/serpapi-rate-limits/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit"
    ],
    "license": "MIT"
  },
  "instructions": "# SerpApi Rate Limits\n\n## Overview\n\nSerpApi uses credit-based pricing (each search = 1 credit) plus per-second rate limits. Retrieving cached/archived searches does not consume credits. Plans range from 100 searches/month (free) to unlimited (enterprise).\n\n## Plan Limits\n\n| Plan | Searches/Month | Rate Limit | Price |\n|------|---------------|------------|-------|\n| Free | 100 | 1/second | $0 |\n| Developer | 5,000 | 5/second | $75/mo |\n| Business | 15,000 | 10/second | $200/mo |\n| Enterprise | 50,000+ | 15/second | Custom |\n\n## Instructions\n\n### Step 1: Monitor Credit Usage\n\n```python\nimport se",
  "cost": {
    "context_tokens": 791
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-serpapi-rate-limits/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.