Spaces:
Sleeping
Sleeping
import streamlit as st | |
from googleapiclient.discovery import build | |
# ... (rest of the setup code as before) | |
st.title("Search Analytics Viewer") | |
# User Inputs | |
site_url = st.text_input("Enter your website URL:", "https://www.example.com") | |
start_date = st.date_input("Start Date") | |
end_date = st.date_input("End Date") | |
credentials_file = st.file_uploader("Upload your JSON credentials file") | |
if st.button("Fetch Data"): | |
if credentials_file: | |
# ... (Authentication setup using uploaded credentials) | |
# ... (Build the API request using user inputs) | |
response = service.searchanalytics().query(siteUrl=request['siteUrl'], body=request).execute() | |
# ... (Handle and display the API response in a data table or visualization) | |