Agent skill

Serpapi SDK Patterns

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection.

MITAuto-check passed

Install Serpapi SDK Patterns

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-sdk-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace serpapi-sdk-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/serpapi-sdk-patterns .claude/skills/serpapi-sdk-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
serpapi-sdk-patterns
GitHub stars
2.8k
Token cost
~1.1k tokens
SKILL.md length
377 words
Files
1
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection.

  • Works in 7 steps: Define a request type that admits only… → Define a normalized response type with… → Inject the official client behind a… → …
  • Production code needs a stable search adapter
  • SKILL.md covers Overview, Prerequisites, Tool Discipline and Current Contract, plus 7 more sections
  • Needs SERPAPI_KEY

What it does

Serpapi SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection. Use when production code needs a stable search adapter. Trigger with "design a SerpAPI client wrapper".

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for Claude Code; live client verification requires a separately approved key and allowance

It works with SerpApi, JavaScript and Python. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Production code needs a stable search adapter
  • With design a SerpAPI client wrapper

Example prompts

  • “design a SerpAPI client wrapper”
  • “/serpapi-sdk-patterns”

Requirements

  • Python 3
  • A credential in SERPAPI_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code; live client verification requires a separately approved key and allowance
  • Pre-approved tools (allowed-tools): Read, Glob, Grep, WebFetch, Write, Edit

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Define a request type that admits only supported engines and application-controlled locale, safety, pagination, and output options.
  2. Define a normalized response type with explicit optional sections and vendor metadata isolated from domain data.
  3. Inject the official client behind a small interface so fixtures can replace it without network interception.
  4. Centralize timeouts, bounded retry for transient failures, 429 classification, redaction, and search-ID logging.
  5. For Python, use yield_pages() only with a page/search budget; for JavaScript, implement engine-specific manual pagination from documented…
  6. Select JSON for structured parsing, Markdown for token-efficient agent consumption, HTML only for approved debugging, and json_restrictor…
  7. Add contract tests for empty-success, optional sections, processing/error states, pagination termination, timeout, and redaction.

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • WebFetch
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • serpapi.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SERPAPI_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code; live client verification requires a separately approved key and allowance

    From compatibility in the SKILL.md frontmatter.

Context cost

Serpapi SDK Patterns loads about 1.1k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 377 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 377 words, ~1,050 tokens.

Download SKILL.mdSave it as .claude/skills/serpapi-sdk-patterns/SKILL.md (or your agent's skills folder).
name
serpapi-sdk-patterns
description
Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection. Use when production code needs a stable search adapter. Trigger with "design a SerpAPI client wrapper".
allowed-tools
Read, Glob, Grep, WebFetch, Write, Edit
compatibility
Designed for Claude Code; live client verification requires a separately approved key and allowance
argument-hint
[python|typescript] [engine]
version
1.6.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
saas, serpapi, sdk, architecture, typescript
model
inherit
effort
high

SerpAPI Production Client Patterns

Overview

Create a narrow application-owned gateway instead of spreading vendor parameters, credentials, and variable result schemas through business code.

Prerequisites

  • A selected official client and pinned dependency version
  • Supported engines, required output fields, latency objective, and failure policy
  • Sanitized fixtures for each supported response shape

Tool Discipline

Use Read, Glob, and Grep to map current call sites and types, WebFetch to verify official client interfaces, and Write or Edit for the gateway, schemas, fixtures, and tests.

Current Contract

The Python client returns a SerpResults mapping and provides next_page() and yield_pages(). The JavaScript client exposes promise and callback forms including getJson, getJsonBySearchId, and getAccount, but does not provide built-in pagination. Search output can be JSON, HTML, or Markdown; json_restrictor can reduce JSON payload fields.

Authentication

Inject SERPAPI_KEY at the outer server-side composition root. Do not include it in domain types, cache keys, error objects, telemetry, or serialized request parameters.

Instructions

  1. Define a request type that admits only supported engines and application-controlled locale, safety, pagination, and output options.
  2. Define a normalized response type with explicit optional sections and vendor metadata isolated from domain data.
  3. Inject the official client behind a small interface so fixtures can replace it without network interception.
  4. Centralize timeouts, bounded retry for transient failures, 429 classification, redaction, and search-ID logging.
  5. For Python, use yield_pages() only with a page/search budget; for JavaScript, implement engine-specific manual pagination from documented tokens or offsets.
  6. Select JSON for structured parsing, Markdown for token-efficient agent consumption, HTML only for approved debugging, and json_restrictor when supported fields are known.
  7. Add contract tests for empty-success, optional sections, processing/error states, pagination termination, timeout, and redaction.
Show full SKILL.md (99 more words)Show less

Output

Return request and response types, gateway code, client-version pin, pagination and retry budgets, output-selection rationale, fixture tests, and redaction evidence.

Error Handling

ConditionResponse
Unknown engine or parameterReject locally before making a request.
Python HTTPError or TimeoutErrorMap to a typed application error and preserve safe status/search metadata.
JavaScript rejectionNormalize the status and message without serializing request credentials.
Pagination budget reachedReturn an explicit partial result and continuation state.

Example

typescript
import { getJson } from "serpapi";

export async function searchGoogle(query: string) {
  const result = await getJson({
    engine: "google",
    q: query,
    api_key: process.env.SERPAPI_KEY,
    json_restrictor: "organic_results[].{position,title,link}",
  });
  return (result.organic_results ?? []).map(({ position, title, link }) => ({
    position, title, link,
  }));
}

Resources

Next Steps

Exercise the gateway against sanitized fixtures, then canary one approved live request per supported engine.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/.curated/serpapi-sdk-patterns of jeremylongshore/tons-of-skills-marketplace.

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Serpapi SDK Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Serpapi SDK Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Serpapi SDK Patterns this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.1kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Fory Releaseapache/fory4.6k—~2.9kAutomated safety check: PassApache-2.0
CCXT Crypto Exchange Library2025Emma/vibe-coding-cn23k1 repos~4.4kAutomated safety check: PassMIT
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0
CodeQL Security Scantrailofbits/skills7.4k—~4.6kAutomated safety check: NotesCC-BY-SA-4.0

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Fory Release

    apache/fory

    Prepare an Apache Fory release candidate from a clean release branch, including the version bump, RC tag, JVM staging, ASF source artifacts, SVN upload, and vote email.

    4.6k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • CCXT Crypto Exchange Library

    2025Emma/vibe-coding-cn

    Reference help for the CCXT library covering crypto exchange APIs, market data, trading and order management across 150+ exchanges in JavaScript, Python and PHP.

    23k GitHub starsUsed in 1 repo~4.4k tokens
    Business, Finance & HRAuto-check passed
  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • CodeQL Security Scan

    trailofbits/skills

    Official

    Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.

    7.4k GitHub stars~4.6k tokensUpdated yesterday
    SecurityAuto-check: notes
  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.4k GitHub stars~5k tokensUpdated today
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Serpapi SDK Patterns

What does Serpapi SDK Patterns do?

Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection. Serpapi SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Wrap the official SerpAPI Python or JavaScript client behind typed, testable boundaries with safe errors, pagination, and output selection.

When should I use Serpapi SDK Patterns?

Serpapi SDK Patterns fits situations like: production code needs a stable search adapter; with design a SerpAPI client wrapper.

How do I install Serpapi SDK Patterns in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-sdk-patterns -a claude-code`. Or copy the skill folder (skills/.curated/serpapi-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/serpapi-sdk-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Serpapi SDK Patterns in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-sdk-patterns -a codex`. Or copy the skill folder (skills/.curated/serpapi-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/serpapi-sdk-patterns in your project. Codex loads it when a task matches its description.

Can I use Serpapi SDK Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-sdk-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/serpapi-sdk-patterns, .gemini/skills/serpapi-sdk-patterns, .github/skills/serpapi-sdk-patterns and .opencode/skills/serpapi-sdk-patterns in your project.

What does Serpapi SDK Patterns need to run?

Going by SKILL.md and its folder, Serpapi SDK Patterns needs credentials named SERPAPI_KEY. Our summary lists: Python 3; A credential in SERPAPI_KEY. Its frontmatter pre-approves these tools: Read, Glob, Grep, WebFetch, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code; live client verification requires a separately approved key and allowance.

Does Serpapi SDK Patterns access the network?

SKILL.md names 2 domains. As links in the text: github.com and serpapi.com. This is read from the text; nothing was executed.

Is Serpapi SDK Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Serpapi SDK Patterns use?

Serpapi SDK Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Serpapi SDK Patterns use?

About 1.1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Serpapi SDK Patterns?

Skills that share tags, products or a category with Serpapi SDK Patterns: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Fory Release (apache/fory, 4.6k stars), CCXT Crypto Exchange Library (2025Emma/vibe-coding-cn, 23k stars) and Gemini API Dev (google-gemini/gemini-skills, 4.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Serpapi SDK Patterns?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.