Autosuggest API

The Autosuggest API delivers The Autosuggest API delivers smart, predictive search results based on partial user input. It enhances the search experience by suggesting relevant place names, POIs, or addresses based on popular usage patterns, real-time input, and geographic context.


🧭 The API can return relevant suggestions around a given latitude and longitude. Suggestions are provided within a 50km radius of the specified location.[Text Wrapping Break][Text Wrapping Break]🖱️ You can enable users to drop a marker on a map, automatically fetch the coordinates, and receive contextual suggestions within a 50km radius around that exact point.

🔑 Authentication

  • All requests must include your API key.
  • Header Example:
  • Authorization: X-Authorization-Token (Get your token HERE)

🌐 Endpoint

  • GET /v4/autosuggest
  • Base URL: https://apihub.latlong.ai/v4/autosuggest

📥 Request Parameters

ParameterTypeRequiredDescription
QueryStringYesThe partial string to generate suggestions from
LatFloatNoLatitude to influence the results spatially (within 50km radius)
LongFloatNoLongitude to influence the results spatially (within 50km radius)
category StringNoFilter results by category (e.g., restaurant, hospital)
LimitIntNoMaximum number of suggestions to return (default: 5, max: 20)
LanguageStringNoPreferred language for results

📤 Sample Request

curl --location ‘https://apihub.latlong.ai/v4/autosuggest.json?query=McDonalds&latitude=13.0827&longitude=80.2707' 

📦 Sample Response

{ 

  "code": 1001, 

  "status": "success", 

  "data": [ 

    { 

      "name": "McDonald's, Dr.Seetharaman Nagar,Velacherry Village, Ward 179, Chennai, Tamil Nadu, 600042", 

      "coordintes": { 

        "latitude": 12.972389, 

        "longitude": 80.219863 

      } 

    }, 

    { 

      "name": "McDonald's, Ward 103, Chennai, Tamil Nadu", 

      "coordintes": { 

        "latitude": 13.083283, 

        "longitude": 80.240232 

      } 

    }, 

    { 

      "name": "McDonald's, Dr Radhakrishnan Salai, Ward 125, Chennai, Tamil Nadu", 

      "coordintes": { 

        "latitude": 13.042947, 

        "longitude": 80.274127 

      } 

    }, 

    { 

      "name": "McDonald's, Ward 106, Chennai, Tamil Nadu", 

      "coordintes": { 

        "latitude": 13.073869, 

        "longitude": 80.22143 

      } 

    }, 

    { 

      "name": "McDonald's, Ward 101, Chennai, Tamil Nadu", 

      "coordintes": { 

        "latitude": 13.084916, 

        "longitude": 80.217224 

      } 

    }, 

    { 

      "name": "McDonald's, Kemp Fort Mall, Konena Agrahara, Bangalore, Karnataka, 560017", 

      "coordintes": { 

        "latitude": 12.959029, 

        "longitude": 77.656673 

      } 

    }, 

    { 

      "name": "McDonald's, ITPL Main Road, Dodda Nekkundi, Bangalore, Karnataka", 

      "coordintes": { 

        "latitude": 12.967059, 

        "longitude": 77.716762 

      } 

    }, 

    { 

      "name": "McDonald's, Sunkenahalli, Bangalore, Karnataka", 

      "coordintes": { 

        "latitude": 12.947333, 

        "longitude": 77.568005 

      } 

    }, 

    { 

      "name": "McDonald's, Hampi Nagar, Bangalore, Karnataka", 

      "coordintes": { 

        "latitude": 12.968683, 

        "longitude": 77.53691 

      } 

    }, 

    { 

      "name": "McDonald's, HMT Ward, Bangalore, Karnataka", 

      "coordintes": { 

        "latitude": 13.033446, 

        "longitude": 77.531164 

      } 

    } 

  ] 

} 

🧠 Features

  • Fast and responsive type-ahead suggestions

  • 📍

    Context-aware results using `lat`/`lon` (within 50km radius)

  • 🗺

    ️ Interactive map marker support – pick a location on a map and get suggestions nearby

  • 📂

    Category filtering to narrow down suggestions

  • 🌐

    Multi-language support for international apps

⚠️ Errors

Status CodeMessageDescription
400Missing required parametersWhen query is not provided
401UnauthorizedAPI key missing or invalid
429Rate limit exceededToo many requests in a short time
500Internal Server ErrorSomething went wrong on our side

Best Practices

  • Use lat and lon for context-aware suggestions
  • Apply a category filter to reduce noise in results
  • Throttle/debounce input events to reduce API usage
  • Allow users to drop a marker on the map and fetch suggestions near that point
  • Use limit to keep the UI clean and fast