Top Traffic Pages (GSC API)
Use cases
Connects to the Google Search Console API using the joshcarty/google-searchconsole library, pulls query and page data filtered by country, and calculates per-page statistics including keyword count, click share percentage, mean CTR, and mean position.
Groups pages into traffic ranges with a grouped Plotly bar chart and indicator widgets showing top-ten page concentration and zero-traffic page percentage.
Exports a multi-sheet Excel workbook via xlsxwriter.
Platform
Jupyter Notebook (requires Python environment)
Input
Google OAuth client_id.json credentials file
GSC property URL, country filter, date range, and search type
Output
Excel workbook (top_pages.xlsx) with sheets for top ten pages, top ten with keywords, zero-traffic pages, and all pages with traffic range classifications.
Features
- GSC API authentication via OAuth client_id.json (joshcarty/google-searchconsole library)
- Dimensions: query, page, country (device optional)
- Per-page metrics: keyword count, percent keywords, total clicks, mean CTR, mean position
- Traffic range bucketing (0, 1-100, 101-1000, 1001-5000, 5001-10000, 10001+)
- Plotly grouped bar chart (pages vs clicks by traffic range) and KPI indicators
- Multi-sheet Excel export: Top Ten Pages, Top Ten + Keywords, Zero Traffic Pages, All Pages
How to use
- 1 Upload your client_id.json and authenticate via OAuth console flow
- 2 Set the GSC property URL, country filter (e.g. gbr), date range, and search type
- 3 Run cells to pull data and compute per-page statistics
- 4 Review traffic distribution bar chart and KPI indicators
- 5 Download top_pages.xlsx with four worksheets
Frequently asked questions
- What credentials does the notebook need?
- An OAuth client file (client_id.json) from a Google Cloud project with the Search Console API enabled. The first run uses a console based OAuth flow and saves a credentials.json file, which later runs reuse so you do not have to re-authenticate each time.
- Why do I get "No Data Received from Search Console API!"?
- Usually because the property URL does not exactly match how it appears in Search Console; the code comments note a missing trailing slash is the most common cause. Uncomment the print(account.webproperties) cell to list your properties and copy the exact string into the url variable.
- How does the country filter work?
- Set country_filter to a three letter code such as gbr. The notebook pulls query, page and country dimensions, then keeps only rows matching that country, so every page statistic in the workbook reflects a single country. Comment out the filter line if you want worldwide data.
- Is the zero traffic sheet a complete list of pages with no clicks?
- No. The Search Console API only returns pages that had at least one impression in the date range, so the sheet lists pages that were shown in search but never clicked. Pages with no impressions at all never appear in the data, and neither do pages missing from the index.
- How are mean CTR and mean position calculated?
- Both are unweighted averages across each page's individual queries. Mean CTR averages the per query CTR values rather than dividing total clicks by total impressions, and position values are converted to whole numbers before averaging, so treat both as indicative rather than exact.
- Can I run it outside Google Colab?
- Not without edits. The credential upload and Excel download cells use the google.colab files module, so a local run means replacing those cells with a local file path and a standard file save.
Want me to run this for you?
I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.
Related Tools
Visualise indexing issues from Search Console coverage reports with interactive Plotly treemaps and sunbursts.
Bulk download Search Console data beyond the 1,000 row limit with automatic batch processing.
Extract question-based keywords from Search Console using regex pattern matching.
Find quick-win keywords ranking positions 5-19 that are missing from your on-page content.
Identify your highest-traffic pages from Search Console data with performance metrics.
Calculate percentage changes between two values quickly.
Need something built for your business?
This tool started as bespoke client work. I build custom scripts, data pipelines, and full apps for SEO and product data problems that off-the-shelf tools don't solve.
Tell Me What You Need