Skip to main content

Search Products

Mapbox provides a full suite of products and services that enable you to add location-based search to your applications or data projects. These products include front-end search libraries and SDKs for web and mobile applications, as well as web services APIs for integration into any environment.

In this guide, you'll learn about common search UX patterns and the Mapbox search products and services that support them. You'll also find links to documentation, code examples, and API playgrounds to help you get started with location-based search.

Search UX Patterns

Below you can find common user experience patterns related to location-based search that you can implement in your applications using Mapbox products and services.

Interactive text search combined with an interactive map is the most common location search pattern for web and mobile applications. A floating search box allows users to search for points of interest, locations, and addresses. When a search result is selected, the map flies to its location and displays a marker.

Type in the search box to test it out. Results are biased towards New York City.

The demo integrates Mapbox Search JS (powered by the Search Box API) with the Mapbox GL JS library for rendering interactive maps.

Category search allows users to search for points of interest (POIs) by category, such as restaurants, hotels, or parks. These are usually connected to the map to search for category matches in the current viewport or near the user's location.

Click a category to see the search results. Results are biased to the center of the map. You can try moving to a different location and searching again.

Coordinate Search (reverse geocoding)

Coordinate search, also known as reverse geocoding, allows users to search for addresses or points of interest by entering coordinates. This is useful for applications that need to display location information based on a user's current location or a selected point on a map.

Drag the marker to a new location to request a Coordinate Search result for nearby points of interest (POIs). The result's name property will be displayed in the panel at the top left of the map.

Address Autocomplete

Address Autocomplete is the auto-filling and validating of address forms in web and mobile apps (also referred to as Address Autofill or Address Form Fill). Address autocomplete is a common feature in e-commerce, delivery, and other applications that require users to enter addresses, and helps prevent errors and improve the user experience.

Try address autofill using a live example in the Mapbox Search JS documentation:

EXAMPLE
Address Autofill Example

Try address autofill in a simulated online checkout experience.

To get started with address autocomplete, see the guide for your platform:

GUIDE
Address Autofill

Learn about address autofill in Mapbox Search JS.

GUIDE
Address Form Fill

Learn about address form fill in an iOS application.

GUIDE
Address Autofill

Learn about address autofill in an Android application.

Frontend search products

Mapbox provides front-end search products for web and mobile applications. These products interact with the Mapbox Search APIs behind the scenes and provide standard user interface components that make it easier to add search functionality to applications with minimal effort.

Mapbox Search JS

Mapbox Search JS is a JavaScript library that provides a search box for use in web applications. The package includes React components as well as web components and is applicable in any web development environment. The search box provides autocomplete suggestions as users type, and displays search results on a map.

To get started with Mapbox Search JS, see its documentation and code examples.

EXAMPLE
Add Search Box to a Web Map

View sample code for adding a search box to a web map using Mapbox Search JS.

Search SDK for Android

The Mapbox Search SDK for Android is a software development kit (SDK) that provides a search box for use in Android applications. The search box provides autocomplete suggestions as users type, and displays search results on a map.

To get started with the Maps SDK for Android, see its documentation and code examples.

EXAMPLE
Basic search + Maps SDK integration

Add search UI to a map in an Android application.

Search SDK for iOS

The Search SDK for iOS is a software development kit (SDK) that provides a search box for use in iOS applications. The search box provides autocomplete suggestions as users type, and displays search results on a map.

To get started with the Maps SDK for iOS, see its documentation and code examples.

EXAMPLE
Search UI SDK and Maps SDK integration

Add a drop-in search UI to a Mapbox map in an iOS application.

These front-end search products may also include "core" APIs, interfaces that allow you to interact with the search functionality programmatically and bring your own user interface components. See search wrappers section below.

Frontend Search Product Pricing

Pricing for frontend search products is based on usage of the underlying search APIs. See the Search API Pricing section below for more information.

Search APIs

Mapbox has two web services APIs for searching locations and addresses: the Search Box API and the Geocoding API. You can access these APIs from any environment that can make HTTP requests, such as web browsers, mobile applications, and server-side code.

The differences between the Search Box API and the Geocoding API are subtle, but important. The Search Box API includes points of interest (POIs) in its results, while the Geocoding API does not. The Geocoding API also supports both permanent and temporary geocoding requests, batch processing, and structured input.

FeatureSearch Box APIGeocoding API
Includes Points of Interest (POIs)checkclose
Session-based billingcheckclose
Permanent Storage Allowed*closecheck
Batch Processingclosecheck
Structured Inputclosecheck

* Permanent geocoding incurs higher costs than temporary geocoding. See the Mapbox Pricing Page for details.

Search Box API

The Search Box API supports interactive search, category search, forward search, and reverse search. Search Box API responses can include addresses, places, and points of interest (POIs). The typical use case for the Search Box API is to provide search suggestions as users type in a search box, and to retrieve detailed information about a selected search result.

Search TypeDescription
Interactive SearchProvides autocomplete search suggestions, intended for use as a user types in a search input.
Category SearchSearches for points of interest (POIs) by category.
Forward SearchConverts a full search query to a list of matching locations (intended for non-interactive search input)
Reverse SearchConverts coordinates to a list of matching locations.

To get started with the Search Box API, see its reference documentation or explore its API Playgrounds:

PLAYGROUND
Search Box API Playground - Suggest and Retrieve

Experiment with parameters and see response data for the /suggest and /retrieve endpoints of the Search Box API.

PLAYGROUND
Search Box API Playground - Forward and Reverse

Experiment with parameters and see response data for the /forward and /reverse endpoints of the Search Box API.

Geocoding API

The Geocoding API supports non-interactive geocoding of addresses and reverse geocoding of coordinates. The typical use case for the Geocoding API is to enrich your data with location information (for example, batch geocoding to add point coordinates to a list of addresses), or to power other location-based services.

Note

The Geocoding API does not include points of interest (POIs) in its results. If you need to search for POIs, use the Search Box API instead.

To get started with the Geocoding API, see its reference documentation or try its API Playground:

PLAYGROUND
Geocoding API Playground

Experiment with request parameters for the Geocoding API using a graphical interface, and inspect the API response object.

Address Autocomplete

Since address autocomplete is a frontend-specific feature, it is intended to be accessed via the frontend search products listed above and is not available as a separate web API.

Wrapping Libraries

You can use Mapbox Search APIs directly, but you can also use one of several wrapper libraries to integrate them into applications across platforms. These libraries provide a more convenient way to interact with the APIs and may include additional features or functionality.

  • Mapbox Search JS - Use Search JS Core to interact with both the Search Box API and Geocoding API in a web or node.js environment.
  • Mapbox Search SDK for iOS - Use the Search Core module for iOS to interact with the Search Box API and Geocoding API in an iOS environment.
  • Mapbox Search SDK for Android - Use the Search Core module for Android to interact with the Search Box API and Geocoding API in an Android environment.

Other use cases

  • Bulk Geocoding - Convert a list of addresses to coordinates in a single HTTP POST request to the Geocoding API.
  • Address Validation - Validate user-entered addresses to clean up data and prevent errors.
  • GPS Trace Lookup - Use reverse geocoding to convert GPS coordinates from vehicles to human-readable addresses.
  • Discover Administrative Boundaries - Reverse geocode coordinates to find the city, state, and country where a user point is located.

Search API Pricing

Pricing for search APIs depends on the product and type of request.

The Search Box API's interactive search (using the suggest and retrieve endpoints) is session-based. A single user making multiple requests in a short period of time is considered a single session. The Search Box API's forward and reverse search endpoints are not session-based, so each request is billed separately.

All Geocoding API requests are billed separately, but temporary versus permanent geocoding requests are priced differently.

For full details, see the Mapbox Pricing page.

Was this page helpful?