OnlineSearch

final public class OnlineSearch : Search

The Online Search API is a REST wrapper for a suite of web services that allow developers to use our scalable search engine.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • OnlineSearch init method.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public convenience init(apiKey: String)

    Parameters

    apiKey

    a valid Search API key.

Public

  • This API allows to perform a fuzzy search for POIs along a specified route.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func searchAlongRoute(query: AlongRouteQuery, completion: @escaping (Result<SearchResponse, Error>) -> ())

    Parameters

    query

    The AlongRouteQuery object to filter the results

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, SearchResponse contains an array of search result and summary information.

  • This API allows to search places and POIs meeting various criteria.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func search(query: SearchQuery, completion: @escaping (Result<SearchResponse, Error>) -> ())

    Parameters

    query

    The SearchQuery object to filter the results.

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, SearchResponse contains an array of search results and summary information.

  • This API provides a full list of POI categories and subcategories together with their translations and synonyms. Additional POI category parameters like language can be taken into account using the PoiCategoryQuery.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func requestPoiCategories(query: PoiCategoryQuery, completion: @escaping (Result<PoiCategoryResponse, Error>) -> ())

    Parameters

    query

    The PoiCategoryQuery.

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, PoiCategoryResponse contains an array of categories and subcategories together with their translations and synonyms.

  • The Autocomplete API enables you to make a more meaningful Search API call by recognizing entities inside an input query and offering them as query terms.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func autocompleteSearch(query: AutocompleteQuery, completion: @escaping (Result<AutocompleteResponse, Error>) -> ())

    Parameters

    query

    The AutocompleteQuery.

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, AutocompleteResponse contains proposed autocomplete elements, that can be used to implement an input field with the autocomplete feature.

  • This API provides detailed information about a place based on its identifier (entityId).

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func requestPOIDetails(
        query: POIDetailsQuery,
        completion: @escaping (Result<TomTomSDKSearch.POIDetailsResponse, Error>) -> ()
    )

    Parameters

    query

    a query to describe what POI Details data to request.

    completion

    The completion closure is called after the response to the request has been processed. If no errors occurred, POIDetailsResponse contains a search result associated with the requested POI.

  • The Geometries Data API returns sets of coordinates that represent the outline of a city, country, or land area. The API supports batch requests of up to 20 identifiers.

    • query: The query that defines geometries to request.
    • completion: Parameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred, GeometryDataResponse contains an array of geometries data structures

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func requestGeometryData(
        query: GeometryDataQuery,
        completion: @escaping (Result<GeometryDataResponse, Error>) -> ()
    )
  • The EV Charging Availability endpoint provides information about the current availability of charging points, grouped by connector type and then power level. The response can be filtered by connector type and a range of charging powers, if provided (using optional request parameters).

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func requestEvChargingStationsAvailability(
        query: EVChargingStationsAvailabilityQuery,
        completion: @escaping (Result<
            EVChargingStationsAvailabilityResponse,
            Error
        >) -> ()
    )

    Parameters

    query

    The EVChargingStationsAvailabilityQuery. Can be made using EVChargingStationsAvailabilityQueryBuilder.

    completion

    Parameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred, SearchResponse contains an array of categories and subcategories together with their translations and synonyms.