class_docstr: A class for handling connections and interactions with the Google Search Console API.
class_docstr_tok: ["A","class","for","handling","connections","and","interactions","with","the","Google","Search","Console","API","."]
docstr: Get traffic data from Google Search Console API
  Args:
      params (dict): query parameters
  Returns:
      DataFrame
docstr_tok: ["Get","traffic","data","from","Google","Search","Console","API","Args",":","params","(","dict",")",":","query","parameters","Returns",":","DataFrame"]
code: def get_traffic_data(self, params: dict = None) -> DataFrame:
      """
      Get traffic data from Google Search Console API
      Args:
          params (dict): query parameters
      Returns:
          DataFrame
      """
      service = self.connect()
      accepted_params = [
          "start_date",
          "end_date",
          "dimensions",
          "row_limit",
          "aggregation_type",
      ]
      search_analytics_query_request = {
          key: value
          for key, value in params.items()
          if key in accepted_params and value is not None
      }
      response = (
          service.searchanalytics()
          .query(
              siteUrl=params["siteUrl"],
              body=search_analytics_query_request,
          )
          .execute()
      )
      df = pd.DataFrame(
          response["rows"], columns=self.analytics.get_columns()
      )
      return df
  
imports: import json
  import pandas
  from collections import OrderedDict
  from pandas import DataFrame
  from google.auth.transport.requests import Request
  from google.oauth2.credentials import Credentials
  from googleapiclient.discovery import build
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .google_search_tables import SearchAnalyticsTable, SiteMapsTable
  from mindsdb.integrations.libs.api_handler import APIHandler, FuncParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.utilities import log
label_desc: Use image node_id 5 for calling the GoogleSearchConsoleHandler obj's underlying member method code with example usage: obj.get_traffic_data(params) and returns: df