The Ultimate Google Places Autocomplete JavaScript Library
A flexible, accessible, and secure vanilla JavaScript library that brings the power of Google's address search to your application in minutes.
Powerful Features Out of the Box
Fully Accessible
Follows WAI-ARIA patterns with full keyboard navigation.
Secure
Safely renders suggestions to protect against XSS attacks.
Cost-Effective
Automatically handles session tokens to manage API costs.
Debounced Input
Limits API calls while the user is typing to save requests.
Customisable
Easily override styles or provide your own using props.
TypeScript Ready
Fully written in TypeScript with included type definitions.
Looking for a Svelte Solution?
The core logic of this library is also available as a Svelte Component, places-autocomplete-svelte. It provides the same robust features for any web application.
Live Demo
This example shows the component in action. Start typing an address to see live suggestions, and select a place to view the detailed response data.
Getting Started
This library can be used in two primary ways: by installing it as an npm package for use with a bundler (like Vite or Webpack), or by linking to it directly from a CDN in a static HTML file.