Skip to content

Commit 81095a6

Browse files
Merge pull request #306027 from stevemunk/search-v2-how-to
Search v2 how to
2 parents 2f45ead + dfbb66c commit 81095a6

2 files changed

Lines changed: 229 additions & 15 deletions

File tree

articles/azure-maps/how-to-search-for-address.md

Lines changed: 220 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
---
22
title: Search for a location using Azure Maps Search services
33
description: Learn about the Azure Maps Search service. See how to use this set of APIs for geocoding, reverse geocoding, fuzzy searches, and reverse cross street searches.
4-
author: farazgis
5-
ms.author: fsiddiqui
6-
ms.date: 8/9/2024
4+
author: sinnypan
5+
ms.author: sipa
6+
ms.date: 9/24/2025
77
ms.topic: how-to
88
ms.service: azure-maps
9-
ms.subservice: routing
9+
ms.subservice: search
10+
zone_pivot_groups: azure-maps-search
1011
---
1112

1213
# Search for a location using Azure Maps Search services
1314

1415
The [Search] service is a set of RESTful APIs designed to help developers search addresses, places, and business listings by name, category, and other geographic information. In addition to supporting traditional geocoding, services can also reverse geocode addresses and cross streets based on latitudes and longitudes. Latitude and longitude values returned by the search can be used as parameters in other Azure Maps services, such as [Route] and [Weather].
1516

17+
:::zone pivot="search-previous"
18+
1619
This article demonstrates how to:
1720

1821
* Request latitude and longitude coordinates for an address (geocode address location) by using [Search Address].
1922
* Search for an address or Point of Interest (POI) using [Fuzzy Search].
2023
* Use [Reverse Address Search] to translate coordinate location to street address.
21-
* Translate coordinate location into a human understandable cross street using [Search Address Reverse Cross Street], most often needed in tracking applications that receive a GPS feed from a device or asset, and wish to know where the coordinate is located.
24+
* Use the [Search Address Reverse Cross Street] API to convert a coordinate location into a human-readable cross street. This is especially useful in tracking applications that receive GPS data from devices or assets and need to determine the nearest street-level location for those coordinates.
2225

2326
## Prerequisites
2427

@@ -27,9 +30,9 @@ This article demonstrates how to:
2730

2831
>[!IMPORTANT]
2932
>
30-
> In the URL examples in this article you will need to replace `{Your-Azure-Maps-Subscription-key}` with your Azure Maps subscription key.
33+
> In the URL examples in this article, you need to replace `{Your-Azure-Maps-Subscription-key}` with your Azure Maps subscription key.
3134
32-
This article uses the [bruno] application, but you can choose a different API development environment.
35+
This article uses the [Bruno] application, but you can choose a different API development environment.
3336

3437
## Request latitude and longitude for an address (geocoding)
3538

@@ -38,7 +41,9 @@ The example in this section uses [Get Search Address] to convert an address into
3841
> [!TIP]
3942
> If you have a set of addresses to geocode, you can use [Post Search Address Batch] to send a batch of queries in a single request.
4043
41-
1. Open the bruno app, select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
44+
1. Open the [Bruno] application.
45+
46+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
4247

4348
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
4449

@@ -74,7 +79,9 @@ The example in this section uses `Fuzzy Search` to search the entire world for *
7479
> [!IMPORTANT]
7580
> To geobias results to the relevant area for your users, always add as many location details as possible. For more information, see [Best Practices for Search].
7681
77-
1. Open the bruno app, select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
82+
1. Open the [Bruno] application.
83+
84+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
7885
7986
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
8087
@@ -122,15 +129,17 @@ The example in this section uses `Fuzzy Search` to search the entire world for *
122129
123130
This example demonstrates making reverse searches using a few of the optional parameters that are available. For the full list of optional parameters, see [Reverse Search Parameters].
124131
125-
1. Open the bruno app, select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
132+
1. Open the [Bruno] application.
133+
134+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
126135
127136
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
128137
129138
```http
130139
https://atlas.microsoft.com/search/address/reverse/json?api-version=1.0&subscription-key={Your-Azure-Maps-Subscription-key}&language=en-US&query=47.591180,-122.332700
131140
```
132141
133-
1. Select the run button, and review the response body. You should see one query result. The response includes key address information about Safeco Field.
142+
1. Select the run button, and review the response body. You should see one query result. The response includes key address information about T-Mobile Park.
134143
135144
1. Next, add the following key/value pairs to the **Params** section:
136145
@@ -145,20 +154,22 @@ This example demonstrates making reverse searches using a few of the optional pa
145154
146155
1. Select the run button, and review the response body.
147156
148-
1. Next, add the `entityType` key, and set its value to `Municipality`. The `entityType` key overrides the `returnMatchType` key in the previous step. `returnSpeedLimit` and `returnRoadUse` also need removed since you're requesting information about the municipality. For all possible entity types, see [Entity Types].
157+
1. Next, add the `entityType` key, and set its value to `Municipality`. The `entityType` key overrides the `returnMatchType` key in the previous step. `returnSpeedLimit` and `returnRoadUse` also need removed since you're requesting information about the municipality. For all possible entity types, see [Entity Types].
149158
150159
:::image type="content" source="./media/how-to-search-for-address/search-reverse-entity-type.png" alt-text="Search reverse entityType.":::
151160
152-
1. Select the run button. Compare the results to the results returned in step 5. Because the requested entity type is now `municipality`, the response doesn't include street address information. Also, the returned `geometryId` can be used to request boundary polygon through Azure Maps Get [Search Polygon API].
161+
1. Select the run button. Compare the results to the results returned in step 5. Because the requested entity type is now `municipality`, the response doesn't include street address information. Also, the returned `geometryId` can be used to request boundary polygon through Azure Maps Get [Search Polygon API].
153162
154163
> [!TIP]
155-
> For more information on these as well as other parameters, see [Reverse Search Parameters].
164+
> For more information, see [Reverse Search Parameters].
156165
157166
## Search for cross street using Reverse Address Cross Street Search
158167
159168
This example demonstrates how to search for a cross street based on the coordinates of an address.
160169
161-
1. Open the bruno app, select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
170+
1. Open the [Bruno] application.
171+
172+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
162173
163174
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
164175
@@ -168,6 +179,194 @@ This example demonstrates how to search for a cross street based on the coordina
168179
169180
1. Select the run button, and review the response body. Notice that the response contains a `crossStreet` value of `South Atlantic Street`.
170181
182+
:::zone-end
183+
184+
:::zone pivot="search-latest"
185+
186+
This article demonstrates how to:
187+
188+
* Request latitude and longitude coordinates for an address (geocode address location) by using [Get Geocoding].
189+
* Search for a partial address using [Get Geocode Autocomplete].
190+
* Use [Get Reverse Geocoding] to translate coordinate location to street address.
191+
* Translate coordinate location into a human understandable cross street using [Get Reverse Geocoding], most often needed in tracking applications that receive a GPS feed from a device or asset, and wish to know where the coordinate is located.
192+
193+
## Prerequisites
194+
195+
* An [Azure Maps account]
196+
* A [subscription key]
197+
198+
>[!IMPORTANT]
199+
>
200+
> In the URL examples in this article, you need to replace `{Your-Azure-Maps-Subscription-key}` with your Azure Maps subscription key.
201+
202+
This article uses the [Bruno] application, but you can choose a different API development environment.
203+
204+
## Request coordinates for an address using Get Geocoding
205+
206+
The example in this section uses [Get Geocoding] to convert an address into latitude and longitude coordinates. This process is also called *geocoding*. In addition to returning the coordinates, the response also returns detailed address properties such as street, postal code, municipality, and country/region information.
207+
208+
> [!TIP]
209+
> If you have a set of addresses to geocode, you can use [Get Geocoding Batch] to send a batch of queries in a single request.
210+
211+
1. Open the [Bruno] application.
212+
213+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
214+
215+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
216+
217+
```http
218+
GET https://atlas.microsoft.com/geocode?api-version=2025-01-01&subscription-key={Your-Azure-Maps-Subscription-key}&query=400 Broad St, Seattle, WA 98109
219+
```
220+
221+
1. Select the **Create** button.
222+
223+
1. Select the run button.
224+
225+
This request searches for a specific address: `400 Broad St, Seattle, WA 98109`. Next, search an address that has more than one possible location.
226+
227+
1. In the **Params** section, change the `query` key to `400 Broad, Seattle`, then select the run button.
228+
229+
1. Next, try setting the `query` key to `400 Broa`, then select the run button.
230+
231+
The response includes results from multiple countries/regions. To [geobias] results to the relevant area for your users, always add as many location details as possible to the request.
232+
233+
## Use Get Geocode Autocomplete for partial address search
234+
235+
The [Get Geocode Autocomplete] API supports both single-line and free-form address inputs, making it ideal for scenarios where a complete address is unavailable. You can submit either a full or partial address as the query. To enhance the accuracy and relevance of the results, it's recommended to constrain the search by specifying coordinates or a bounding box.
236+
237+
This example demonstrates how to use the Get Geocode Autocomplete API to search the entire North American continent for partial input like "university of w." It then shows how to narrow the search scope to a specific country or region using the `countryRegion` parameter. Finally, it demonstrates how to use the `coordinates` parameter to focus the search to a specific area.
238+
239+
> [!IMPORTANT]
240+
> To geobias results to the relevant area for your users, always add as many location details as possible. For more information, see [Best Practices for Search].
241+
242+
1. Open the [Bruno] application.
243+
244+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
245+
246+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
247+
248+
```http
249+
https://atlas.microsoft.com/geocode:autocomplete?api-version=2025-06-01-preview&query=university of w&bbox=-168,-52,5,84&subscription-key={Your-Azure-Maps-Subscription-key}
250+
```
251+
252+
1. Select the run button, then review the response body.
253+
254+
> [!NOTE]
255+
> The `bbox` parameter in the URL defines a bounding box that encompasses **Canada**, the **United States**, **Mexico**, **Greenland**, and parts of the **Caribbean**. It returns several universities located within this area, including:
256+
>
257+
> - **University of Washington** in King County, Washington State, USA
258+
> - **University of Waterloo** in Waterloo, Ontario, Canada
259+
> - **University of Wyoming** in Laramie, Wyoming, USA
260+
> - **University of Windsor** in Windsor, Ontario, Canada
261+
> - **University of West Florida** in Escambia County, Florida, USA
262+
263+
Next, narrow down the area included in your search to the United States, using the `countryRegion` parameter.
264+
265+
1. Open the [Bruno] application.
266+
267+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
268+
269+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
270+
271+
```http
272+
https://atlas.microsoft.com/geocode:autocomplete?api-version=2025-06-01-preview&query=university of w&bbox=-168,-52,5,84&countryRegion=us&subscription-key={Your-Azure-Maps-Subscription-key}
273+
```
274+
275+
1. Select the run button, then review the response body.
276+
277+
> [!NOTE]
278+
> The `bbox` parameter in the URL defines the same bounding box as in the previous example, however the `countryRegion=us` parameter limits results to the United States. It returns several universities located within this area, including:
279+
>
280+
> - **University of Washington** in King County, Washington State, USA
281+
> - **University of Wyoming** in Laramie, Wyoming, USA
282+
> - **University of West Florida** in Escambia County, Florida, USA
283+
> - **University of Wisconsin-Superior** in Douglas County, Wisconsin, USA
284+
> - **University of Wisconsin-Stout** in Menomonie, Dunn County, Wisconsin, USA
285+
286+
Next, focus your search to include more results in a specific area within the defined `countryRegion`, using the `coordinates` parameter. This results in more items returned near the specified area that would otherwise not make the list.
287+
288+
1. Open the [Bruno] application.
289+
290+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
291+
292+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
293+
294+
```http
295+
https://atlas.microsoft.com/geocode:autocomplete?api-version=2025-06-01-preview&query=university of w&bbox=-168,-52,5,84&countryRegion=us&coordinates=-122.136791,47.642232&subscription-key={Your-Azure-Maps-Subscription-key}
296+
```
297+
298+
1. Select the run button, then review the response body.
299+
300+
> [!NOTE]
301+
> The `bbox` and `countryRegion` parameters in this URL define the same boundaries as in the previous example, however the `coordinates=-122.136791,47.642232` parameter focuses the search results to the specified area. It returns a local university that would otherwise not be returned.
302+
>
303+
> - **University of Washington** in King County, Washington State, USA
304+
> - **University of Washington, Tacoma** in Tacoma, Pierce County, Washington State, USA
305+
> - **University of Wyoming** in Laramie, Wyoming, USA
306+
> - **University of West Florida** in Escambia County, Florida, USA
307+
> - **University of Wisconsin-Stout** in Menomonie, Dunn County, Wisconsin, USA
308+
309+
## Search for a street address using Get Reverse Geocoding
310+
311+
[Get Reverse Geocoding] translates coordinates into human readable street addresses. This API is often used for applications that consume GPS feeds and want to discover addresses at specific coordinate points.
312+
313+
> [!IMPORTANT]
314+
> To [geobias] results to the relevant area for your users, always add as many location details as possible. For more information, see [Best Practices for Search].
315+
316+
> [!TIP]
317+
> If you have a set of coordinate locations to reverse geocode, you can use [Get Reverse Geocoding Batch] to send a batch of queries in a single request.
318+
319+
This example demonstrates making reverse searches using a few of the optional parameters that are available. For the full list of optional parameters, see [Get Reverse Geocoding Parameters].
320+
321+
1. Open the [Bruno] application.
322+
323+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
324+
325+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
326+
327+
```http
328+
https://atlas.microsoft.com/reverseGeocode?api-version=2025-01-01&subscription-key={Your-Azure-Maps-Subscription-key}&coordinates=-122.332700,47.591180
329+
```
330+
331+
1. Select the run button, and review the response body. You should see one query result. The response includes key address information about T-Mobile Park.
332+
333+
1. Next, add the following parameter to the request: `resultTypes=Postcode1`
334+
335+
```http
336+
https://atlas.microsoft.com/reverseGeocode?api-version=2025-01-01&subscription-key={Your-Azure-Maps-Subscription-key}&coordinates=-122.332700,47.591180&resultTypes=Postcode1
337+
```
338+
339+
1. Select the run button, and compare the results to the results returned previously. Because the requested result type is now `Postcode1`, the response doesn't include street address information, just the zip code.
340+
341+
## Search for cross street using Get Reverse Geocoding
342+
343+
This example demonstrates how to search for a cross street based on the coordinates of an address.
344+
345+
1. Open the [Bruno] application.
346+
347+
1. Select **NEW REQUEST** to create the request. In the **NEW REQUEST** window, set **Type** to **HTTP**. Enter a **Name** for the request.
348+
349+
1. Select the **GET** HTTP method in the **URL** drop-down list, then enter the following URL:
350+
351+
```http
352+
https://atlas.microsoft.com/reverseGeocode?api-version=2025-01-01&coordinates=-122.12429011774091,47.61697905124655&subscription-key={Your-Azure-Maps-Subscription-key}
353+
```
354+
355+
1. Select the run button, and review the response body.
356+
357+
The response includes an `intersection` section that identifies the street portion of the returned address: *NE 8th St*. It also specifies the intersecting street: *164th Ave NE*, and provides the full cross street as: *NE 8th St and 164th Ave NE*.
358+
359+
```json
360+
"intersection": {
361+
"baseStreet": "NE 8th St",
362+
"displayName": "NE 8th St and 164th Ave NE",
363+
"intersectionType": "Near",
364+
"secondaryStreet1": "164th Ave NE"
365+
}
366+
```
367+
368+
:::zone-end
369+
171370
## Next steps
172371

173372
> [!div class="nextstepaction"]
@@ -176,6 +375,7 @@ This example demonstrates how to search for a cross street based on the coordina
176375
> [!div class="nextstepaction"]
177376
> [Best practices for Azure Maps Search service]
178377
378+
[Get Geocode Autocomplete]: /rest/api/maps/search/get-geocode-autocomplete
179379
[Azure Maps account]: quick-demo-map-app.md#create-an-azure-maps-account
180380
[Azure Maps Search service]: /rest/api/maps/search?view=rest-maps-1.0&preserve-view=true
181381
[Best practices for Azure Maps Search service]: how-to-use-best-practices-for-search.md
@@ -184,6 +384,11 @@ This example demonstrates how to search for a cross street based on the coordina
184384
[Fuzzy Search URI Parameters]: /rest/api/maps/search/getsearchfuzzy?view=rest-maps-1.0&preserve-view=true#uri-parameters
185385
[Fuzzy Search]: /rest/api/maps/search/getsearchfuzzy?view=rest-maps-1.0&preserve-view=true
186386
[geobias]: glossary.md#geobias
387+
[Get Geocoding]: /rest/api/maps/search/get-geocoding
388+
[Get Geocoding Batch]: /rest/api/maps/search/get-geocoding-batch
389+
[Get Reverse Geocoding]: /rest/api/maps/search/get-reverse-geocoding
390+
[Get Reverse Geocoding Parameters]: /rest/api/maps/search/get-reverse-geocoding#uri-parameters
391+
[Get Reverse Geocoding Batch]: /rest/api/maps/search/get-reverse-geocoding-batch
187392
[Get Search Address Reverse]: /rest/api/maps/search/getsearchaddressreverse?view=rest-maps-1.0&preserve-view=true
188393
[Get Search Address]: /rest/api/maps/search/getsearchaddress?view=rest-maps-1.0&preserve-view=true
189394
[point of interest]: /rest/api/maps/search/getsearchpoi?view=rest-maps-1.0&preserve-view=true#searchpoiresponse

0 commit comments

Comments
 (0)