Using the Google Maps Client Library for Go in AppEngine

The default HTTP transport implementation for Go isn’t supported when running in AppEngine. Trying to use it will result in the following error:

http.DefaultTransport and http.DefaultClient are not available in App Engine. See

To fix this, you need to use the http.Client implementation from AppEngine’s urlfetch package (imported from

uc := urlfetch.Client(ctx)

options := []maps.ClientOption {

c, err := maps.NewClient(options...)
if err != nil {

nsr := &maps.NearbySearchRequest{
    Location: &maps.LatLng {
        Lat: latitude,
        Lng: longitude,
    Radius: radius,
    OpenNow: true,
    RankBy: maps.RankByProminence,
    Type: maps.PlaceTypeRestaurant,

psr, err := c.NearbySearch(ctx, nsr)
if err != nil {