Google SERP API

Overview

Seodity SERP API allows you to execute search requests in real time, returning clean, structured JSON data based on different parameters such as query, location, language, and device.

Authorization

Authorization is required for making requests to the Seodity SERP API. It involves passing your unique API key that you receive when you register with Seodity, so the server can validate and grant access to the resources requested.

The API key should be included in the header of every API request, under the field "Authorization". The key needs to be prefixed with the term "APIKey" followed by a space. So, your HTTP GET request should contain an Authorization header that looks like this: Authorization: APIKey <api_key>. Replace <api_key> with your actual API key.

This ensures that your requests to the Seodity SERP API are authenticated and properly processed. If the API key is missing or invalid, the server responds with an error.

Requests

Searching Google

To perform a search in Google SERP:

GET https://api.seodity.com/v1/api/serp/google/search

Parameters:

  • query: required, string.

  • location: optional, string. (default: "United States")

  • language: optional, string. (default: "English")

  • device: optional, string. (default: "desktop")

Example:

curl -X GET 'https://api.seodity.com/v1/api/serp/google/search?query=pizza&location=United States&language=English&device=desktop'

Getting Language Information

To fetch the list of available languages:

GET https://api.seodity.com/v1/api/serp/google/languages

Parameters:

  • search: optional, string. (default: empty)

Example:

curl -X GET 'https://api.seodity.com/v1/api/serp/google/languages?search=english'

Getting Location Information

To fetch the list of available locations:

GET https://api.seodity.com/v1/api/serp/google/locations

Parameters:

  • q: required, string.

  • type: optional, string. (available options: "country")

  • country_code: optional, string (for example: "us").

Example:

curl -X GET 'https://api.seodity.com/v1/api/serp/google/locations?q=united states&type=country&country_code=us'

Response Object

Responses from Seodity SERP API calls contain the following data:

  • request_info: Contains details about the request.

    • uid: Unique identifier of the request.

    • account_uid: Unique identifier of the account making the request.

    • success: Indicates if the request was successful or not.

    • api: The API being used for the request.

    • api_function: The specific function of the API being used.

    • parameters: The parameters sent in the request.

    • started_at: The time when the request started.

    • finished_at: The time when the request finished.

    • credits_used: The number of credits used for the request.

    • total_time_taken: The total time taken to execute the request (in seconds).

  • metadata: Contains further details about the request.

    • google_url: The URL of the Google Search Results Page (SERP) queried.

  • result: Contains the search results.

    • total_results: Total number of results found.

    • answer_box: The answer box from the SERP, if any.

    • organic_results: An array of organic search results. Each element contains:

      • position: The rank of the result.

      • title: The title of the result.

      • description: A short description of the result.

      • url: The URL of the result.

    • related_questions: Array of related questions to the search query. Each element contains:

      • title: The related question title.

    • related_searches: Array of related searches to the search query. Each element contains:

      • query: The related search query.

    • local_results: Array of local search results.

    • knowledge_graph: Information from the Google Knowledge Graph, if any.

    • inline_images: Array of inline images related to the search query. Each element contains:

      • title: The title of the image.

      • link: The source URL of the image.

    • inline_videos: Array of inline video results related to the search query.

If an error occurs during a request, the success field in request_info becomes false and an error field will be appended to request_info with details about the error.

Last updated