Skip to content
Back to skills

Serpapi Security Basics

BSecurity

Secure SerpApi API keys and prevent credit abuse. Use when storing API keys, implementing backend proxies, or auditing SerpApi access patterns. Trigger: "serpapi security", "serpapi API key security", "secure serpapi".

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 12, 2026
developmenttypescriptgobashexpressgitapifrontendbackendsecurity

Works with

  • api

Security analysis

B88/100
  • criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill serpapi-security-basics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Serpapi Security Basics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Serpapi Security Basics
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-serpapi-security-basics/badge)](https://www.skillsdirectory.com/skills/aibot88-serpapi-security-basics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: serpapi-security-basics
description: |
  Secure SerpApi API keys and prevent credit abuse.
  Use when storing API keys, implementing backend proxies,
  or auditing SerpApi access patterns.
  Trigger: "serpapi security", "serpapi API key security", "secure serpapi".
allowed-tools: Read, Write, Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags: [saas, search, seo, serpapi]
compatible-with: claude-code
---

# SerpApi Security Basics

## Overview

SerpApi uses a single API key for authentication. The key grants full account access -- there are no scoped keys or OAuth. Protect it like a credit card: never expose in frontend code, always proxy through your backend.

## Instructions

### Step 1: Never Expose API Key in Frontend

```typescript
// BAD: API key in browser-side code
const result = await fetch(`https://serpapi.com/search.json?q=${query}&api_key=YOUR_KEY`);

// GOOD: Proxy through your backend
// Frontend
const result = await fetch(`/api/search?q=${encodeURIComponent(query)}`);

// Backend (api/search.ts)
export async function GET(req: Request) {
  const url = new URL(req.url);
  const q = url.searchParams.get('q');
  const result = await getJson({
    engine: 'google', q,
    api_key: process.env.SERPAPI_API_KEY, // Server-side only
  });
  return Response.json(result.organic_results);
}
```

### Step 2: Secure Storage

```bash
# .gitignore
.env
.env.local

# Use platform secret managers in production
gh secret set SERPAPI_API_KEY       # GitHub Actions
vercel env add SERPAPI_API_KEY      # Vercel
fly secrets set SERPAPI_API_KEY=x   # Fly.io
```

### Step 3: Rate Limit Your Proxy

```typescript
// Prevent abuse of your search proxy endpoint
import rateLimit from 'express-rate-limit';

const searchLimiter = rateLimit({
  windowMs: 60_000,    // 1 minute
  max: 10,             // 10 searches per minute per IP
  message: 'Too many searches, try again later',
});

app.get('/api/search', searchLimiter, searchHandler);
```

### Step 4: Monitor Usage

```bash
# Set up daily usage check
curl -s "https://serpapi.com/account.json?api_key=$SERPAPI_API_KEY" \
  | jq '{used: .this_month_usage, remaining: .plan_searches_left}'

# Alert if usage is unexpectedly high
```

## Security Checklist

- [ ] API key in environment variables only
- [ ] `.env` in `.gitignore`
- [ ] Backend proxy for all search requests
- [ ] Rate limiting on proxy endpoints
- [ ] Usage monitoring and alerts
- [ ] Separate keys for dev/prod (if available)

## Resources

- [SerpApi Dashboard](https://serpapi.com/dashboard)
- [Manage API Key](https://serpapi.com/manage-api-key)

## Next Steps

For production deployment, see `serpapi-prod-checklist`.

Files in this skill

  • SKILL.md2.6 KB
  • source.json774 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.