agentsclimarketplace

Serpapi hello world

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/serpapi-pack/skills/serpapi-hello-world

'Run your first SerpApi search -- Google, Bing, or YouTube results as JSON.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill serpapi-hello-world

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.6 KB, 813 tokens by cl100k_base, as published. Nobody here has run it

SerpApi Hello World

Overview

Run a Google search via SerpApi and parse the structured JSON response. SerpApi returns organic results, knowledge graph, answer boxes, ads, local results, and more -- all as structured data. Key parameter: engine (google, bing, youtube, etc.).

Prerequisites

  • serpapi package installed (see serpapi-install-auth)
  • SERPAPI_API_KEY environment variable set

Instructions

Step 1: Basic Google Search (Python)

import serpapi
import os

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

result = client.search(
    engine="google",
    q="best programming languages 2025",
    location="Austin, Texas",
    hl="en",
    gl="us",
    num=5,  # Number of results
)

# Organic results
for r in result["organic_results"]:
    print(f"{r['position']}. {r['title']}")
    print(f"   {r['link']}")
    print(f"   {r.get('snippet', 'No snippet')}\n")

# Answer box (if present)
if "answer_box" in result:
    print(f"Answer Box: {result['answer_box'].get('answer', result['answer_box'].get('snippet'))}")

Step 2: Google Search (Node.js)

import { getJson } from 'serpapi';

const result = await getJson({
  engine: 'google',
  q: 'best programming languages 2025',
  location: 'Austin, Texas',
  hl: 'en',
  gl: 'us',
  num: 5,
  api_key: process.env.SERPAPI_API_KEY,
});

result.organic_results.forEach((r: any) => {
  console.log(`${r.position}. ${r.title}`);
  console.log(`   ${r.link}`);
});

// Knowledge graph
if (result.knowledge_graph) {
  console.log(`\nKnowledge Graph: ${result.knowledge_graph.title}`);
}

Step 3: Try Different Engines

# Bing search
bing = client.search(engine="bing", q="Claude AI", count=5)
for r in bing["organic_results"]:
    print(f"Bing: {r['title']}")

# YouTube search
youtube = client.search(engine="youtube", search_query="python tutorial")
for v in youtube["video_results"]:
    print(f"YouTube: {v['title']} ({v['length']})")

# Google News
news = client.search(engine="google_news", q="artificial intelligence")
for n in news["news_results"]:
    print(f"News: {n['title']} - {n['source']['name']}")

Output

1. Python - Best programming language for beginners
   https://example.com/python
   Python remains the top choice...

2. JavaScript - Most versatile language
   https://example.com/js
   JavaScript dominates web development...

Knowledge Graph: Programming languages

Error Handling

ErrorCauseSolution
Invalid API keyWrong keyCheck serpapi.com/manage-api-key
No organic_results keyDifferent result structureCheck search_metadata.status first
Your searches for the month have run outPlan limit reachedUpgrade at serpapi.com/pricing
Empty resultsUnusual query or locationTry without location parameter

Resources

Next Steps

Proceed to serpapi-local-dev-loop for development workflow setup.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.