The Azure Maps Search Address batch request allows you to search for multiple addresses in one request. The ID parameter is not included by default, but you can add it by including the id
parameter in the query string.
Here's an example of how you can add an optional ID to the Get Search Address batch request using the REST API:
Copy code
https://atlas.microsoft.com/search/address/batch/json?subscription-key={subscription-key}&id=1,2,3&query=Seattle
In the above example, the id
parameter is set to 1,2,3
and will be returned in the response along with the search results for each address.
You can also use Azure Maps SDK to perform the same action.
Copy code
# Python SDK example
search_batch_request = SearchBatchRequest(subscription_key=subscription_key)
# Adding an optional ID to the request
search_batch_request.add_address("Seattle", id=1)
search_batch_request.add_address("New York", id=2)
batch_response = search_batch_request.execute()
In this example, the id
parameter is set to 1
and 2
respectively for each address.
Please keep in mind that ids must be unique across all requests in the same batch and that the id parameter is optional and can be omitted if not needed.