Skip to content

Instantly share code, notes, and snippets.

@CharlyWargnier
Created March 22, 2022 12:43
Show Gist options
  • Save CharlyWargnier/545293f3593f205a9ed863ff562f2bab to your computer and use it in GitHub Desktop.
Save CharlyWargnier/545293f3593f205a9ed863ff562f2bab to your computer and use it in GitHub Desktop.
def get_search_console_data(webproperty):
if webproperty is not None:
# query = webproperty.query.range(start="today", days=days).dimension("query")
report = (
webproperty.query.search_type(search_type)
.range("today", days=timescale)
.dimension(dimension)
.filter(filter_page_or_query, filter_keyword, filter_type)
.filter(filter_page_or_query2, filter_keyword2, filter_type2)
.get()
.limit(100)
.to_dataframe()
)
# report
# df = pd.DataFrame(r.rows)
return report
else:
st.warning("No webproperty found")
st.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment