Google Search API

The Google Search allows users to search for information on the Internet by entering keywords or phrases. Google Search uses algorithms to analyze and rank websites based on their relevance to the search query.

Base URL

"https://openapi-idk8.onrender.com/"

Search Endpoint

GET `/googlesearch/:search`

Description: Searches Google for the provided search term and returns related information.

Path Parameters

  • search (required): The keyword or phrase to search for on Google.

Sample Request

GET `https://openapi-idk8.onrender.com/googlesearch/programming`

Sample Response

{
  "api_info": {
    "api_name": "Google Search",
    "description": "Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.",
    "author": "OpenAPI"
  },
  "search_metadata": {
    "id": "search_k3mf0h37g",
    "status": "Success",
    "created_at": "2024-06-24T12:34:56.789Z",
    "request_url": "https://www.google.com/search?q=programming&gl=us&hl=en&ie=UTF-8"
  },
  "search_parameters": {
    "engine": "google",
    "q": "programming",
    "device": "desktop",
    "google_domain": "google.com",
    "hl": "en",
    "gl": "us"
  },
  "search_information": {
    "query_displayed": "programming",
    "total_results": 12345678,
    "time_taken_displayed": 0.56
  },
  "searches": [
    {
      "title": "Programming - Wikipedia",
      "description": "Programming is the process of creating a set of instructions that tell a computer how to perform a task.",
      "url": "https://en.wikipedia.org/wiki/Programming"
    },
    ...
  ],
  "knowledge_graph": {
    "title": "Programming",
    "type": "Search Result",
    "description": "Programming is the process of creating a set of instructions that tell a computer how to perform a task.",
    "images": [
      "https://www.example.com/image1.jpg",
      "https://www.example.com/image2.jpg",
      ...
    ]
  }
}

The response includes metadata, search parameters, search information, search results, and a knowledge graph with related images and a Wikipedia extract.

Error Handling

500 Internal Server Error: Returned when there is an issue processing the request.

{
  "error": "An error occurred while fetching data"
}