Azure Maps Geocoding Batch api-version 2025-01-01

KSD 0 Reputation points

Azure Maps Geocoding Batch api-version 2025-01-01 is not available with my subscription. How do I add this feature?

  1. Manas Mohanty 17,185 Reputation points Microsoft External Staff Moderator

    Hi KSD

    Could you provide more details on this statement "Geocoding Batch api-version 2025-01-01 is not available with my subscription"

    Do you have any sample code and more details on error to replicate the issue (or error trace or screenshot)

    Ideally, we can access all Azure map Api through Rest Api or python SDK.

    Below is a sample Rest Api example of Geocode batch with api version 2025-01-01.

    POST https://atlas.microsoft.com/geocode:batch?api-version=2025-01-01
    {
     "batchItems": [
     {
     "addressLine": "15127 NE 24th Street, Redmond, WA 98052",
     "top": 2,
     "optionalId": "4C3681A6C8AA4AC3441412763A2A25C81444DC8B"
     },
     {
     "query": "Pike Pl",
     "locality": "Seattle",
     "top": 3
     }
     ]
    }
    
    
    

    Reference - https://learn.microsoft.com/en-us/rest/api/maps/search/get-geocoding-batch?view=rest-maps-2025-01-01&tabs=HTTP#batch-response-model

    Thank you

  2. Manas Mohanty 17,185 Reputation points Microsoft External Staff Moderator

    Hi KSD

    Please let us know if above sample post code worked for you (you need to provide a bearer access token in above code). Here is python version of above code with azure map key authentication.

    import requests
    url = "https://atlas.microsoft.com/geocode:batch"
    params = {
        "api-version": "2025-01-01",
        "subscription-key": "YOUR_AZURE_MAPS_KEY"  # Replace with your actual Azure Maps key
    }
    headers = {
        "Content-Type": "application/json"
    }
    data = {
        "batchItems": [
            {
                "addressLine": "15127 NE 24th Street, Redmond, WA 98052",
                "top": 2,
                "optionalId": "4C3681A6C8AA4AC3441412763A2A25C81444DC8B"
            },
            {
                "query": "Pike Pl",
                "locality": "Seattle",
                "top": 3
            }
        ]
    }
    response = requests.post(url, params=params, headers=headers, json=data)
    print("Status Code:", response.status_code)
    print("Response JSON:", response.json())
    

    Thank you.

  3. Manas Mohanty 17,185 Reputation points Microsoft External Staff Moderator

    Hi KSD

    We could not hear from you. Hope you found our pointers useful.

    Feel free to add any observation or error trace if you find any issue using Azure map key in rest api or python sdk.

    Thank you.


Sign in to comment

1 answer

  1. IoTGirl 3,961 Reputation points Microsoft Employee Moderator

    Please reach out to your Azure account Administrator to ensure Azure maps is available in your subscription.

    0 comments No comments

    Sign in to comment
Sign in to answer

Your answer