API
Use the API directly when your team wants complete control over request handling and rendering.
View API pageLocation autocomplete widget
Add a polished city, region, and country autocomplete field without building result rows, keyboard behavior, or mobile search UI from scratch.
Use the API directly when your team wants complete control over request handling and rendering.
View API pageAttach PlaceField results to your existing input and keep full control over surrounding UI.
Copy Basic JSShip bundled field styling, result rows, clear button behavior, and optional fullscreen mobile search.
Copy Full WidgetThe widget is built for location fields that should store city, region, and country data. It avoids address-result clutter and does not introduce a map into your form.
Use public browser keys with exact origin allowlists, and keep server keys behind your backend when you call the API yourself. For copyable starter code, see the public examples repository.
PlaceField.widget("#city", {
endpoint: "https://api.placefield.dev/v1/locations/autocomplete",
key: "pf_pub_xxx",
geoBias: "country",
mobile: "fullscreen"
});
Use the lightweight attach script for your own UI, or the full widget when you want a complete location autocomplete field.
Autocomplete behavior attached to an input you style yourself.
Bundled field styling, clear button, and richer result rows.
Optional focused mobile mode for forms where completion quality matters.
Share the form, site, and whether you want Basic JS, the Full Widget, or both.