Skip to content

places: migrate Google Places API from legacy to Places API (New)#127

Merged
asim merged 2 commits intomainfrom
copilot/fix-places-search-failure
Feb 22, 2026
Merged

places: migrate Google Places API from legacy to Places API (New)#127
asim merged 2 commits intomainfrom
copilot/fix-places-search-failure

Conversation

Copy link
Contributor

Copilot AI commented Feb 22, 2026

The legacy Google Places API (maps.googleapis.com/maps/api/place) is deprecated and new API keys return REQUEST_DENIED, causing all places search and nearby queries to fail with "search failed".

Changes

  • New endpoints: places.googleapis.com/v1/places:searchNearby and :searchText
  • Auth: X-Goog-Api-Key header instead of key= query param
  • Transport: POST with JSON body instead of GET with query params
  • Field selection: X-Goog-FieldMask header to limit response payload
  • Response structs: Updated to new shape — places[], displayName.text, location.latitude/longitude, primaryType, formattedAddress, nationalPhoneNumber, websiteUri

Before (legacy)

// GET https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=...&key=...
req, _ := http.NewRequest("GET", apiURL, nil)

After (Places API New)

// POST https://places.googleapis.com/v1/places:searchNearby
req, _ := http.NewRequest("POST", apiURL, bytes.NewReader(bodyBytes))
req.Header.Set("X-Goog-Api-Key", key)
req.Header.Set("X-Goog-FieldMask", googleFieldMask)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: asim <17530+asim@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix places search or nearby query failure places: migrate Google Places API from legacy to Places API (New) Feb 22, 2026
Copilot AI requested a review from asim February 22, 2026 14:51
@asim asim marked this pull request as ready for review February 22, 2026 14:51
@asim asim merged commit f871a47 into main Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants