0:00 So we're in our Google Maps and we're going to update this. We're going to add phone numbers and we're going to add scraping for reviews.
0:07 A couple of caveats. This is, one, going to increase our number of calls. When we go and get reviews, we are actually limited to 1,000 calls per month.
0:16 For the other, for free, you can go over and start paying for the API. But also, we are going to get, the phone numbers as well.
0:27 In this video, I'm going to show you how to update this sheet. And again, if you're watching this on BetterSheets.co, just grab the sheet down below.
0:33 That's going to be exclusive to BetterSheets members. So I have brought this function on open to the top.
0:44 I have added to the UI two more things after a separator. We're going to get the Phone and Reviews. So we're going to do this in a couple of steps.
0:52 Let's go get our search places in sheet function that we already wrote in the last video. All we're going to do is copy and paste this.
1:04 And we're going to rename it search places in sheet and phone. And we're going to add to the appearance. Pen row, right next to name, let's do phone.
1:17 This is just putting in the header, but after here in the results, we're also going to do phone. How do we get the phone?
1:26 Well, we're going to create a variable phone equals, and we're making sure actually to do this in each of the the, this for each.
1:38 So variable phone equals, get phone, and we need to enter, oh, we need to put a comma right after that.
1:46 We need to enter this place dot place ID, underscore ID. This is our ID, and we're going to use that ID to get the phone number.
1:57 So let's go down, and I've already written this out so I want to just copy paste it and then walk over what the function is.
2:04 So we're going to, this is sort of a helper function. It says, hey, for each of these place IDs, I'm going to enter the place ID, and all I want you to return is the phone.
2:13 So we're going to use the same function as before. We're going to use, sorry, the same sort of function. We're going to get the API key, we're going to go to a specific URL, which in this case, it's maps.googleapis.com.
2:28 This is all the same place ID, and per sand, fields equals formatted phone number and international phone number, and, and then also the key.
2:38 This is the same as before. What this fields does is it limits the return of the information. There is a lot more information.
2:46 You can research this online, uh, on the, or you can read it on the Google documentation, but we're just restricting the fields right now so that we only get back the phone number.
2:55 So we parse it just like JSON, and we say, okay, our phone is going to be whatever the international phone number is, or the formatted number, or nothing if there's none of these, basically.
3:08 We're going to get a phone number back. Thank Let's save this, and now we want to add the Search Places in Sheets and Reviews.
3:20 We want to add one more thing. So we're going to take exactly the Search in Places in Phone function, we're going to copy that, all of that, we're going to hit enter a couple times, paste it, and we're We're going to call.
3:36 Call it andReviews. Let's double check that that is the exact actual function, yeah. This is, okay, we just changed it, great.
3:49 So now this function that we use in our sheet is going to actually match the function here. So what do we need to do?
3:56 we need to also grab the reviews. So we're going to add at the top reviews into our append row and then at the end we're going to do a comma and this is very specific, dot, dot, dot, that's three dots, results, oh sorry, reviews.
4:15 Now we're going to add another function called, uh, getReviews. So let's do that, paste this in, and what we have is the API key, again, we're just restricting the field reviews, and for each place ID we get we're going to add the API key and get the reviews back, this is limited to five, and so we are
4:45 getting back an array of five, if they are, do exist. And we're formatting that as strings and putting that in five, uh, columns.
4:54 So, this getReviews needs our place ID, so let's go give it that. So, right under phone, we'll do phoneReview, uh, variableReviews equals getReviews, and again, we'll place dot place underscore ID, out in your sheet, and let me know how it goes.