3 Ways to reduces your Place API cost

fahmi sidikfahmi sidik
4 min read

If your app relies on Google Maps' Place Autocomplete and Place Details APIs, you might be surprised how quickly the billing can add up. These APIs are powerful—but without a few key optimizations, they can quietly burn through your budget.

In this post, I’ll share three essential techniques to drastically reduce your usage costs while still delivering a seamless user experience:

  1. Use Session Tokens correctly

  2. Debounce Autocomplete requests to control unnecessary calls

  3. Specify FieldMask in Place Details

Let’s break it down.


1. Use Session Tokens for Autocomplete + Place Details

A session token groups a user's Autocomplete queries and the final Place Details lookup into a single logical session. When used properly, all Autocomplete calls within that session are free—as long as they are concluded with a corresponding Place Details request using the same token.

🔍 According to Google’s documentation:
"As the user types a query, an autocomplete request is called every few keystrokes (not per-character), and a list of possible results is returned. When the user makes a selection from the result list, the selection counts as a request, and all of the requests made during the search are bundled and counted as a single request. If the user selects a place, the search query is available at no charge, and only the Place data request is charged. If the user does not make a selection within a few minutes of the beginning of the session, only the search query is charged."

💸 How It Affects Billing

  • All Autocomplete calls made with the same session token are free

  • 🔁 Only if the session ends with a Place Details request using the same token

  • ❌ If no Place Details request is made, all prior Autocomplete requests are billed as per request

✅ Best Practice

  • Generate a session token before the user starts typing

  • Attach that token to all Autocomplete requests

  • Reuse the token in the final Place Details API call (on user selection)

  • Generate a new token for the next search session

Used correctly, session tokens can eliminate Autocomplete API costs for standard search flows.


2. Debounce Your Autocomplete Requests

Even with session tokens, firing off requests too aggressively can:

  • Add unnecessary network latency

  • Consume API quotas

  • Risk billing if no Place Details lookup follows

That’s where debouncing comes in.

🔍 What Is Debouncing?

Debouncing limits how often a function is executed. For Autocomplete, this means waiting until the user stops typing briefly before sending a request.

Without debouncing:

  • User types "c" → 1 request

  • Then "ca" → another request

  • Then "caf" → another request

  • Result: 10+ requests per user input

With debouncing:

  • Wait until the user pauses (e.g., 300–500ms)

  • Send only one or two smart requests total

⚠️ Important Note on Billing

If the session token is not used to make a Place Details request, all previous Autocomplete requests in that session are billed as normal.


3. Always Specify a FieldMask in Place Details

Once a user selects a place from Autocomplete, your app typically makes a Place Details API request. If you don’t specify a fields parameter, Google assumes you want everything—which triggers the highest billing tier.

💸 If you omit the fields parameter, the request defaults to "all fields", resulting in maximum billing.

✅ Always Use fields=...

Example:
https://maps.googleapis.com/maps/api/place/details/json?placeid=XYZ&fields=place_id,name,geometry&key=YOUR_API_KEY

This limits your request to just what you need—and ensures you're only billed for the relevant tier.


🧾 Fields vs Pricing Tier in Place Details API

Here’s a helpful reference to understand which fields belong to which pricing tier:

Field (or Field Group)Pricing TierNotes
place_idBasicUnique identifier; useful for caching or referencing later
nameBasicName of the place
geometry/locationBasicLatitude & longitude
typesBasicCategory of the place
formatted_addressBasicPre-formatted display address
url, icon, vicinityBasicVisual or location context
business_statusBasicOperational status
opening_hoursContactIncludes current status and weekday text
formatted_phone_numberContactLocalized phone number
international_phone_numberContactInternational format
websiteContactOfficial place website
rating, user_ratings_totalAtmosphereReview count and average rating
reviewsAtmosphereFull review data (text, author, rating, etc.)
photosAtmosphereList of photo references (not the image files themselves)
price_levelAtmospherePrice range (e.g., $ to )
address_componentsAtmosphereStructured breakdown (street, city, postal code, etc.)

💡 Reminder: If you include any field from a higher tier, the entire request is billed at that tier.


TL;DR

  • ✅ Use a session token to group Autocomplete + Place Details and unlock free autocomplete calls

  • Debounce Autocomplete to reduce unnecessary requests and ensure sessions are concluded properly

  • ✅ Use FieldMask to avoid full-tier billing on Place Details

Small changes. Huge savings.

0
Subscribe to my newsletter

Read articles from fahmi sidik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

fahmi sidik
fahmi sidik

Mobile-Focused Software Engineer with combined 10 years of experience in Android, iOS, Flutter, and CI/CD. I have worked on feature development, performance optimization, native to Flutter migration, automation, and developer toolings.