Skip to content
Skillv1.0.0

serpapi-deploy-integration

Deploy SerpApi-powered search features to production platforms. Use when deploying search APIs, configuring backend proxies, or setting up SerpApi in serverless environments. Trigger: "deploy serpapi"

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (plugins/saas-packs/serpapi-pack/skills/serpapi-deploy-integration/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill serpapi-deploy-integration. Copyright stays with the author (MIT).

SerpApi Deploy Integration

Overview

Deploy SerpApi-powered search as a backend API endpoint. Always proxy through your server -- never expose the API key to browsers.

Instructions

Vercel Serverless Function

// api/search.ts
import { getJson } from 'serpapi';

export default async function handler(req: Request) {
  const url = new URL(req.url);
  const q = url.searchParams.get('q');
  if (!q) return new Response('Missing q parameter', { status: 400 });

  const engine = url.searchParams.get('engine') || 'google';
  const num = parseInt(url.searchParams.get('num') || '5');

  const result = await getJson({
    engine, q, num,
    api_key: process.env.SERPAPI_API_KEY,
  });

  return Response.json({
    results: result.organic_results?.slice(0, num) || [],
    answer_box: result.answer_box || null,
    total_results: result.search_information?.total_results,
  });
}
vercel env add SERPAPI_API_KEY production
vercel --prod

Cloud Run with Python

# main.py
from flask import Flask, request, jsonify
import serpapi, os

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

@app.route("/search")
def search():
    q = request.args.get("q")
    if not q:
        return jsonify({"error": "Missing q parameter"}), 400

    result = client.search(engine="google", q=q, num=5)
    return jsonify({
        "results": result.get("organic_results", [])[:5],
        "answer_box": result.get("answer_box"),
    })
gcloud run deploy search-api \
  --source . --region us-central1 \
  --set-secrets=SERPAPI_API_KEY=serpapi-key:latest \
  --allow-unauthenticated

Health Check

app.get('/health', async (req, res) => {
  const account = await fetch(
    `https://serpapi.com/account.json?api_key=${process.env.SERPAPI_API_KEY}`
  ).then(r => r.json());

  res.json({
    status: account.plan_searches_left > 0 ? 'healthy' : 'credits_exhausted',
    remaining: account.plan_searches_left,
  });
});

Error Handling

Issue Cause Solution
Cold start slow First request initializes Pre-warm with min instances
Credits run out No budget monitoring Add health check with credit count
Key exposed Frontend calling SerpApi directly Always proxy through backend

Resources

Next Steps

For webhook-like patterns, see serpapi-webhooks-events.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-serpapi-deplo-2dc155/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-serpapi-deplo-2dc155.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-serpapi-deplo-2dc155",
  "kind": "skill",
  "name": "serpapi-deploy-integration",
  "description": "Deploy SerpApi-powered search features to production platforms. Use when deploying search APIs, configuring backend proxies, or setting up SerpApi in serverless environments. Trigger: \"deploy serpapi\", \"serpapi Vercel\", \"serpapi production deploy\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "search",
      "seo",
      "serpapi",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Deploy SerpApi-powered search features to production platforms. Use when deploying search APIs, configuring backend proxies, or setting up SerpApi in serverless environments. Trigger: \"deploy serpapi\", \"serpapi Vercel\", \"serpapi production deploy\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/serpapi-pack/skills/serpapi-deploy-integration/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/serpapi-pack/skills/serpapi-deploy-integration/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/serpapi-pack/skills/serpapi-deploy-integration/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(vercel:*),",
      "Bash(fly:*),",
      "Bash(gcloud:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# SerpApi Deploy Integration\n\n## Overview\n\nDeploy SerpApi-powered search as a backend API endpoint. Always proxy through your server -- never expose the API key to browsers.\n\n## Instructions\n\n### Vercel Serverless Function\n\n```typescript\n// api/search.ts\nimport { getJson } from 'serpapi';\n\nexport default async function handler(req: Request) {\n  const url = new URL(req.url);\n  const q = url.searchParams.get('q');\n  if (!q) return new Response('Missing q parameter', { status: 400 });\n\n  const engine = url.searchParams.get('engine') || 'google';\n  const num = parseInt(url.searchParams.get('num') ",
  "cost": {
    "context_tokens": 635
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-serpapi-deplo-2dc155/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.