AGENT SKILL

serp-api-pro

Using search-engine results APIs — query design, parsing results, and cost control — vendor-neutral patterns.

License 许可
MIT
所属仓库
TanNhatCMS/jarvis
最近更新
2026-11-07
Stars
★ 0
Forks
1

01 前言 Front Matter

name
serp-api-pro
category
web-data
description
Using search-engine results APIs — query design, parsing results, and cost control — vendor-neutral patterns.

03 SKILL.md 正文

Overview

SERP APIs return structured search-engine results (organic results, knowledge panels, ads, local packs, image/video results) as JSON — the foundation for rank tracking, competitive research, market monitoring, and research pipelines. This skill covers designing queries, parsing the varied result shapes, and keeping usage affordable and compliant.

When to use

  • Tracking keyword rankings across locations and devices
  • Building competitive/market intelligence from search results
  • Gathering structured web data via search (rather than crawling directly)
  • Designing queries for local, image, news, or shopping verticals
  • Controlling cost on pay-per-search API usage

Core concepts

SERP structure varies by query. The same API returns different shapes: organic results always, plus knowledge panels, featured snippets, local packs, shopping carousels, video results, "people also ask" — depending on the query and locale. Parse defensively: every optional block may be absent, and Google reshuffles layouts regularly. Version your parsers.

Query parameters are the targeting. q (query), location (geo — city/region/postal), hl/gl (interface language/country), device (desktop/mobile/tablet), and sometimes time filters. Local-intent queries without a location return generic results; always set geo explicitly for rank tracking — "near me" means nothing without coordinates.

One query ≠ one data point. A single search returns a page of mixed result types; decide what you extract (top-10 organic? full feature set?) and store raw responses alongside parsed data — when the parser breaks on a layout change, raw JSON lets you re-parse history.

Rate and cost discipline. SERP APIs charge per search; costs scale with (keyword count × locations × devices × frequency). Reduce spend: track fewer, higher-value keywords; stagger frequencies by importance (daily for money keywords, weekly for the rest); dedupe location variants; cache results within their freshness window.

Compliance and ToS. Use official SERP API providers rather than scraping search engines directly (which violates their ToS and triggers blocks). Respect data usage terms — ranking data for your own analytics is the standard use; republishing scraped result content has copyright implications.

Practical workflow

  1. Define the measurement: keywords, locations, devices, frequency — driven by the decision the data supports (not "track everything").
  2. Build the query matrix programmatically: keyword × location × device combos, with parameter validation (bad geo codes silently return wrong results — verify with spot checks).
  3. Parse defensively: extract the blocks you need with fallbacks for missing ones; store raw JSON for reprocessing; alert on parse-rate drops (layout change signal).
  4. Store time-series properly: (keyword, location, device, date) → ranks/URLs/features; compute rank changes, visibility scores, and feature-ownership trends from this table.
  5. Monitor quality: spot-check results against manual searches periodically; watch for provider-side anomalies (empty results, location mismatches, sudden format changes).
  6. Review cost monthly: spend per keyword-set, frequency tuning opportunities, and whether the insights still justify the tracking list.

Common pitfalls

  • No location set — "rankings" without geo are meaningless for local-intent queries; always specify.
  • Brittle parsers — assuming the knowledge panel is always present or organic results always 10; SERP layouts shift constantly.
  • Over-tracking — 10k keywords daily when decisions need 200 weekly; cost follows query count directly.
  • Ignoring device splits — mobile and desktop SERPs differ substantially; track the device your audience uses.
  • No raw-response retention — parser bug discovered a month later with no way to re-extract; keep raw JSON for your retention window.
  • Scraping Google directly to avoid API fees — ToS violation, IP bans, and legal exposure; the API exists precisely to avoid this.

04 同仓库更多 Skills

TanNhatCMS
TanNhatCMS/jarvis

web-scrape

Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.

★ 0
TanNhatCMS
TanNhatCMS/jarvis

design-taste-frontend

tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.

★ 0
TanNhatCMS
TanNhatCMS/jarvis

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code

★ 0
TanNhatCMS
TanNhatCMS/jarvis

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

★ 0
TanNhatCMS
TanNhatCMS/jarvis

requesting-code-review

Use when completing tasks, implementing major features, or before merging to verify work meets requirements

★ 0
TanNhatCMS
TanNhatCMS/jarvis

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

★ 0