Algolia Places provides a fast, distributed and easy way to use address search.
The Algolia Places API enforces 30 queries per second. Contact us if you need more.
If you're calling the API from your backend, the rate-limits computation is then based on the source IP.
- Free: 1000 requests / day Sign Up
- Free, with authentication: 100 000 requests / month Sign Up
- Paying: $0.40 per 1000 requests Sign Up
- Up to unlimited: Contact us
Visit our website.
You can use Algolia Places without authentication. Limited to 1000 requests per day.
val client = ClientPlaces()
Pass an ApplicationID
and an APIKey
to the ClientPlaces
for authenticated usage.
val client = ClientPlaces(
ApplicationID("YourApplicationID"),
APIKey("YourPlacesAPIKey")
)
By default, the response of searchPlaces
contains translations in all languages.
val response = client.searchPlaces(PlacesQuery("Paris"))
response.hits.first().city.getValue(Language.English)
However, it is possible to restrict the search results to a single language.
val response = client.searchPlaces(
query = PlacesQuery("New-York"),
language = Language.English
)
response.hits.first().city
Unless one or multiple countries are specified, it will search on the whole planet.
val query = placesQuery("York") {
countries {
+UnitedKingdom
+UnitedStates
}
}
client.searchPlaces(query)
Use latitude and longitude coordinates to find places.
val query = placesQuery {
aroundLatLng = Point(40.7128f, -74.0060f) // New-York
}
client.searchPlaces(query)
Reverse geocoding means converting a location (latitude and longitude) to a readable address.
client.reverseGeocoding(Point(40.7128f, -74.0060f)) // New-York
Use a Places objectID
to get an Algolia Places record.
clientPlaces.getByObjectID(ObjectID("201316654_7340078")) // New-York