📊 Automatically replaces BigQuery’s query size estimate (GB) with the estimated cost in USD.
Google BigQuery displays a message like:
"This query will process 11.37 GB when run."
This script dynamically replaces that text with the estimated cost based on Google’s on-demand pricing.
💰 Cost Calculation: $6.25 per TB processed
- ✔ Real-time cost calculation as you type queries
- ✔ MutationObserver support for dynamic updates
- ✔ Lightweight & fast, no external dependencies
- ✔ Works in Chrome, Firefox, Edge, Brave, & Safari
This script works with:
- ViolentMonkey (Recommended)
- TamperMonkey
🔹 From GreasyFork: BigQuery Cost Estimator
🔹 From GitHub: Click Here to install manually.
- The GB estimate will be replaced with the cost estimate automatically.
- Finds the GB estimate in BigQuery’s UI.
- Extracts the numeric value from the message.
- Calculates the cost using
$6.25 per TB. - Replaces the text dynamically.
📌 Example Calculation:
Query processes: 11.37 GB
Cost = (11.37 GB ÷ 1024) × 6.25
Cost = $0.07
BigQuery now displays:
"Estimated cost: $0.07"
- Uses MutationObserver to detect changes in BigQuery’s UI.
- Targets the element:
div.cfc-truncated-text.ng-star-inserted. - Does not interfere with BigQuery’s functionality.
Want to improve this script? PRs are welcome!
- Fork this repo
- Clone your fork
git clone https://github.com/dannberg/bigquery-cost-estimator.git- Make changes & push
git commit -m "Improved cost calculation"
git push origin main- Submit a Pull Request (PR)
This project is licensed under the MIT License – you’re free to use, modify, and distribute it!
- 📜 GreasyFork Script: BigQuery Cost Estimator
- 🏗 GitHub Repository: GitHub
- 🌎 Google BigQuery Pricing: BigQuery Pricing Docs
