# Google Geocoding API

[Google map api官方連結](https://cloud.google.com/maps-platform/?hl=en)

要使用Google Geocoding API，除了擁有Google帳號以外，還要創建新Project，然後在這個project中啟動這個API的使用權限，並且取得API token，接下來的API call把這個token放在URL中就可以獲得資訊了。

創建Project的部分就不說了，[官方說明文件在此](https://developers.google.com/maps/gmp-get-started)。

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BK_wq6Wl0JDqkRYjo%2FScreen%20Shot%202020-04-05%20at%2012.21.53%20PM.png?alt=media\&token=3ac2ba76-3e25-4d2a-99a0-6db1d2b470b9)

## Enable Geocoding API <a href="#get-an-api-key" id="get-an-api-key"></a>

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BMDCD-qas8v7LnNLf%2FScreen%20Shot%202020-04-05%20at%2012.54.24%20PM.png?alt=media\&token=734311e7-ac68-484b-b002-73c176f8e1da)

## [Get an API Key](https://developers.google.com/maps/documentation/geocoding/get-api-key) <a href="#get-an-api-key" id="get-an-api-key"></a>

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BMPS8tj99vt2JMpcE%2FScreen%20Shot%202020-04-05%20at%2012.26.22%20PM.png?alt=media\&token=af48ab96-f97f-45ea-89d9-7ba1d4ec1873)

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BMatcOWNuPwYxh0P7%2FScreen%20Shot%202020-04-05%20at%2012.26.56%20PM.png?alt=media\&token=a76adac6-aecc-4e0b-8d32-c254f6d9f702)

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BMkj_TBdSSDohWMmJ%2FScreen%20Shot%202020-04-05%20at%2012.27.14%20PM.png?alt=media\&token=e018b688-a9bc-49fb-b3e4-3c76836046e5)

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BNRiW_BNEf-sCPq2P%2FScreen%20Shot%202020-04-05%20at%203.05.20%20PM.png?alt=media\&token=c26a3ec0-ec2c-4c52-883c-247c80ba2f24)

## [Geocoding API Request](https://developers.google.com/maps/documentation/geocoding/intro#GeocodingRequests)

```
Example:
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY
```

![](https://2387071138-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2vWCT8lbIfip1tMlDx%2F-M4ArgA6msD5vpELdk2E%2F-M4BO-jBBLvtENYPGldc%2FScreen%20Shot%202020-04-05%20at%2012.55.03%20PM.png?alt=media\&token=eb73ae25-cc3e-48ce-993d-9ecd787a39c0)
