Article Navigation
Heading 2 Example
Heading 3 Example
Heading 4 Example
Heading 2 Example
Heading 3 Example
Heading 4 Example
Introduction
According to Wikipedia:
“Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or ZIP codes (postal codes). With geographic coordinates, the features can be mapped and entered into Geographic Information Systems, or the coordinates can be embedded into media such as digital photographs via geotagging.”
(Video) Excel VBA for Geocoding with Google
Almost 10 months have passed since my last posts about Google APIs (Trip Distance and Elevation functions accordingly), so, today, we will see how to extract the latitude and longitude of a given address using Google Geocoding API. The developed VBA function can be utilized directly in Excel, as long as the user provides a valid address. The so-called GetCoordinates function sends a request to the corresponding Google server and, then, uses the server’s response to read the appropriate XML nodes to extract the required information (latitude, longitude).
Based on GetCoordinates, the other two functions were derived: GetLatitude and GetLongitude. As their names imply, they return (as a number) the latitude and the longitude of the given address, in case the user needs only one of the two returned parameters of the GetCoordinates function. If you need the opposite (Reverse Geocoding), check the GetAddress function.
VBA code
Below you will find the VBA code of the GetCoordinates, GetLatitude, and GetLongitude functions. Keep in mind that the Google Geocoding API is subject to a limit of 40,000 requests per month, so be careful not to exceed this limit.
2018 Update: the function has been updated to reflect the changes in Google API. To use this VBA function, you will need a valid API key. Check this link that presents a step-by-step guide on how to acquire one for free.
2018 Update 2 (July): The EncodeURL function was added to avoid problems with special characters. This is a common problem with addresses from Greece, Serbia, Germany, and some other countries. At this point, I would like to thank Viacheslav Komarivskyi for this suggestion. However, this function is only available in Excel 2013 and newer versions.
2020 Update: The code was switched to late binding, so no external reference is required.
Option ExplicitPublic Function GetCoordinates(address As String) As String '----------------------------------------------------------------------------------------------------- 'This function returns the latitude and longitude of a given address using the Google Geocoding API. 'The function uses the "simplest" form of Google Geocoding API (sending only the address parameter), 'so, optional parameters such as bounds, language, region and components are NOT used. 'In case of multiple xmlDoc (for example two cities sharing the same name), the function 'returns the FIRST OCCURRENCE, so be careful in the input address 'Tip: use the city name and the postal code if they are available). 'NOTE: As Google points out, the use of the Google Geocoding API is subject to a limit of 40,000 'requests per month, so be careful not to exceed this limit. For more info check: 'https://cloud.google.com/maps-platform/pricing/sheet '2018 Update: In order to use this function you will now need a valid API key. 'Check the next link that guides you on how to acquire a free API key: 'https://www.myengineeringworld.net/2018/02/how-to-get-free-google-api-key.html '2018 Update 2 (July): The EncodeURL function was added to avoid problems with special characters. 'This is a common problem with addresses that are from Greece, Serbia, Germany and other countries. 'Note that this function was introduced in Excel 2013, so it will NOT work in older versions. '2020 Update: The code was switched to late binding, so no external reference is required. 'Written By: Christos Samaras 'Date: 12/06/2014 'Last Updated: 16/02/2020 'E-mail: [emailprotected] 'Site: https://www.myengineeringworld.net '----------------------------------------------------------------------------------------------------- 'Declaring the necessary variables. Dim apiKey As String Dim xmlhttpRequest As Object Dim xmlDoc As Object Dim xmlStatusNode As Object Dim xmlLatitudeNode As Object Dim xmLongitudeNode As Object 'Set your API key in this variable. Check this link for more info: 'https://www.myengineeringworld.net/2018/02/how-to-get-free-google-api-key.html 'Here is the ONLY place in the code where you have to put your API key. apiKey = "The API Key" 'Check that an API key has been provided. If apiKey = vbNullString Or apiKey = "The API Key" Then GetCoordinates = "Empty or invalid API Key" Exit Function End If 'Generic error handling. On Error GoTo errorHandler 'Create the request object and check if it was created successfully. Set xmlhttpRequest = CreateObject("MSXML2.ServerXMLHTTP") If xmlhttpRequest Is Nothing Then GetCoordinates = "Cannot create the request object" Exit Function End If 'Create the request based on Google Geocoding API. Parameters (from Google page): '- Address: The address that you want to geocode. 'Note: The EncodeURL function was added to allow users from Greece, Poland, Germany, France and other countries 'geocode address from their home countries without a problem. The particular function (EncodeURL), 'returns a URL-encoded string without the special characters. 'This function, however, was introduced in Excel 2013, so it will NOT work in older Excel versions. xmlhttpRequest.Open "GET", "https://maps.googleapis.com/maps/api/geocode/xml?" _ & "&address=" & Application.EncodeURL(address) & "&key=" & apiKey, False 'An alternative way, without the EncodeURL function, will be this: 'xmlhttpRequest.Open "GET", "https://maps.googleapis.com/maps/api/geocode/xml?" & "&address=" & Address & "&key=" & ApiKey, False 'Send the request to the Google server. xmlhttpRequest.send 'Create the DOM document object and check if it was created successfully. Set xmlDoc = CreateObject("MSXML2.DOMDocument") If xmlDoc Is Nothing Then GetCoordinates = "Cannot create the DOM document object" Exit Function End If 'Read the XML results from the request. xmlDoc.LoadXML xmlhttpRequest.responseText 'Get the value from the status node. Set xmlStatusNode = xmlDoc.SelectSingleNode("//status") 'Based on the status node result, proceed accordingly. Select Case UCase(xmlStatusNode.Text) Case "OK" 'The API request was successful. 'At least one result was returned. 'Get the latitude and longitude node values of the first result. Set xmlLatitudeNode = xmlDoc.SelectSingleNode("//result/geometry/location/lat") Set xmLongitudeNode = xmlDoc.SelectSingleNode("//result/geometry/location/lng") 'Return the coordinates as a string (latitude, longitude). GetCoordinates = xmlLatitudeNode.Text & ", " & xmLongitudeNode.Text Case "ZERO_RESULTS" 'The geocode was successful but returned no results. GetCoordinates = "The address probably do not exist" Case "OVER_DAILY_LIMIT" 'Indicates any of the following: '- The API key is missing or invalid. '- Billing has not been enabled on your account. '- A self-imposed usage cap has been exceeded. '- The provided method of payment is no longer valid ' (for example, a credit card has expired). GetCoordinates = "Billing or payment problem" Case "OVER_QUERY_LIMIT" 'The requestor has exceeded the quota limit. GetCoordinates = "Quota limit exceeded" Case "REQUEST_DENIED" 'The API did not complete the request. GetCoordinates = "Server denied the request" Case "INVALID_REQUEST" 'The API request is empty or is malformed. GetCoordinates = "Request was empty or malformed" Case "UNKNOWN_ERROR" 'The request could not be processed due to a server error. GetCoordinates = "Unknown error" Case Else 'Just in case... GetCoordinates = "Error" End Select 'Release the objects before exiting (or in case of error).errorHandler: Set xmlStatusNode = Nothing Set xmlLatitudeNode = Nothing Set xmLongitudeNode = Nothing Set xmlDoc = Nothing Set xmlhttpRequest = Nothing End Function'------------------------------------------------------------------------------------------------------------------'The next two functions use the GetCoordinates function to get the latitude and the longitude of a given address.'------------------------------------------------------------------------------------------------------------------Public Function GetLatitude(address As String) As Double 'Declaring the necessary variable. Dim coordinates As String 'Get the coordinates for the given address. coordinates = GetCoordinates(address) 'Return the latitude as a number (double). If coordinates <> vbNullString Then GetLatitude = CDbl(Left(coordinates, WorksheetFunction.Find(",", coordinates) - 1)) Else GetLatitude = 0 End IfEnd FunctionPublic Function GetLongitude(address As String) As Double 'Declaring the necessary variable. Dim coordinates As String 'Get the coordinates for the given address. coordinates = GetCoordinates(address) 'Return the longitude as a number (double). If coordinates <> vbNullString Then GetLongitude = CDbl(Right(coordinates, Len(coordinates) - WorksheetFunction.Find(",", coordinates))) Else GetLongitude = 0 End If End Function
NOTE: The GetCoordinates function uses the “simplest” form of Google Geocoding API (sending only the address parameter), so optional parameters such as bounds, language, region, and components are NOT used. In the case of multiple results (for example, two cities sharing the same name), the function returns the first occurrence, so be careful in the input address you use. Tip: apart from the city name, use also the postal code, if it is available. Since I have no intention to copy the entire Google page, interested in learning how the Google Geocoding API works can visit the corresponding page.
WARNING: The code will NOT work on a Mac!!!
Test your geocoding API key
Since many people had trouble applying the API key, I decided to develop a small “validator.” You can check if your key can work with the above VBA functions. Paste your API key in the text box and press the button. After a few seconds, you will receive a response from the Google server.
Server Response:
Apart from OK, any other value that you will get (e.g., REQUEST_DENIED), it will automatically mean that either your key is invalid or you have not enabled the correct API (in this case, the Geocoding API). If this occurs, ensure that you followed exactly these instructions to get your API key.
Downloads
The file can be opened with Excel 2007 or newer. Please enable macros before using the spreadsheet.
Read also
How To Get A Free Google API Key
Category:Office Tips
Page last modified: October 1, 2021
Previous Article
Next Article
Christos Samaras
Hi, I am Christos, a Mechanical Engineer by profession (Ph.D.) and a Software Developer by obsession (10+ years of experience)! I founded this site back in 2011 intending to provide solutions to various engineering and programming problems.
Hi, Panagiotis,
It’s good to know that you solved your problem.
Unfortunately, these kinds of firewall problems are difficult to detect.
In general, another way to troubleshoot issues with this VBA code is to add this line:
Debug.Print "https://maps.googleapis.com/maps/api/geocode/xml?" & "&address=" & Application.EncodeURL(address) & "&key=" & apiKey
Just before these lines:
'Send the request to the Google server.xmlhttpRequest.send
In the Immediate window of the VBA editor, a URL will be generated.
If you copy the URL on your browser, you will get either the requested XML results or an XML error.
In your case (firewall issue), I bet that you will get an error.
Best Regards,
Christos
Hi Christos,
thank you for your reply to my request and for testing the specific address.
Eventually, I found the problem for not be able to use your code. I work for a big European Organisation and until now I was trying to run the code from a PC inside the organisation network. It seems that some kind of firewall was preventing the code to call the Google APIs. I managed to run your code when I run it before logging in the organisation.
Once again, I want to thank you for sharing your code, I must say that it helped me enormously in a big project of European addresses visualisation that I am working currently.
Best regards,
Panagiotis
Hi, Panagiotis,
When I tried the address in the sample workbook, I got:
44.9075070, 8.6211240
So, I would suggest downloading the sample file, put your API key there and try the address you need to search.
Best Regards,
Christos
You’re welcome!
Dear Mr Samaras,
First of all I would like to thank you for offering your code.
I want to use this code to find the the latitude and longitude of a given address in a format like: “Spalto Gamondio 3, Alessandria, Italy” which I know that has a Latitude = 44.907660 and Longitude = 8.620970
I used the GetCoordinates function and all the lines in the code are executed until the line xmlhttpRequest.send
which is not executed. The function GetCoordinates then exits without any returning value.
I have a valid API Key which I have checked with you verification tool in this page.
I have enabled in my Excel the Microsoft XML v6.0 (I tested as well with Microsoft XML v3.0)
I have used the alternative command that you propose for the GET: ‘xmlhttpRequest.Open “GET”, “https://maps.googleapis.com/maps/api/geocode/xml?” & “&address=” & address & “&key=” & apiKey, False
Do you have any idea why the code stops execution when reaching the command “xmlhttpRequest.send” ?
Thank you very much,
Panagiotis
Thanks a lot!
Add Content Block
FAQs
How do I use Google API for geocoding? ›
In your Google Cloud Platform Console, go to APIs & Services → Dashboard → Enable APIs & Services at the top and choose Maps JavaScript API from the API Library. This will open up the Maps JavaScript API page and Enable it. Then, scroll down to “More solutions to explore” and choose Geocoding API → Enable it.
Can I use Google geocoding API for free? ›The Geocoding API uses a pay-as-you-go pricing model. Geocoding API requests are billed using the SKU for Geocoding. Daily quotas are refreshed daily at midnight Pacific time. Along with the overall Google Terms of Use, there are usage limits specific to the Geocoding API.
What is the difference between Geocoder and geocoding API? ›Geocoder is a built-in API in the Android framework that is free. Geocoding API is a rest API that is paid. Geocoder uses a different search stack internally and this leads to different results comparing to the Geocoding rest API.
What is the difference between Google geolocation and geocoding? ›There is often confusion around 'geolocation' and 'geocoding', but they are not the same thing. Geolocation is the physical locality of a device or the process of finding the physical locality of a device, while geocoding refers to the latitude and longitude.
How can I use geocoding for free? ›Google Maps
This free platform will allow you to geocode virtually any type of location. Plotting one location is simple. Just go to Google Maps and type your query into the search bar. Whether it's an address, zip code, or any other type of location, Google will instantly plot it for you.
According to Google Maps API documentation, the Geocoding API has a rate limit of 50 requests per second, which translates to a maximum of one request every 20 milliseconds.
What replaced Google Maps API for free? ›Mapbox is probably the most popular Google Maps API alternative developers and businesses use. They have been in business since 2010 and started as a free map data and analysis service for non-profit organizations.
What is the free limit for Google Maps API? ›You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).
What are the two main data types required for geocoding? ›Initially, the geocoding process requires two types of information, reference data for creating an address locator and address data for matching. Reference data refers to a geographic information system (GIS) feature class containing the address attributes you want to search.
What are alternatives to geocoding API? ›Radar is the best alternative to the Google Maps API. Radar supports geocoding, search, and distance APIs with high-quality address and place data.
Is geocoding expensive? ›
On-premise geocoding requires constant training, security, updates, hardware maintenance, and key management. Companies that opt for on-premise geocoding should budget three times the licensing costs for upkeep. So, a $100,000 local geocoding implementation license may cost around $300,000 to maintain.
How do I enable geolocation in Google Maps API? ›...
If the API is not listed, enable it:
- At the top of the page, select ENABLE API to display the Library tab. Alternatively, from the left side menu, select Library.
- Search for Geocoding API, then select it from the results list.
- Select ENABLE.
- On your computer, open Google Earth Pro.
- Click File. ...
- Browse to the location of the CSV file and open it.
- In the box that appears, next to Field Type, choose Delimited.
- Next to Delimited, choose Comma.
- Use the preview pane to ensure your data has imported correctly and click Next.
- On your computer, open Google Maps.
- Right-click the place or area on the map. This will open a pop-up window. You can find your latitude and longitude in decimal format at the top.
- To copy the coordinates automatically, left click on the latitude and longitude.
- Mapbox.
- Apple Maps.
- Bing Maps.
- HERE Maps.
- Open Street Map.
- MapQuest.
- TomTom.
- OpenLayers.
- Ipstack – The Best IP Geolocation API For 2022. Ipstack features a powerful and highly scalable infrastructure. ...
- Positionstack – The Best IP Geolocation API For Real-Time Geocoding. ...
- Ipapi – The Best IP Geolocation API For Data Accuracy. ...
- Abstract's IP Geolocation API. ...
- Maxmind. ...
- Ipdata. ...
- Ipgeolocation.io. ...
- DB IP.
GPS: Maps uses satellites to know your location up to around 20 meters. When you're inside buildings or underground, the GPS is sometimes inaccurate. Wi-Fi: The location of nearby Wi-Fi networks helps Maps know where you are. Cell tower: Your connection to mobile data can be accurate up to a few thousand meters.
Can you geocode in Excel? ›Using the Mapcite geocoder in Excel
and open the spreadsheet you want to geocode. Then follow these simple steps: Click on the menu option 'Mapcite' in the Excel Ribbon. Press 'Geocode Data' button.
The Geocoding API is a service that accepts a list of places as addresses, latitude/longitude coordinates, or Place IDs. It converts each address into latitude/longitude coordinates or a Place ID, or converts each set of latitude/longitude coordinates or a Place ID into an address.
What does Google geocoding API do? ›The Geocoding API is a service that provides geocoding and reverse geocoding of addresses. This service is also available as part of the client-side Google Maps JavaScript API, or for server-side use with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.
How much are geocoding services per transaction from Google API? ›
200 USD worth of service allow for 40'000 Geocoding requests per month (see pricelist). Any additional request is billed at 0.005 USD/request. The service for Geocoding has the SKU "Geocoding" and is part of the "Geocoding API" which in term is part of the product "Places" of the "Google Maps Platform".
How do I increase my Google API limit? ›Increase the quota for an API
Go to Google Cloud and sign in as a Google Workspace super administrator. Under Project, select the project you're using for the migration. Quotas. Using the checkboxes, select one or more quotas to edit, then click Edit Quotas.
Google Maps Geocoding Rate Limit
According to Google's API Usage and Billing page, there is a limit of 50 requests per second. If you exceed this amount, subsequent requests to the API will fail with the OVER_DAILY_LIMIT or OVER_QUERY_LIMIT status code and the geocoded data will not be returned.
All Maps Embed API requests are available at no charge with unlimited usage.
Why is Google Maps API so expensive? ›Google also started to require all API calls to use a valid API key, which has to be linked to a Google Cloud Platform account. Small companies aren't likely to reach the new limit. But when the number of customers and everyday freight traffic grows, the price for Google Maps services grows significantly.
Why is Google Maps no longer free? ›It's not free. Google runs ads under a pseudonym called “Ad Choices”. Every day the average person sees more than 400 ads. On google maps companies pay Google directly to have their establishment labels appear before all the businesses around them.
How much does it cost to have a Google Maps API key? ›Stay organized with collections Save and categorize content based on your preferences. API Keys is currently free of charge. If you are using Cloud Endpoints to manage your API, you might incur charges at high traffic volumes.
How much does Google Maps API location cost? ›MONTHLY VOLUME RANGE (Price per REQUEST) | ||
---|---|---|
0–100,000 | 100,001–500,000 | 500,000+ |
0.005 USD per each (5.00 USD per 1000) | 0.004 USD per each (4.00 USD per 1000) | Contact Sales for volume pricing |
All use of the Google Drive API is available at no additional cost.
What data is needed for geocoding? ›Geocoding is the process of transforming a description of a location—such as a pair of coordinates, an address, or a name of a place—to a location on the earth's surface. You can geocode by entering one location description at a time or by providing many of them at once in a table.
What do you need to create a locator for geocoding? ›
- On the Analysis tab, click the Tools button . ...
- Select the Create Locator tool. ...
- In the Create Locator tool pane, click the Role drop-down list and choose the role on which you want to base the locator.
- Click the Browse button.
The most common type of geocoding results from the spatial location of street addresses using a street centerline file.
What are common problems that we must consider in geocoding? ›- Problem 1: Incomplete Coverage. While the quality and amount of geocoding information available for the world is astounding, it is far from complete. ...
- Problem 2: You Don't Know What You Don't Know. ...
- Problem 3: User Error. ...
- Why It Matters.
Get started with Geoapify for free. Our free plan covers commercial use, so you can create commercial versions of your service or app.
What is the API limit per day for Google Maps? ›Setting up quotas can limit unexpected costs, but may also prevent your store locator from working properly once the quota has been reached. As a starting point, we suggest the following limits: Maps JavaScript API: 350 map loads per day ( = ~10,000 per month) Geocoding API: 350 requests per day ( = ~10,000 per month)
What is the success rate of geocoding? ›Reduced crime rates of mapped points, aggregated to census boundaries, are compared for a statistically significant difference. The result indicates 85% as a first estimate of a minimum reliable geocoding rate, and this result is applicable to many address-based, point pattern datasets beyond the crime arena.
What are examples of geocoding? ›Geocoding refers to the assignment of geocodes or coordinates to geographically reference data provided in a textual format. Examples are the two letter country codes and coordinates computed from addresses.
How to get Geolocation API free? ›Visit https://www.ip2location.com/web-service for more info. Free Geo IP - The Free Geo IP API allows developers to get free Geo IP information. geolocation - Geolocation api.
What is the API for getting geolocation? ›The Geolocation API is a service that accepts an HTTPS request with the cell tower and WiFi access points that a mobile client can detect. It returns latitude/longitude coordinates and a radius indicating the accuracy of the result for each valid input.
Which API to enable for Google Maps? ›Note: Enabling Places API also enables the Places Library, Maps JavaScript API, Places SDK for Android and Places SDK for iOS. This step only goes through the API Key creation process. If you use your API Key in production, we strongly recommend that you restrict your API key.
Can you auto populate longitude and latitude on Google Maps into Excel? ›
To get the latitude of the address in cell B2, use the formula = GetLatitude(B2) To get the longitude of the address in cell B2, use the formula = GetLongitude(B2) To get both the latitude and longitude of the address in cell B2, use the formula = GetCoordinates(B2)
How do I link coordinates from Excel to Google Maps? ›- Locate your data in Maptitude. ...
- Make sure your new layer is the working layer.
- Export to Google My Maps using File>Export>Geography, making sure to choose either “KML (Google Earth Document)” or “KMZ (Google Earth Compressed Document)” and click OK.
Import GPS Data
Drag the file into Google Earth. Choose how you want the data displayed.To save the data, drag the file into the "My Places" folder.
- Step 1: Multiply (×) the "degrees" by 60.
- Step 2: Add (+) the "minutes"
- Step 3: If the Latitude (Longitude) degrees are S (W) use a minus sign ("-") in front. ...
- Step 4: Subtract Reference Location converted to Minutes.
- Open Google Earth Pro.
- Draw a path or open an existing path.
- Click Edit. Show Elevation Profile.
- An elevation profile will appear in the the lower half of the 3D Viewer. If your elevation measurement reads "0," make sure the terrain layer is turned on.
- Copy the GPS data from a spreadsheet: The lat long points can be in separate or the same column, separated by a comma. ...
- Go to Mapize.com. ...
- Click “Create Map.”
The Geolocation API is a service that accepts an HTTPS request with the cell tower and WiFi access points that a mobile client can detect. It returns latitude/longitude coordinates and a radius indicating the accuracy of the result for each valid input.
How do I use Google API? ›- Go to the Google Cloud console API Library.
- From the projects list, select the project you want to use.
- In the API Library, select the API you want to enable. If you need help finding the API, use the search field and/or the filters.
- On the API page, click ENABLE.
- On your Android phone or tablet, open Google Maps mobile web or the Google Maps app .
- Find the location where you want to get a Plus Code. ...
- At the bottom, tap the “Dropped pin” panel.
- Find the Plus Code beside the Plus Code logo . ...
- To copy a location's code, tap the Plus Code .
- Go to the API Console.
- From the projects list, select a project or create a new one.
- If the APIs & services page isn't already open, open the console left side menu and select APIs & services, and then select Library.
- Click the API you want to enable. ...
- Click ENABLE.
What is the alternative to Google Maps Geolocation API? ›
- Mapbox.
- Apple Maps.
- Bing Maps.
- HERE Maps.
- Open Street Map.
- MapQuest.
- TomTom.
- OpenLayers.
The Geolocation API is accessed via a call to navigator.geolocation ; this will cause the user's browser to ask them for permission to access their location data. If they accept, then the browser will use the best available functionality on the device to access this information (for example, GPS).
What are the requirements for Google API? ›- New apps and app updates must target API level 33 to be submitted to Google Play (Wear OS must target API 30)
- Existing apps must target API level 31 or above to remain available to users on devices running Android OS higher than your app's target API level.
Google APIs are application programming interfaces (APIs) developed by Google which allow communication with Google Services and their integration to other services. Examples of these include Search, Gmail, Translate or Google Maps.
How many types of Google API are there? ›Divided into three major categories, Maps, Places, and Routes, the different APIs exist to fulfil the precise need of your business.
How do I add a geo location to Google? ›Drop a pin directly on the map to mark a location. Let the “find my location” option drop a pin for them. Type an address in the search box and choose from the list of results (when they select one, a pin will be dropped on the map)
What can I do with Google API key? ›API keys are useful for accessing public data anonymously, and are used to associate API requests with the consumer Google Cloud project for quota and billing. API Keys provides you a programmatic interface to create and manage API keys for your project.
Why was Google API shut down? ›Google said it discovered another critical security vulnerability in one of Google+'s People APIs that could have allowed developers to steal private information on 52.5 million users, including their name, email address, occupation, and age.
How to create API in Google script? ›- Step 1: Open a new Sheet. ...
- Step 2: Go to the Apps Script editor. ...
- Step 3: Name your project. ...
- Step 4: Add API example code. ...
- Step 5: Run your function. ...
- Step 6: Authorize your script. ...
- Step 7: View the logs. ...
- Step 8: Add data to Sheet.