<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Erwin Soekianto</title>
    <description>The latest articles on DEV Community by Erwin Soekianto (@erwin_soekianto).</description>
    <link>https://dev.to/erwin_soekianto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3963414%2Fabcd7e97-2b64-4bf3-ad1b-3cb6737e399d.JPG</url>
      <title>DEV Community: Erwin Soekianto</title>
      <link>https://dev.to/erwin_soekianto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erwin_soekianto"/>
    <language>en</language>
    <item>
      <title>Understanding the `near` Parameter in Mapbox's Search Box API</title>
      <dc:creator>Erwin Soekianto</dc:creator>
      <pubDate>Fri, 07 Aug 2026 15:31:17 +0000</pubDate>
      <link>https://dev.to/mapbox/understanding-the-near-parameter-in-mapboxs-search-box-api-4jk7</link>
      <guid>https://dev.to/mapbox/understanding-the-near-parameter-in-mapboxs-search-box-api-4jk7</guid>
      <description>&lt;p&gt;AI assistants and conversational search are changing how users search for places. Instead of typing an address or dropping a pin, users increasingly ask questions like "Find coffee near the Eiffel Tower" or "Harold Chicken Shack in Chicago." The new &lt;strong&gt;&lt;code&gt;near&lt;/code&gt;&lt;/strong&gt; parameter in the &lt;a href="https://docs.mapbox.com/api/search/search-box/" rel="noopener noreferrer"&gt;Mapbox Search Box API&lt;/a&gt; — introduced alongside the new &lt;a href="https://www.mapbox.com/blog/introducing-the-mapbox-places-api" rel="noopener noreferrer"&gt;Mapbox Places API&lt;/a&gt; (announced July 27, 2026) — makes these natural-language searches easier to implement, by removing the need for a separate geocoding request before you can search.&lt;/p&gt;

&lt;p&gt;In this post, we'll break down what &lt;code&gt;near&lt;/code&gt; does, why it exists, and how it stacks up against the other location-narrowing parameters Search Box already offers: &lt;code&gt;proximity&lt;/code&gt; and &lt;code&gt;bbox&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem &lt;code&gt;near&lt;/code&gt; solves
&lt;/h2&gt;

&lt;p&gt;Traditionally, if you wanted to search for "Harold Chicken Shack" close to Chicago using the &lt;code&gt;/forward&lt;/code&gt; endpoint, you had two separate jobs to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Put the search term in &lt;code&gt;q&lt;/code&gt; — e.g. &lt;code&gt;q=Harold Chicken Shack&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Tell the API &lt;em&gt;where&lt;/em&gt; to look using &lt;a href="https://docs.mapbox.com/api/search/search-box/#search-request" rel="noopener noreferrer"&gt;&lt;code&gt;proximity&lt;/code&gt; or &lt;code&gt;bbox&lt;/code&gt;&lt;/a&gt; — which meant you needed actual coordinates or a bounding box, not just the word "Chicago"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That works fine for map UIs where you already know the user's location or have a pin on a map. But it breaks down for &lt;strong&gt;AI-driven or chat-style search&lt;/strong&gt;, where a user might just type or say "Harold Chicken Shack in Chicago" — a name and a place, mixed together in plain English, with no coordinate pair in sight. That's the gap &lt;code&gt;near&lt;/code&gt; closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How &lt;code&gt;near&lt;/code&gt; works
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;near&lt;/code&gt; accepts either a place-name string (like &lt;code&gt;Chicago&lt;/code&gt;, or a broader anchor like &lt;code&gt;California&lt;/code&gt;) or an explicit coordinate pair — whichever you have on hand — alongside your search term in &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;near&lt;/code&gt; is a convenience layer.&lt;/strong&gt; When you pass a place name, it first resolves that name via the geocoder's own &lt;code&gt;/forward&lt;/code&gt;, then automatically applies the result to your Search Box query. If you pass coordinates directly, &lt;code&gt;near&lt;/code&gt; skips the geocoding step and applies them the same way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The resolution follows a defined hierarchy based on how coarse or fine the anchor is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;
&lt;code&gt;near&lt;/code&gt; value&lt;/th&gt;
&lt;th&gt;Resolves to&lt;/th&gt;
&lt;th&gt;Effect on &lt;code&gt;q&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Raw &lt;code&gt;lon,lat&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Parsed directly&lt;/td&gt;
&lt;td&gt;Proximity point&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Country (e.g. &lt;code&gt;United States&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Geocoded to a country&lt;/td&gt;
&lt;td&gt;Bounding box + country filter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Region / state (e.g. &lt;code&gt;California&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Geocoded to a region&lt;/td&gt;
&lt;td&gt;Bounding box&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Place / locality (e.g. &lt;code&gt;Chicago&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Geocoded to a place&lt;/td&gt;
&lt;td&gt;Proximity point&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Neighborhood / address / POI (e.g. &lt;code&gt;Eiffel Tower&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Geocoded to a fine feature&lt;/td&gt;
&lt;td&gt;Proximity point&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In other words: countries and regions/states constrain results by &lt;code&gt;bbox&lt;/code&gt;; everything finer than that (cities, neighborhoods, addresses, landmarks) biases results by &lt;code&gt;proximity&lt;/code&gt; — which is why a strongly relevant result just outside the anchor can still appear (this is intentional and desirable). Country-level anchors get one thing regions don't: on top of the bbox, near also applies the dedicated country parameter (an ISO 3166-1 alpha-2 code, like US).&lt;/p&gt;

&lt;p&gt;One more mechanical detail worth knowing: if you pass both &lt;code&gt;near&lt;/code&gt; and &lt;code&gt;proximity&lt;/code&gt; in the same request, &lt;code&gt;near&lt;/code&gt; takes precedence — it overrides &lt;code&gt;proximity&lt;/code&gt;, and promotes whatever &lt;code&gt;proximity&lt;/code&gt; value you'd set to &lt;code&gt;origin&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;Worth noting: passing something coarser, like &lt;code&gt;near=California&lt;/code&gt;, is broad enough to constrain results with a &lt;code&gt;bbox&lt;/code&gt; instead of just biasing them. Which behavior you get depends on how specific or coarse the anchor is, per the table above.&lt;/p&gt;

&lt;p&gt;Here's what that manual, two-step process actually looks like without &lt;code&gt;near&lt;/code&gt; — first geocoding "Chicago" via &lt;a href="https://docs.mapbox.com/api/search/geocoding/" rel="noopener noreferrer"&gt;Geocoding v6&lt;/a&gt; &lt;code&gt;/forward&lt;/code&gt;, then passing the resulting coordinates into Search Box as &lt;code&gt;proximity&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;# Step 1: geocode "Chicago" to get coordinates
https://api.mapbox.com/search/geocode/v6/forward?q=Chicago&amp;amp;access_token=YOUR_MAPBOX_ACCESS_TOKEN
# → returns coordinates around -87.6298,41.8781

# Step 2: pass those coordinates into Search Box as proximity
https://api.mapbox.com/search/searchbox/v1/forward?q=Harold%20Chicken%20Shack&amp;amp;proximity=-87.6298,41.8781&amp;amp;access_token=YOUR_MAPBOX_ACCESS_TOKEN
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;near&lt;/code&gt;, both of those become a single request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;https://api.mapbox.com/search/searchbox/v1/forward?q=Harold%20Chicken%20Shack&amp;amp;near=Chicago&amp;amp;access_token=YOUR_MAPBOX_ACCESS_TOKEN
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same result, one less network round trip.&lt;/p&gt;

&lt;p&gt;This is also the connective tissue between Search Box and the new &lt;strong&gt;Places API&lt;/strong&gt;. The typical flow now looks like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send a Search Box &lt;code&gt;/forward&lt;/code&gt; query that includes &lt;code&gt;near&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Get back a &lt;code&gt;mapbox_id&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Feed that ID into the Places API's Details endpoint to pull the full enriched record (hours, photos, busyness, attributes, etc.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One more thing worth knowing: &lt;code&gt;near&lt;/code&gt; isn't limited to &lt;code&gt;/forward&lt;/code&gt; — it's also supported on &lt;code&gt;/suggest&lt;/code&gt; and &lt;code&gt;/category&lt;/code&gt; with identical resolution semantics (it's not available on &lt;code&gt;/retrieve&lt;/code&gt; or &lt;code&gt;/reverse&lt;/code&gt;). So this same pattern applies whether you're building autocomplete, one-shot search, or category browse.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where this fits in a real product
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foq65p22v07glf1lmbswo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foq65p22v07glf1lmbswo.png" alt="Two ways near gets used: structured UI vs conversational/AI input requiring upstream decomposition" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's worth being explicit about something the API itself doesn't tell you: &lt;code&gt;near&lt;/code&gt; doesn't do any natural-language parsing. It only resolves a location string (or coordinates) that's already been isolated — it doesn't pull "Harold Chicken Shack" and "Chicago" apart out of a single sentence for you. That separation has to happen &lt;em&gt;before&lt;/em&gt; you ever call the Search Box API, and whose job that is depends on where your input is coming from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Structured UI&lt;/strong&gt; — a traditional search box with a separate location field, a map pin, a "search near me" button, a saved address. Here you already have the two pieces separately (no parsing needed) — you just pass them straight into &lt;code&gt;q&lt;/code&gt; and &lt;code&gt;near&lt;/code&gt; as-is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conversational or AI-driven input&lt;/strong&gt; — a chatbot, voice assistant, or LLM-powered search bar where the user hands you one freeform sentence. Here, something upstream of your Search Box call — an LLM prompt, an NLU/intent-extraction step, or simpler pattern matching for known formats — has to do the decomposition shown below. &lt;code&gt;near&lt;/code&gt; doesn't replace that step; it's the thing you call &lt;em&gt;after&lt;/em&gt; it, so you're not also manually geocoding the location piece yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Splitting a natural-language query into &lt;code&gt;q&lt;/code&gt; and &lt;code&gt;near&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;If the input you're working with is a single fused string — the kind an AI assistant or chat interface might hand you, like &lt;code&gt;"Loyola University Chicago, Chicago, IL, USA"&lt;/code&gt; — you'll need to decompose it yourself before calling the API. The rule of thumb: put the &lt;strong&gt;specific entity&lt;/strong&gt; (the POI, brand, or category) in &lt;code&gt;q&lt;/code&gt;, and put the &lt;strong&gt;administrative tail&lt;/strong&gt; (the part that only disambiguates &lt;em&gt;where&lt;/em&gt; — city, state, country) in &lt;code&gt;near&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Original string&lt;/th&gt;
&lt;th&gt;&lt;code&gt;q&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;near&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Black Hills National Forest, SD, USA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Black Hills National Forest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SD, USA&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Mount Hood, Oregon, USA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Mount Hood&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Oregon, USA&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;coffee in Portland Oregon&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;coffee&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Portland Oregon&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same decomposition applies on &lt;code&gt;/suggest&lt;/code&gt; (with a partial query in &lt;code&gt;q&lt;/code&gt; as the user types). On &lt;code&gt;/category&lt;/code&gt; there's no &lt;code&gt;q&lt;/code&gt; to decompose at all — the category lives in the path, and &lt;code&gt;near&lt;/code&gt; carries the location intent on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;near&lt;/code&gt; vs. &lt;code&gt;proximity&lt;/code&gt; vs. &lt;code&gt;bbox&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Search Box already gave you several ways to make a search location-aware. Here's how &lt;code&gt;near&lt;/code&gt; fits alongside them.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;proximity&lt;/code&gt; — bias, don't restrict
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;proximity&lt;/code&gt; doesn't filter anything out. It &lt;strong&gt;biases ranking&lt;/strong&gt; so that results closer to a given point are favored, while still allowing results further away to appear. You supply it separately from your query, either as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ip&lt;/code&gt; (use the requester's IP-based location), or&lt;/li&gt;
&lt;li&gt;explicit &lt;code&gt;longitude,latitude&lt;/code&gt; coordinates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key distinction: &lt;code&gt;proximity&lt;/code&gt; needs you to already have coordinates. It says "rank things near &lt;em&gt;this point&lt;/em&gt;," where &lt;em&gt;this point&lt;/em&gt; is something your app already knows (user's GPS location, map center, etc.).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;bbox&lt;/code&gt; — a hard rectangular filter
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;bbox&lt;/code&gt; is a strict &lt;strong&gt;inclusion filter&lt;/strong&gt;. Anything outside the box (&lt;code&gt;min_lon,min_lat,max_lon,max_lat&lt;/code&gt;) is excluded outright — it's not a ranking signal, it's a wall. Useful when you know a user is restricted to, say, a specific metro area or map viewport and you never want results from outside it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;near&lt;/code&gt; — resolves to proximity or bbox, depending on the anchor
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;near&lt;/code&gt; accepts a place name or coordinates and resolves them internally into either a &lt;code&gt;proximity&lt;/code&gt; bias or a &lt;code&gt;bbox&lt;/code&gt; filter, depending on how coarse the anchor is: countries and regions/states constrain by &lt;code&gt;bbox&lt;/code&gt;, while places, neighborhoods, addresses, and POIs bias by &lt;code&gt;proximity&lt;/code&gt;. Either way, &lt;code&gt;near&lt;/code&gt; is saving you the manual geocoding lookup you'd otherwise need before calling &lt;code&gt;proximity&lt;/code&gt; or &lt;code&gt;bbox&lt;/code&gt; directly — and if you pass both &lt;code&gt;near&lt;/code&gt; and &lt;code&gt;proximity&lt;/code&gt; together, &lt;code&gt;near&lt;/code&gt; wins, with the old &lt;code&gt;proximity&lt;/code&gt; value shifted to &lt;code&gt;origin&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A sample request and response
&lt;/h2&gt;

&lt;p&gt;Here's a real request/response pair, tested directly against the live API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;https://api.mapbox.com/search/searchbox/v1/forward?q=Harold%20Chicken%20Shack&amp;amp;near=Chicago&amp;amp;access_token=YOUR_MAPBOX_ACCESS_TOKEN
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The (trimmed) response came back as a standard GeoJSON &lt;code&gt;FeatureCollection&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"FeatureCollection"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Feature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"geometry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-87.84130128&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;41.86461828&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Point"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Harold's Chicken Shack"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBvaToxMjI1MjBkMi02MzIyLTQzYjItYmUwMi00MzJhNjBiYzM3ZmU"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"feature_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"poi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"full_address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"713 Roosevelt Rd, Maywood, Illinois 60153, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"place_formatted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Maywood, Illinois 60153, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"poi_category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"american restaurant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"food and drink"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"metadata"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"+17083566048"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"distance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2688893&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Feature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"geometry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-87.56676837&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;41.76573045&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Point"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Harold's Chicken Shack"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"full_address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7114 S Yates Blvd, Chicago, Illinois 60649, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"place_formatted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Chicago, Illinois 60649, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"distance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2709632&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Feature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"geometry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-87.62617297&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;41.87392112&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Point"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Harolds Chicken Shack"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"full_address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"612 S Wabash Ave, Chicago, Illinois 60605, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"place_formatted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Chicago, Illinois 60605, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"brand"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Chicken Shack"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"brand_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"chicken_shack"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"distance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2706643&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"attribution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"© 2026 Mapbox and its suppliers. All rights reserved."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(For reference: &lt;code&gt;distance&lt;/code&gt; is reported in meters — 2,688,893 m ≈ 1,671 mi, 2,709,632 m ≈ 1,684 mi, and 2,706,643 m ≈ 1,682 mi.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All three full results came back within the Chicago metro area. &lt;code&gt;near=Chicago&lt;/code&gt; narrowed the search exactly as you'd want it to, with no out-of-area results.&lt;/p&gt;

&lt;p&gt;Even without an outlier to compare against, the &lt;code&gt;distance&lt;/code&gt; field is still worth flagging: despite all five results being genuinely local to Chicago, &lt;code&gt;distance&lt;/code&gt; came back around 2.69–2.71 million meters (roughly &lt;strong&gt;1,671–1,684 miles&lt;/strong&gt;) for every result. That's consistent with &lt;code&gt;distance&lt;/code&gt; being based on &lt;code&gt;proximity&lt;/code&gt;/IP-derived location rather than on &lt;code&gt;near&lt;/code&gt; — in this case, the default reference point is apparently nowhere near Chicago either. Don't read &lt;code&gt;distance&lt;/code&gt; as a signal for how well &lt;code&gt;near&lt;/code&gt; narrowed things — check &lt;code&gt;place_formatted&lt;/code&gt;/&lt;code&gt;context&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;Worth calling out too: &lt;code&gt;metadata&lt;/code&gt; here is richer than the base parameter reference currently documents. In practice it can include &lt;code&gt;phone&lt;/code&gt;, &lt;code&gt;website&lt;/code&gt;, and a full &lt;code&gt;open_hours.periods&lt;/code&gt; array broken down by day of week — more than the generic "additional metadata" description in the docs suggests. From here, you'd grab &lt;code&gt;mapbox_id&lt;/code&gt; and pass it straight to the Places API's Details endpoint for the even fuller enriched record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Input format&lt;/th&gt;
&lt;th&gt;Filters or just biases?&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;proximity&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ranks closer results higher&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ip&lt;/code&gt; or &lt;code&gt;longitude,latitude&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Biases only&lt;/td&gt;
&lt;td&gt;Map-based apps that already know user location&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bbox&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restricts results to an area&lt;/td&gt;
&lt;td&gt;&lt;code&gt;minLon,minLat,maxLon,maxLat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Hard filter&lt;/td&gt;
&lt;td&gt;Viewport-limited or region-locked search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;near&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Resolves a place name or coordinates, then applies them as &lt;code&gt;proximity&lt;/code&gt; (specific anchors) or &lt;code&gt;bbox&lt;/code&gt; (coarse anchors)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;string&lt;/code&gt; (place name) or coordinates, paired with &lt;code&gt;q&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Both — biases for specific anchors, filters for coarse ones&lt;/td&gt;
&lt;td&gt;Conversational or natural-language search where you don't want to run a separate geocoding call&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  When to reach for which
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Building a classic search box on a map where you already have coordinates ready for &lt;code&gt;proximity&lt;/code&gt; or &lt;code&gt;bbox&lt;/code&gt;? Those parameters take coordinates directly. &lt;code&gt;near&lt;/code&gt; also accepts coordinates and resolves them the same way, so either path works if that's what you have on hand.&lt;/li&gt;
&lt;li&gt;Need a hard boundary, like restricting to a delivery zone or map viewport? Use &lt;code&gt;bbox&lt;/code&gt; directly for full control, though a coarse &lt;code&gt;near&lt;/code&gt; value (like a country or state) can behave similarly.&lt;/li&gt;
&lt;li&gt;Have a search term and a place name — from a chat interface, voice input, or freeform text — and don't want to run a separate geocoding call yourself? That's what &lt;code&gt;near&lt;/code&gt; is built for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For point-like anchors, &lt;code&gt;near&lt;/code&gt; produces the same ranking behavior as &lt;code&gt;proximity&lt;/code&gt; directly — it's a convenience layer, not a separate ranking engine. For coarse anchors, it can behave like &lt;code&gt;bbox&lt;/code&gt; instead. Either way, &lt;code&gt;near&lt;/code&gt; isn't computing something &lt;code&gt;proximity&lt;/code&gt;/&lt;code&gt;bbox&lt;/code&gt; couldn't already do on their own — it's resolving the anchor and choosing the right mechanism for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to expect at the edges
&lt;/h2&gt;

&lt;p&gt;A few error and fallback behaviors worth knowing before you ship this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Response&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;near&lt;/code&gt; omitted or empty&lt;/td&gt;
&lt;td&gt;Falls back to a normal &lt;code&gt;q&lt;/code&gt; search with no anchor — still valid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;near&lt;/code&gt; set to invalid coordinates&lt;/td&gt;
&lt;td&gt;&lt;code&gt;400 Bad Request&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;near&lt;/code&gt; text isn't geocodable&lt;/td&gt;
&lt;td&gt;Graceful fallback — anchor is left unchanged, &lt;code&gt;q&lt;/code&gt; still runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Geocoder temporarily unavailable&lt;/td&gt;
&lt;td&gt;&lt;code&gt;500 Internal Server Error&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It's also worth setting expectations on result quality: in internal testing across categories like national forests, universities, airports, and malls, most &lt;code&gt;near&lt;/code&gt;-anchored queries resolved to the correct region with the intended entity ranked at or near the top — misses were the exception rather than the rule. The residual misses tend to be ranking order (the right result shows up a few slots down) or narrow indexing gaps — not incorrect anchoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;near&lt;/code&gt; gives you a single parameter that resolves a place name or coordinates into either a &lt;code&gt;proximity&lt;/code&gt; bias or a &lt;code&gt;bbox&lt;/code&gt; filter, depending on how specific the anchor is — sparing you a separate geocoding call when all you have is a name or a rough location. It's available on &lt;code&gt;/forward&lt;/code&gt;, &lt;code&gt;/suggest&lt;/code&gt;, and &lt;code&gt;/category&lt;/code&gt;, so this pattern isn't limited to a single query style. &lt;code&gt;bbox&lt;/code&gt; and &lt;code&gt;proximity&lt;/code&gt; remain the direct, explicit tools for when you already know exactly which behavior you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to try it?&lt;/strong&gt; &lt;code&gt;near&lt;/code&gt; is available today in the Search Box API — check the &lt;a href="https://docs.mapbox.com/api/search/search-box/#search-request" rel="noopener noreferrer"&gt;live API reference&lt;/a&gt; for the latest parameter details, or test it directly against the &lt;code&gt;/forward&lt;/code&gt;, &lt;code&gt;/suggest&lt;/code&gt;, and &lt;code&gt;/category&lt;/code&gt; endpoints with your own queries. You can also try it in the &lt;a href="https://docs.mapbox.com/playground/search-box/forward-reverse/?q=harold+chicken+shack&amp;amp;near=chicago&amp;amp;endpoint=forward" rel="noopener noreferrer"&gt;Search Box Playground&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvlgibh1nomrl3yxyzan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvlgibh1nomrl3yxyzan.png" alt="Search Box Playground showing a near query" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mapbox</category>
      <category>api</category>
      <category>geospatial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Did You Know? Mapbox Geocoding API Lets You Filter by Feature Type</title>
      <dc:creator>Erwin Soekianto</dc:creator>
      <pubDate>Tue, 14 Jul 2026 17:04:57 +0000</pubDate>
      <link>https://dev.to/mapbox/did-you-know-mapbox-geocoding-api-lets-you-filter-by-feature-type-3oeb</link>
      <guid>https://dev.to/mapbox/did-you-know-mapbox-geocoding-api-lets-you-filter-by-feature-type-3oeb</guid>
      <description>&lt;p&gt;&lt;em&gt;Episode 1: Geocoding smarter, not harder&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This one's about the &lt;code&gt;types&lt;/code&gt; parameter on the &lt;strong&gt;&lt;a href="https://docs.mapbox.com/api/search/geocoding/#geographic-feature-types" rel="noopener noreferrer"&gt;Mapbox Geocoding API&lt;/a&gt;&lt;/strong&gt; specifically. (The &lt;a href="https://docs.mapbox.com/api/search/search-box/" rel="noopener noreferrer"&gt;Search Box API&lt;/a&gt; has its own &lt;code&gt;types&lt;/code&gt; parameter too, but that's a separate product — this post is just about Geocoding.)&lt;/p&gt;

&lt;p&gt;Say you're building a signup form and just need the &lt;strong&gt;city&lt;/strong&gt; someone typed. Or you're tagging support tickets by &lt;strong&gt;county&lt;/strong&gt; for routing. Or you just want the &lt;strong&gt;state&lt;/strong&gt; for a sales-tax lookup. You don't need a rooftop-accurate street address — but a lot of geocoders hand you the whole thing anyway, whether you asked for it or not.&lt;/p&gt;

&lt;p&gt;Turns out you can filter out the feature types that you don't need — Mapbox lets you ask for exactly the level you need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; the &lt;code&gt;types&lt;/code&gt; param filters &lt;em&gt;which&lt;/em&gt; feature types come back in the results. Set &lt;code&gt;types=district&lt;/code&gt; and you get back only &lt;code&gt;district&lt;/code&gt;-type features. (&lt;code&gt;place&lt;/code&gt; = city, &lt;code&gt;district&lt;/code&gt; ≈ county in the US, &lt;code&gt;region&lt;/code&gt; = state, &lt;code&gt;postcode&lt;/code&gt; = ZIP). &lt;/p&gt;

&lt;h2&gt;
  
  
  Filtering with &lt;code&gt;types&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here's a reverse geocode of a point in Manhattan with no &lt;code&gt;types&lt;/code&gt; filter — by default this can return separate address, place, region, and country features, all at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://api.mapbox.com/search/geocode/v6/reverse?
longitude=-74.05941186207377&amp;amp;
latitude=40.77969220566604&amp;amp;
access_token=TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only need the zipcode for that same point? Filter it down:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://api.mapbox.com/search/geocode/v6/reverse?
longitude=-74.05941186207377&amp;amp;
latitude=40.77969220566604&amp;amp;
types=postcode&amp;amp;
access_token=TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the &lt;code&gt;features&lt;/code&gt; array only contains &lt;code&gt;postcode&lt;/code&gt;-type results — something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"FeatureCollection"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Feature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpBU2VPN0E"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"geometry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Point"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-74.056834&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.789203&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpBU2VPN0E"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"feature_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"postcode"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"full_address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Secaucus, New Jersey 07094, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"07094"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name_preferred"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"07094"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"longitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-74.056834&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"latitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.789203&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"place_formatted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Secaucus, New Jersey, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"bbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-74.094356&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.75046&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-74.033648&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.807552&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"context"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"place"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpFYmVvN0E"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Secaucus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q1013249"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"district"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpwQWJz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hudson County"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q490505"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"region"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpBbVRz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"New Jersey"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q1408"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"region_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NJ"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"region_code_full"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"US-NJ"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"country"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpJdXc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q30"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"country_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"US"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"country_code_alpha_3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USA"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"postcode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpBU2VPN0E"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"07094"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"attribution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NOTICE: © 2026 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same idea for county — Mapbox's &lt;code&gt;district&lt;/code&gt; type is defined as "smaller than a region, larger than a place," and for US addresses, that maps to a county:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://api.mapbox.com/search/geocode/v6/reverse?
longitude=-74.05941186207377&amp;amp;
latitude=40.77969220566604&amp;amp;
types=district&amp;amp;
access_token=TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same shape, just at the &lt;code&gt;district&lt;/code&gt; level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"FeatureCollection"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Feature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpwQWJz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"geometry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Point"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-74.04667&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.72069&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpwQWJz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"feature_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"district"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"full_address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hudson County, New Jersey, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hudson County"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name_preferred"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hudson County"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"coordinates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"longitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-74.04667&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"latitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.72069&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"place_formatted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"New Jersey, United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"bbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;-74.166087&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.641695&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-73.98538&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;40.823543&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"context"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"region"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpBbVRz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"New Jersey"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q1408"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"region_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NJ"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"region_code_full"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"US-NJ"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"country"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpJdXc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"United States"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q30"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"country_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"US"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"country_code_alpha_3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USA"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"district"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mapbox_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dXJuOm1ieHBsYzpwQWJz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hudson County"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wikidata_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Q490505"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"attribution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NOTICE: © 2026 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works the same way on forward geocoding, and there it also changes &lt;em&gt;which matches&lt;/em&gt; come back, not just filters a single result down. The docs' own &lt;a href="https://docs.mapbox.com/api/search/geocoding/#example-requests-forward-geocoding-with-search-text-input" rel="noopener noreferrer"&gt;example&lt;/a&gt;: searching &lt;code&gt;q=georgia&lt;/code&gt; with no filter can match both the country Georgia and the US state Georgia. Add &lt;code&gt;types=country&lt;/code&gt; and only the country comes back — you're excluding a whole category of match, not trimming one result's payload.&lt;/p&gt;

&lt;p&gt;You can also stack multiple types in one call, comma-separated — e.g. &lt;code&gt;types=address,street,place&lt;/code&gt; to get back any of those three, in one request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters
&lt;/h2&gt;

&lt;p&gt;If you're doing this at volume — autocomplete-as-you-type, bulk address cleanup, routing tickets by county — asking for exactly the feature type(s) you need means fewer irrelevant features to filter out client-side, and no risk of grabbing the wrong one out of a mixed results list.&lt;/p&gt;

&lt;p&gt;Full list of feature types and how the &lt;code&gt;types&lt;/code&gt; param works: &lt;a href="https://docs.mapbox.com/api/search/geocoding/#geographic-feature-types" rel="noopener noreferrer"&gt;Mapbox Geocoding API docs&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Got a favorite obscure API parameter that saved you a bunch of overhead? Drop it in the comments — might be the next episode.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mapbox</category>
      <category>api</category>
      <category>webdev</category>
      <category>geocoding</category>
    </item>
    <item>
      <title>Quick Tip: Dynamic Speed Units in Mapbox Navigation SDK for Android</title>
      <dc:creator>Erwin Soekianto</dc:creator>
      <pubDate>Wed, 17 Jun 2026 00:03:21 +0000</pubDate>
      <link>https://dev.to/mapbox/quick-tip-dynamic-speed-units-in-mapbox-navigation-sdk-for-android-4dm5</link>
      <guid>https://dev.to/mapbox/quick-tip-dynamic-speed-units-in-mapbox-navigation-sdk-for-android-4dm5</guid>
      <description>&lt;p&gt;Hi everyone! I’m Erwin, the newest &lt;strong&gt;Developer Evangelist&lt;/strong&gt; at &lt;strong&gt;Mapbox&lt;/strong&gt;. As I explore our SDKs, I’m focused on making our samples more flexible and easier to implement.&lt;/p&gt;

&lt;p&gt;Today, I’m sharing how to add a real-time MPH/KMH toggle to our &lt;a href="https://docs.mapbox.com/android/navigation/v2/examples/show-speed-limit/" rel="noopener noreferrer"&gt;Render speed limit for a route&lt;/a&gt; sample. This implementation is based on the &lt;a href="https://docs.mapbox.com/android/navigation/guides/localization/#set-speed-limit-units" rel="noopener noreferrer"&gt;Localization &amp;amp; internationalization guide&lt;/a&gt; in our docs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqy2czd0dfjlm71p8vo1q.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqy2czd0dfjlm71p8vo1q.gif" alt="See the unit in speed limit sign changing between mph and kph" width="800" height="1784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Implementation
&lt;/h3&gt;

&lt;p&gt;In the Mapbox Navigation SDK for Android, the speed units are determined by the &lt;code&gt;unitType&lt;/code&gt; passed via &lt;code&gt;DistanceFormatterOptions&lt;/code&gt;. To make it dynamic, we cache the last location result to refresh the UI instantly.&lt;/p&gt;

&lt;p&gt;You can view the full source code changes for this enhancement in &lt;a href="https://github.com/mapbox/mapbox-navigation-android-examples/pull/222/changes/1a0cf0a16c64469a9176980a87bd6084386aeff3" rel="noopener noreferrer"&gt;this commit on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Updating the Layout
&lt;/h4&gt;

&lt;p&gt;First, we add a simple button to our layout to trigger the unit switch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;androidx.appcompat.widget.AppCompatButton&lt;/span&gt;
    &lt;span class="na"&gt;android:id=&lt;/span&gt;&lt;span class="s"&gt;"@+id/toggleUnitButton"&lt;/span&gt;
    &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
    &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"wrap_content"&lt;/span&gt;
    &lt;span class="na"&gt;android:text=&lt;/span&gt;&lt;span class="s"&gt;"Toggle Unit"&lt;/span&gt;
    &lt;span class="na"&gt;app:layout_constraintEnd_toEndOf=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt;
    &lt;span class="na"&gt;app:layout_constraintTop_toTopOf=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. The Toggle Logic
&lt;/h4&gt;

&lt;p&gt;Rebuild your options and trigger a refresh using the cached &lt;code&gt;LocationMatcherResult&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="py"&gt;lastLocationMatcherResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;LocationMatcherResult&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;

&lt;span class="n"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toggleUnitButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setOnClickListener&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;newUnit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distanceFormatterOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unitType&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="nc"&gt;UnitType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;METRIC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
                    &lt;span class="nc"&gt;UnitType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IMPERIAL&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nc"&gt;UnitType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;METRIC&lt;/span&gt;

    &lt;span class="n"&gt;distanceFormatterOptions&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;distanceFormatterOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBuilder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unitType&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newUnit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;// Immediate UI refresh&lt;/span&gt;
    &lt;span class="n"&gt;lastLocationMatcherResult&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;let&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;updateSpeedLimit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Updating the View
&lt;/h4&gt;

&lt;p&gt;Pass the updated options into the &lt;code&gt;MapboxSpeedInfoApi&lt;/code&gt; to get the correctly formatted speed "sign" data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;updateSpeedLimit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locationMatcherResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;LocationMatcherResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;info&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;speedInfoApi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updatePostedAndCurrentSpeed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;locationMatcherResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;distanceFormatterOptions&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speedLimitView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isVisible&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speedLimitView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speedLimitView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isVisible&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why it matters
&lt;/h3&gt;

&lt;p&gt;Localization isn't just a "set and forget" feature. Providing a seamless way to switch units enhances the driving experience for users crossing borders or those with specific personal preferences.&lt;br&gt;
For a deeper dive into localization, check out our full documentation &lt;a href="https://docs.mapbox.com/android/navigation/v2/guides/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Expect more tips as I continue my journey with the Mapbox ecosystem!&lt;/p&gt;

</description>
      <category>mapbox</category>
      <category>androiddev</category>
      <category>kotlin</category>
      <category>devrel</category>
    </item>
  </channel>
</rss>
