serpapi

serpapi is a skill for Claude Code, Codex from nicepkg/ai-workflow. It costs 31 tokens per session (1,606 once invoked), scanned A, original, MIT.

A tool for retrieving search-engine results through the SerpApi service. It can query services such as Google, Bing, YouTube, and Google Maps when an API key is configured.

In plain words
What is it for?
Collecting web, image, news, video, shopping, local, or YouTube search results and monitoring search rankings.
Why use it?
It provides search-result data for scripts and analysis without manually opening each search page. It can also support ranking checks and other repeatable searches.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nicepkg/ai-workflow/serpapi
Any agent
npx skills add nicepkg/ai-workflow --skill serpapi
Clone the repo
git clone --depth 1 https://github.com/nicepkg/ai-workflow

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for serpapi

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicepkg/ai-workflow/serpapi.svg)](https://agentmods.dev/skills/nicepkg/ai-workflow/serpapi)
Your own site
<a href="https://agentmods.dev/skills/nicepkg/ai-workflow/serpapi"><img src="https://agentmods.dev/badge/skills/nicepkg/ai-workflow/serpapi.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,606 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.01606
Opus 5 $0.00015 $0.00803
Sonnet 5 $0.00006 $0.00321
Haiku 4.5 $0.00003 $0.00161

Measured yesterday against content hash f7ddf157c0d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serpapi scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

description: SerpApi search engine results API via curl. Use this skill to scrape Google, Bing, YouTube, and other search engines.
workflows/video-creator-workflow/.claude/skills/serpapi/SKILL.md · 199 lines

How it starts

The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SerpApi

Use SerpApi via direct curl calls to scrape search engine results from Google, Bing, YouTube, and more.

Official docs: https://serpapi.com/search-api


When to Use

Use this skill when you need to:

  • Scrape Google search results (organic, ads, knowledge graph)
  • Search Google Images, News, Videos, Shopping
  • Get local business results from Google Maps
  • Scrape other search engines (Bing, YouTube, DuckDuckGo, etc.)
  • Monitor SERP rankings for SEO analysis

Prerequisites

  1. Sign up at SerpApi
  2. Go to Dashboard and copy your API key
  3. Store it in the environment variable SERPAPI_API_KEY
export SERPAPI_API_KEY="your-api-key"

Pricing

  • Free tier: 100 searches/month
  • API key is passed as a query parameter api_key

Important: When using $VAR in a command that pipes to another command, wrap the command containing $VAR in bash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.

bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'

How to Use

All examples below assume you have SERPAPI_API_KEY set.

Base URL: https://serpapi.com/search


1. Basic Google Search

Search Google and get structured JSON results:

bash -c 'curl -s "https://serpapi.com/search?engine=google&q=artificial+intelligence&api_key=${SERPAPI_API_KEY}"' | jq '.organic_results[:3] | .[] | {title, link, snippet}

2. Search with Location

Search from a specific location:

bash -c 'curl -s "https://serpapi.com/search?engine=google&q=best+coffee+shops&location=San+Francisco,+California&gl=us&hl=en&api_key=${SERPAPI_API_KEY}"' | jq '.organic_results[:3]'

Parameters:

  • location: City, state, or address
  • gl: Country code (us, uk, de, etc.)
  • hl: Language code (en, de, fr, etc.)

3. Google Image Search

Search for images:

bash -c 'curl -s "https://serpapi.com/search?engine=google_images&q=sunset+beach&api_key=${SERPAPI_API_KEY}"' | jq '.images_results[:3] | .[] | {title, original, thumbnail}

Read the full file on GitHub · 199 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 199 lines · 31 tokens per session scan A f7ddf157c0d1

Subscribe to this mod's changes

serpapi is a skill published in the GitHub repository nicepkg/ai-workflow (282 stars, last pushed 7mo ago), licensed MIT. It adds 31 tokens to every session and 1,606 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.