Last active
September 9, 2025 21:34
-
-
Save darinalleman/b4cc60bed013cbd7a46b286640ea1c94 to your computer and use it in GitHub Desktop.
Google Sheets Zillow Import Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function writeZestimateToSheet() { | |
| var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheets = spreadsheet.getSheets(); | |
| var zillowSheet = sheets.find(sheet => sheet.getSheetName() == 'Zillow'); | |
| if (zillowSheet) { | |
| var html = UrlFetchApp.fetch('https://www.zillow.com/homes/%%%%%%%%%_zpid/').getContentText(); | |
| const divRegex = /(<div class="zestimate-value">)(\$)(\d{1,3})(,\d{3})*(<\/div>)/g; | |
| const moneyRegex = /(\$)(\d{1,3})(,\d{3})*/g; | |
| var div = html.match(divRegex); | |
| var zestimate; | |
| if (div && div[0]) { | |
| zestimate = div[0].match(moneyRegex)[0]; | |
| if (zestimate) { | |
| var row = []; | |
| row[0] = zestimate; | |
| row[1] = new Date(); | |
| zillowSheet.appendRow(row); | |
| MailApp.sendEmail('me@email.com', 'Zestimate Update', 'As of '.concat(row[1].toDateString().concat(' the Zestimate of your home was ').concat(row[0]))); | |
| } | |
| else { | |
| throw new Error("Zestimate not found"); | |
| } | |
| } | |
| else { | |
| throw new Error("Zestimate div not found on page"); | |
| } | |
| } | |
| else { | |
| throw new Error("Could not find Zillow sheet"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a different version that is working with chatgpt
https://gist.github.com/Austin1/70bb8dc52a0c76e1c7a956b2adf1584f