/serpapi-pack:serpapi-sdk-patterns [python|typescript] [engine]from serpapi-pack
Wraps the official SerpAPI Python/JS client with typed request/response types, safe errors, pagination, and output selection. Useful when production code needs a stable, testable search adapter.
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.
Create a narrow application-owned gateway instead of spreading vendor parameters, credentials, and variable result schemas through business code.
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.
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.
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.
yield_pages() only with a page/search budget; for JavaScript, implement engine-specific manual pagination from documented tokens or offsets.json_restrictor when supported fields are known.Return request and response types, gateway code, client-version pin, pagination and retry budgets, output-selection rationale, fixture tests, and redaction evidence.
| Condition | Response |
|---|---|
| Unknown engine or parameter | Reject locally before making a request. |
Python HTTPError or TimeoutError | Map to a typed application error and preserve safe status/search metadata. |
| JavaScript rejection | Normalize the status and message without serializing request credentials. |
| Pagination budget reached | Return an explicit partial result and continuation state. |
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,
}));
}
Exercise the gateway against sanitized fixtures, then canary one approved live request per supported engine.
What SKILL.md sets; muted values are Claude Code's defaults
inherithighThree short reads, in order
18 skills in this plugin
/serpapi-ci-integrationGate SerpAPI code with sanitized fixtures and isolate optional live searches behind trusted CI environments and allowance controls. Use when adding integration tests to automation. Trigger with "add SerpAPI CI"./serpapi-common-errorsClassify SerpAPI HTTP failures, search-status failures, and valid empty results before choosing a retry or repair. Use when searches fail, stall, or return unexpected shapes. Trigger with "diagnose a SerpAPI error"./serpapi-core-workflow-aBuild a reproducible Google Search workflow that validates parameters, optional result sections, and bounded pagination. Use when implementing search, SEO monitoring, or evidence collection. Trigger with "build a SerpAPI Google workflow".npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin serpapi-packOther plugins' skills for the same job