1. places.js
🌐 Turn any <input> into an address autocomplete.
places.js
Package: places.js
Created by: algolia
Last modified: Thu, 11 Apr 2024 07:48:46 GMT
Version: 1.19.0
License: MIT
Downloads: 116,506
Repository: https://github.com/algolia/places

Install

npm install places.js
yarn add places.js

header

Version Build Status License Downloads jsDelivr Hits

Algolia Places provides a fast, distributed and easy way to use an address search autocomplete JavaScript library on your website.

See the website for more information.

Read the blog post introducing Algolia Places.

Fill the Google form to report any irrelevant results.

Demo

Watch more examples on the website.

demo

Getting started

To use Algolia Places, all you need is an <input> and some JavaScript code that will load
and use the places.js library.

CDN <script>

Our JavaScript library is available on the jsDelivr CDN and also on cdnjs.

 <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Version is the latest version.

Here's a small example using it:

 <input type="search" id="address-input" placeholder="Where are we going?" />

<script>
  var placesAutocomplete = places({
    appId: <YOUR_PLACES_APP_ID>,
    apiKey: <YOUR_PLACES_API_KEY>,
    container: document.querySelector('#address-input')
  });
</script>

Using npm

Algolia Places is also available on npm.

Install the module:

 npm install places.js --save

Put an <input> in your html page:

 <input type="search" id="address-input" placeholder="Where are we going?" />

Initialize the places.js library:

 var places = require('places.js');
var placesAutocomplete = places({
  appId: <YOUR_PLACES_APP_ID>,
  apiKey: <YOUR_PLACES_API_KEY>,
  container: document.querySelector('#address-input')
});

Full documentation is available on the Algolia Places website.

Contributing

Wanna contribute? Awesome, please read the contributing guide.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code