medium-stats-extension

🚀 Medium Stats Collector (Chrome Extension)

A powerful, privacy-friendly Chrome Extension that collects detailed Medium article statistics using Medium’s internal GraphQL APIs. Easily aggregate stats for views, reads, claps, followers gained, subscribers gained, presentations, and more — for all your Medium posts.

This extension works directly on your Medium Stats dashboard and can auto-scroll to capture all posts, no matter how many you have.


📸 Screenshots

Medium Stats Collector Medium Stats Collector Medium Stats Collector


✨ Features


🛠️ Installation (Developer Mode)

  1. Clone this repository:

     git clone https://github.com/your-user/medium-stats-extension.git
     cd medium-stats-extension
    
  2. Open Chrome and navigate to:

     chrome://extensions/
    
  3. Enable Developer Mode (top right).
  4. Click Load unpacked and select this project folder.
  5. You should now see the extension in your toolbar.

📘 How To Use

1. Open Medium Stats

Go to:

   https://medium.com/me/stats

Wait for the posts to load.

2. Open the Extension Popup

Click the extension icon → Medium Stats Collector.

3. Choose an action:

▶️ Collect Visible

Fetch stats only for the posts currently loaded on the screen. Useful if you manually scroll and want partial data.

▶️ Collect ALL (Auto Scroll)

Auto-scrolls to the bottom of your stats page and captures all posts automatically. Works even with hundreds of posts.

▶️ Load Last

Reloads previously collected results from Chrome storage.

▶️ Collect Visible

Outputs a CSV with all collected stats.


📂 Project Structure

medium-stats-extension/
│
├── manifest.json        # Chrome Extension MV3 config
├── popup.html           # Extension popup UI
├── popup.js             # UI logic
├── styles.css           # Popup styling
│
├── background.js        # Main GraphQL collector (MV3 service worker)
├── content.js           # Stats page scanner
├── contentScript.js     # Auto-scrolling collector (paginated)
│
└── README.md            # This file

🔧 Technical Overview

⚙️ Background Service Worker (background.js)

🖥️ Popup Application

🌐 Content Scripts


📊 Data Collected

For each article:

Metric Description
views ViewersCount
reads ReadersCount
presentations Feed presentation count
claps Clap count
followersGained Follows gained from the article
subscribersGained Email subscribers gained
CTR feedClickThroughRate

[!IMPORTANT] No personal tokens, passwords, or private content is collected.


⚠️ Troubleshooting

❗ “Open Medium stats page first”

Ensure you are on:

https://medium.com/me/stats

❗ “No posts found”

Possible reasons:

Try:

❗ “Background error: Failed to fetch”

This is usually caused by:

❗ Content script error: Could not establish connection. Receiving end does not exist.

Possible reasons:

Try:

❗ Auto-scroll stops too early

Try increasing scroll speed:


🔒 Privacy


⚠️ Disclaimer

This extension uses Medium’s internal GraphQL API, which is undocumented and may change at any time. If Medium updates their internal endpoints, the extension may require an update.


📝 License

MIT License — free to modify, distribute, and use.


💬 Feedback & Contributions

Pull requests and issues are welcome! If you have ideas, improvements, or encounter API changes, feel free to open an issue.