Skill: Serpshot Google Search API
Perform Google searches using Serpshot API.
When to Use
- User asks to "search", "google", "查一下", "调研" something
- Need to get web search results for a topic
- Need image search results
Tools
exec - Run Python to call Serpshot API
How to Use
Basic Search
import requests
import json
import os
# Get API key - YOU MUST ASK USER FOR API KEY
api_key = os.environ.get("SERPSHOT_API_KEY", "YOUR_API_KEY")
url = "https://api.serpshot.com/api/search/google"
headers = {
"X-API-Key": api_key,
"Content-Type": "application/json"
}
payload = {
"queries": ["your search query here"],
"type": "search", # or "image"
"num": 10, # results per page (1-100)
"page": 1,
"location": "US", # US, CN, JP, GB, DE, etc.
"lr": "en", # language restriction
"gl": "us" # geolocation
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
# Parse results
for result in data.get("data", {}).get("results", []):
print(f"{result['position']}. {result['title']}")
print(f" {result['link']}")
print(f" {result['snippet']}")
print()
Parameters
| Parameter |
Type |
Required |
Description |
| queries |
array[string] |
Yes |
Search queries (max 100) |
| type |
string |
No |
"search" or "image", default: "search" |
| num |
integer |
No |
Results per page (1-100), default: 10 |
| page |
integer |
No |
Page number, default: 1 |
| location |
string |
No |
Country code (US, CN, JP, GB, DE, etc.), default: US |
| lr |
string |
No |
Language restriction (en, zh-Hans, etc.), default: en |
| gl |
string |
No |
Geolocation (us, cn, etc.), default: us |
Response Format
{
"code": 200,
"msg": "Success",
"data": {
"results": [
{
"title": "Result Title",
"link": "https://example.com",
"snippet": "Result description...",
"position": 1
}
],
"total_results": "About 12,300,000 results",
"search_time": 0.45,
"credits_used": 1
}
}
Example Tasks
Task 1: Search for AI news
queries: ["AI news 2026"]
location: "US"
num: 5
Task 2: Search Chinese results
queries: ["人工智能 最新消息"]
location: "CN"
lr: "zh-Hans"
gl: "cn"
num: 10
Task 3: Image search
queries: ["cute cats"]
type: "image"
num: 10
Important Notes
- API Key Required: You MUST ask the user for their Serpshot API key before using this skill
- Credits: Each search uses credits (check with /api/credit/available-credits)
- Rate Limit: Contact Serpshot for rate limits
- Locations: Available locations include US, CN, JP, GB, DE, CA, FR, ID, MX, SG, etc.
Error Handling
Common error codes:
- 400: Bad request (invalid parameters)
- 401: Invalid API key
- 402: Insufficient credits
- 429: Rate limit exceeded
Check data["code"] and data["msg"] in response.
1---2name: serpshot3description: Use Serpshot Google Search API to perform web searches and image searches. Use when user needs to search Google for information, research topics, or get search results. Supports up to 100 queries per request, various locations and languages.4---56# Skill: Serpshot Google Search API78Perform Google searches using Serpshot API.910## When to Use1112- User asks to "search", "google", "查一下", "调研" something13- Need to get web search results for a topic14- Need image search results1516## Tools1718- `exec` - Run Python to call Serpshot API1920## How to Use2122### Basic Search2324```python25import requests26import json27import os2829# Get API key - YOU MUST ASK USER FOR API KEY30api_key = os.environ.get("SERPSHOT_API_KEY", "YOUR_API_KEY")3132url = "https://api.serpshot.com/api/search/google"3334headers = {35 "X-API-Key": api_key,36 "Content-Type": "application/json"37}3839payload = {40 "queries": ["your search query here"],41 "type": "search", # or "image"42 "num": 10, # results per page (1-100)43 "page": 1,44 "location": "US", # US, CN, JP, GB, DE, etc.45 "lr": "en", # language restriction46 "gl": "us" # geolocation47}4849response = requests.post(url, headers=headers, json=payload)50data = response.json()5152# Parse results53for result in data.get("data", {}).get("results", []):54 print(f"{result['position']}. {result['title']}")55 print(f" {result['link']}")56 print(f" {result['snippet']}")57 print()58```5960### Parameters6162| Parameter | Type | Required | Description |63|-----------|------|----------|-------------|64| queries | array[string] | Yes | Search queries (max 100) |65| type | string | No | "search" or "image", default: "search" |66| num | integer | No | Results per page (1-100), default: 10 |67| page | integer | No | Page number, default: 1 |68| location | string | No | Country code (US, CN, JP, GB, DE, etc.), default: US |69| lr | string | No | Language restriction (en, zh-Hans, etc.), default: en |70| gl | string | No | Geolocation (us, cn, etc.), default: us |7172### Response Format7374```json75{76 "code": 200,77 "msg": "Success",78 "data": {79 "results": [80 {81 "title": "Result Title",82 "link": "https://example.com",83 "snippet": "Result description...",84 "position": 185 }86 ],87 "total_results": "About 12,300,000 results",88 "search_time": 0.45,89 "credits_used": 190 }91}92```9394## Example Tasks9596### Task 1: Search for AI news97```98queries: ["AI news 2026"]99location: "US"100num: 5101```102103### Task 2: Search Chinese results104```105queries: ["人工智能 最新消息"]106location: "CN"107lr: "zh-Hans"108gl: "cn"109num: 10110```111112### Task 3: Image search113```114queries: ["cute cats"]115type: "image"116num: 10117```118119## Important Notes1201211. **API Key Required**: You MUST ask the user for their Serpshot API key before using this skill1222. **Credits**: Each search uses credits (check with /api/credit/available-credits)1233. **Rate Limit**: Contact Serpshot for rate limits1244. **Locations**: Available locations include US, CN, JP, GB, DE, CA, FR, ID, MX, SG, etc.125126## Error Handling127128Common error codes:129- 400: Bad request (invalid parameters)130- 401: Invalid API key131- 402: Insufficient credits132- 429: Rate limit exceeded133134Check `data["code"]` and `data["msg"]` in response.