def gsc_queries(site_url: str, from_date: str, to_date: str) -> list:
service = build("searchconsole", "v1", credentials=creds)
resp = service.searchanalytics().query(siteUrl=site_url, body={
"startDate": from_date, "endDate": to_date,
"dimensions": ["query"], "rowLimit": 20}).execute()
return [{"query": r["keys"][0], "clicks": r["clicks"],
"impressions": r["impressions"]} for r in resp.get("rows", [])]
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)