How can I get the storage usage of Gmail programmatically? This value appears in two places, but I cannot find an API for it.
The main goal is to automatically log Gmail storage usage to a Google Sheet and graph the storage usage trend.
What I've tried:
- DriveApp.getStorageUsed() does not include Gmail usage.
- Reports API (
gmail_used_quota_in_mb
) is not available for consumer Gmail accounts (only G Suite) - Scraping www.google.com/settings/u/0/storage is not possible because a log-in is required, even when spoofing cookies (probably detects a new device/IP address).