Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Created November 11, 2020 23:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamletbatista/f07869144ffe52085143bb26f3e62c7a to your computer and use it in GitHub Desktop.
Save hamletbatista/f07869144ffe52085143bb26f3e62c7a to your computer and use it in GitHub Desktop.
#let's build a pandas dataframe with the search console data
import pandas as pd
def get_search_console_data(webproperty, days=-365):
if webproperty is not None:
query = webproperty.query.range(start='today', days=days).dimension('date', 'query')
r = query.get()
df = pd.DataFrame(r.rows)
return df
print("Web property doesn't exist, please select a valid one from this list")
print(account.webproperties)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment