Category search

VERSION 0.2.3323

POI Categories

The POI categories search is used to obtain a list of all POI categories and subcategories, together with synonyms. You can request categories in different languages. See the list of supported languages. More detailed information about this service can be found in the Search API POI Categories documentation.

To perform a call, you need to create a POICategoryOptions where you can specify the desired response language.

If no language is specified, categories will be returned in system language and in English if system language is not supported.

let options = POICategoryOptions(locale: Locale(identifier: "en_GB"))

As you created the query, you can:

1let onlineSearch = OnlineSearch(apiKey: "REPLACE_WITH_YOUR_API_KEY")
2onlineSearch.requestPOICategories(options: options) { result in
3 switch result {
4 case let .success(poiCategoriesResponse):
5 // handle success
6 break
7 case let .failure(error):
8 // handle error
9 break
10 }

As a result you will get: PoiCategoryResponse that contains an array of PoiCategory.