Voyage Lens

Voyage Lens · GPT-Aktionen

Google Lens API

API for performing image searches with Google Lens, retrieving knowledge graphs, visual matches, text data, and more.

  • GET /searchImage search via Google Lens

    This operation allows users to perform an image search using Google Lens, retrieving results that include visual matches, knowledge graphs, and textual information related to the image.

Ursprüngliches API-Schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "Google Lens API",
    "description": "API for performing image searches with Google Lens, retrieving knowledge graphs, visual matches, text data, and more.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://serpapi.com"
    }
  ],
  "paths": {
    "/search": {
      "get": {
        "summary": "Image search via Google Lens",
        "operationId": "googleLensImageSearch",
        "description": "This operation allows users to perform an image search using Google Lens, retrieving results that include visual matches, knowledge graphs, and textual information related to the image.",
        "parameters": [
          {
            "name": "engine",
            "in": "query",
            "required": true,
            "description": "Engine parameter set to 'google_lens' to specify the use of Google Lens for image search.",
            "schema": {
              "type": "string",
              "default": "google_lens"
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The URL of the image to be searched. The image should be publicly accessible.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hl",
            "in": "query",
            "description": "Optional parameter to specify the language for the search results, using a two-letter language code.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "description": "Optional parameter to specify the country for the search results, using a two-letter country code.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "no_cache",
            "in": "query",
            "description": "Optional parameter to bypass the cache. When set to true, a new search will be performed instead of using cached results.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "async",
            "in": "query",
            "description": "Optional parameter to perform the search asynchronously. When set to true, the search will be submitted, and the results must be retrieved later using the Searches Archive API.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "api_key",
            "in": "query",
            "required": true,
            "description": "f51f40452afc0153d584de4c3d929c6a05cb65c6354a95d129887a90632b2d11",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "output",
            "in": "query",
            "description": "Optional parameter to specify the format of the results. Can be set to 'json' for structured data or 'html' for raw HTML of the search results page.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "html"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful search response containing Google Lens search results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "search_metadata": {
                      "type": "object",
                      "description": "Metadata related to the search, including status, endpoints for JSON and HTML results, and total time taken."
                    },
                    "knowledge_graph": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Knowledge graph results related to the image search."
                      }
                    },
                    "visual_matches": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Visual matches found for the image search."
                      }
                    },
                    "text_results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Text results extracted from the image."
                      }
                    },
                    "related_content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Content related to the image search."
                      }
                    },
                    "reverse_image_search": {
                      "type": "object",
                      "description": "Reverse image search results."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}