Skip to content

Instantly share code, notes, and snippets.

@najeongmin
Created April 28, 2025 05:46
Show Gist options
  • Save najeongmin/5cbff544c39f228b60589fb8e36f3a0e to your computer and use it in GitHub Desktop.
Save najeongmin/5cbff544c39f228b60589fb8e36f3a0e to your computer and use it in GitHub Desktop.
serpapi-openapi.json
{
"openapi": "3.1.0",
"info": {
"title": "SerpAPI Google Search API",
"description": "Perform a Google search using SerpAPI with specific query terms.",
"version": "1.0.0",
"x-instructions": "You can perform Google searches using the SerpAPI. When the user wants to search, always ask them for a search query. Use the user's answer to fill in the 'q' parameter when calling the getSearchResults operation. Ensure you only call the API when you have a search term provided by the user."
},
"servers": [
{
"url": "https://serpapi.com",
"description": "SerpAPI production server"
}
],
"paths": {
"/search": {
"get": {
"operationId": "getSearchResults",
"summary": "Perform a Google search using SerpAPI.",
"parameters": [
{
"name": "engine",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "google",
"default": "google"
},
"description": "Search engine to use (must be 'google')."
},
{
"name": "q",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "갤럭시z플립6리뷰"
},
"description": "The search query term."
},
{
"name": "api_key",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "194be5b1eac7dec763eca49ec46e783931de3a1bc863b256f65d7e35f7553c5a",
"default": "194be5b1eac7dec763eca49ec46e783931de3a1bc863b256f65d7e35f7553c5a"
},
"description": "Your SerpAPI API key."
}
],
"responses": {
"200": {
"description": "Successful search response.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"search_metadata": {
"type": "object",
"description": "Metadata about the search execution.",
"properties": {
"id": {
"type": "string",
"description": "Unique ID for the search."
},
"status": {
"type": "string",
"description": "Status of the search query."
}
}
},
"organic_results": {
"type": "array",
"description": "Array of organic search results.",
"items": {
"type": "object",
"properties": {
"position": {
"type": "integer",
"description": "The ranking position on the results page."
},
"title": {
"type": "string",
"description": "Title of the result."
},
"link": {
"type": "string",
"description": "Link URL of the search result."
},
"snippet": {
"type": "string",
"description": "Short description of the result."
}
}
}
}
}
}
}
}
},
"401": {
"description": "Unauthorized - Invalid or missing API key."
},
"429": {
"description": "Too Many Requests - Rate limit exceeded."
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment