How do I add an optional id to the get search address batch request

Jones, Jacob 0 Reputation points
2023-01-20T21:45:37.35+00:00

I am looking for a way to add an optional id to each address when processing an address batch request. It looks like the geocoding batch allows it, but I do not see the option for an address batch request.

I am having issues joining the source address to the standardized address when sending a batch since the query is returned formated. The optional id will make the process easier.

Azure Maps
Azure Maps

An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.

0 comments No comments

Answer recommended by moderator
Santhi Swaroop Naik Bukke 595 Reputation points
2023-01-20T21:52:53.58+00:00

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.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.