Skip to content

Google Map APIs

Sean Zhou edited this page Sep 24, 2024 · 2 revisions

Google Places API - Nearby Search

Link

Format:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=<Replace-With-API-Key>&location=-37.79692,144.9615867&radius=1000&type=restaurant

Where output may be either of the following values:

  • json (recommended) indicates output in JavaScript Object Notation (JSON)
  • xml indicates output as XML

Possible params: \

Required:

  • location: This must be specified as latitude,longitude (e.g. -37.3456,123.2356).
  • radius
  • key: Google Map API Key

Optional:

  • keyword
  • maxprice
  • minprice
  • type

Google Distance Matrix API

Link

Format

https://maps.googleapis.com/maps/api/distancematrix/json?key=<Replace-With-API-Key>&origins=-37.7976,144.9699&destinations=-37.7989,144.9685|-37.8002,144.9667

Possible params

Required:

  • destinations
  • origins

both destinations and origins could use lantitude and langitude tuple(s), multiple origins and destinations acceptable.

Optional:

  • arrival_time
  • departure_time
  • mode: driving(default)|walking|bicycling|transit

Google Map Photos API

Link

Format

https://maps.googleapis.com/maps/api/place/photo?key=<Replace-With-API-Key>&maxwidth=400&photo_reference=<Replace-With-Photo-Reference>

Possible params:

Required:

  • photo_reference: You can get this from Places API
  • maxheight or maxwidth: (unit: px)

NOTE: All these APIs must be used with an API Key!

Architecture

Clone this wiki locally