SERPAPI GPT

SERPAPI GPT · GPT 작업

SerpAPI Google Search

API for performing Google searches with various parameters and returning structured data.

  • GET /search.jsonGoogleSearch

    Perform a Google search using various parameters.

  • GET /searchGoogleTrendsSearch

    Perform a Google Trends search.

원본 API 스키마
{
  "openapi": "3.1.0",
  "info": {
    "title": "SerpAPI Google Search",
    "description": "API for performing Google searches with various parameters and returning structured data.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://serpapi.com"
    }
  ],
  "paths": {
    "/search.json": {
      "get": {
        "description": "Perform a Google search using various parameters.",
        "operationId": "GoogleSearch",
        "parameters": [
          {
            "name": "engine",
            "in": "query",
            "description": "Search engine to use (e.g., 'google')",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api_key",
            "in": "query",
            "description": "API key for authentication",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location",
            "in": "query",
            "description": "Geographical location for the search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hl",
            "in": "query",
            "description": "Language for the search results",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gl",
            "in": "query",
            "description": "Country for the search results",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "google_domain",
            "in": "query",
            "description": "Specific Google domain to use for the search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "num",
            "in": "query",
            "description": "Number of search results to return",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "start",
            "in": "query",
            "description": "First result number to return (for pagination)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "safe",
            "in": "query",
            "description": "Level of filtering for adult content",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    },
    "/search": {
      "get": {
        "description": "Perform a Google Trends search.",
        "operationId": "GoogleTrendsSearch",
        "parameters": [
          {
            "name": "engine",
            "in": "query",
            "description": "Search engine to use, set to 'google_trends' for Google Trends search",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "google_trends"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search query for Google Trends",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "data_type",
            "in": "query",
            "description": "Type of data to retrieve (e.g., 'RELATED_TOPICS', 'TIMESERIES', 'GEO_MAP')",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Length of time to acquire data e.g. ( now 1-H - Past hour, now 4-H - Past 4 hours now 1-d - Past day, now 7-d - Past 7 days, today 1-m - Past 30 days, today 3-m - Past 90 days, today 12-m - Past 12 months, today 5-y - Past 5 years, all)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api_key",
            "in": "query",
            "description": "API key for authentication",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "OrganicResultsResponse": {
        "type": "object",
        "properties": {
          "organic_results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "position": {
                  "type": "integer"
                },
                "title": {
                  "type": "string"
                },
                "link": {
                  "type": "string",
                  "format": "uri"
                },
                "source": {
                  "type": "string"
                },
                "displayed_link": {
                  "type": "string"
                },
                "thumbnail": {
                  "type": "string",
                  "format": "uri"
                },
                "favicon": {
                  "type": "string",
                  "format": "uri"
                },
                "date": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "cached_page_link": {
                  "type": "string",
                  "format": "uri"
                },
                "about_page_link": {
                  "type": "string",
                  "format": "uri"
                },
                "related_pages_link": {
                  "type": "string",
                  "format": "uri"
                },
                "sitelinks": {
                  "type": "object"
                },
                "rich_snippet": {
                  "type": "object"
                },
                "extensions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "reviews": {
                  "type": "integer"
                },
                "ratings": {
                  "type": "number"
                },
                "answers": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "related_questions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "top_stories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "link": {
                  "type": "string",
                  "format": "uri"
                },
                "source": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                },
                "thumbnail": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "interest_over_time": {
        "type": "object",
        "properties": {
          "timeline_data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "timestamp": {
                  "type": "string"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "query": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      },
                      "extracted_value": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "averages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string"
                },
                "value": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  }
}