Vietmap Autocomplete API Playground

    Autocomplete API

    Search for places with Vietmap Autocomplete API

    Map

    Search results

    0

    Enter information and click send request to see results

    Code samples

    Example with sample parameters — fill in the form to get code for your own request.

    curl 'https://maps.vietmap.vn/api/autocomplete/v4?apikey=YOUR_API_KEY&text=Vietmap&display_type=5&focus=10.7588867%2C106.6755666'

    Replace YOUR_API_KEY with your API key before running.

    // In production, read the key from an environment variable instead.
    const API_KEY = "YOUR_API_KEY";
    
    const params = new URLSearchParams([
      ["apikey", API_KEY],
      ["text", "Vietmap"],
      ["display_type", "5"],
      ["focus", "10.7588867,106.6755666"],
    ]);
    
    const response = await fetch(`https://maps.vietmap.vn/api/autocomplete/v4?${params}`);
    if (!response.ok) {
      throw new Error(`Vietmap ${response.status}: ${await response.text()}`);
    }
    const data = await response.json();
    console.log(data);

    Replace YOUR_API_KEY with your API key before running.

    import requests
    
    # In production, read the key from an environment variable instead.
    API_KEY = "YOUR_API_KEY"
    
    params = [
        ("apikey", API_KEY),
        ("text", "Vietmap"),
        ("display_type", "5"),
        ("focus", "10.7588867,106.6755666"),
    ]
    
    response = requests.get("https://maps.vietmap.vn/api/autocomplete/v4", params=params, timeout=30)
    response.raise_for_status()
    print(response.json())

    Replace YOUR_API_KEY with your API key before running.

    https://maps.vietmap.vn/api/autocomplete/v4?apikey=YOUR_API_KEY&text=Vietmap&display_type=5&focus=10.7588867%2C106.6755666

    Replace YOUR_API_KEY with your API key before running.

    I need to integrate Vietmap's Autocomplete API v4 into my application.
    
    Official documentation: https://maps.vietmap.vn/docs/map-api/autocomplete-version/autocomplete-v4/
    
    Here is a sample request that works in the Vietmap API Playground:
    
    GET https://maps.vietmap.vn/api/autocomplete/v4?apikey=YOUR_API_KEY&text=Vietmap&display_type=5&focus=10.7588867%2C106.6755666
    
    Parameters in use:
    - text = Vietmap
    - display_type = 5
    - focus = 10.7588867,106.6755666
    
    Write code in [my language / framework] that calls this API, with these requirements:
    1. Read the API key from the VIETMAP_API_KEY environment variable; never hard-code it.
    2. Send the parameters in the query string exactly as in the sample; repeated parameters (such as `point`) must keep their order.
    3. Handle Vietmap's HTTP errors:
       - 401: the API key is wrong or revoked.
       - 403: the key is restricted to a domain / IP that does not match.
       - 423: the API is not enabled for the key's consumer, OR the account is out of credit — tell them apart by the response body ("exceeded credit" means out of credit).
       - 429: rate limit exceeded — retry with increasing backoff.
    4. Set a request timeout, and define types (type / interface / dataclass) for the response.
    
    If unsure about a field name, look it up in the documentation linked above instead of guessing.

    Paste into ChatGPT, Claude… to generate integration code. The prompt never contains your API key.

    API Response

    Enter information and click send request to see results

    What is the Autocomplete API?

    The Autocomplete API suggests places while the user types: shops, buildings, house numbers, streets. Results can favour the current location (focus), stay within a province, district or ward under both the post-merger and the former boundaries, within a radius, or within POI categories. display_type returns addresses in the new format, the old one, or both.

    What it is for

    • Delivery address search in e-commerce checkouts.
    • Pick-up and drop-off search in ride-hailing apps.
    • Finding the nearest branch or store.
    • Cleaning up hand-typed addresses in a CRM.

    Sample request

    GET https://maps.vietmap.vn/api/autocomplete/v4?apikey=YOUR_API_KEY&text=Vietmap&focus=10.7588867,106.6755666

    Each result carries a ref_id for coordinates and details via the Place API.

    Autocomplete API FAQ

    How is the Autocomplete API different from the Geocoding API?
    Autocomplete is for while the user is still typing: each keystroke returns a list of suggestions, each with a ref_id for fetching coordinates and details from the Place API. Geocoding is for when the full address is already known and you need its location, for example when processing an existing address list.
    Does it suggest addresses under the post-merger units?
    Yes. The province and ward filters accept both the new and the former boundaries, and display_type returns addresses in the new format, the old one, or both.
    How do I favour places near the user?
    Pass the current location as focus (latitude,longitude) so results near it rank first. To keep results strictly inside an area, add the radius filter or a province or ward filter.
    Does it cost anything to try the Autocomplete API?
    The playground comes with a demo API key, so you can call the Autocomplete API straight from the browser without signing up. To build it into a product, register a VIETMAP account for your own key. Usage is billed per transaction, each API converting requests to transactions at its own rate; the pricing page has the details and the free trial.