Skip to main content
All response types are immutable Java records. Collections are always non-null — missing or null arrays from the API are normalized to empty List.of(). Optional fields use Optional<T> and are never absent (they resolve to Optional.empty() when not present).

PlaceResults

Import: com.williamcallahan.applemaps.domain.model.PlaceResults
Returned by: AppleMaps.geocode, AppleMaps.reverseGeocode
public record PlaceResults(List<Place> results)
FieldTypeDescription
resultsList<Place>Zero or more places matching the geocode request. Never null.
Each element in results is a Place record. A successful geocode that finds no matching address returns an empty list rather than throwing an exception.

Place

Import: com.williamcallahan.applemaps.domain.model.Place
Returned by: AppleMaps.lookupPlace, contained in PlaceResults, PlacesResponse, DirectionsResponse
public record Place(
    Optional<String> id,
    List<String> alternateIds,
    String name,
    Location coordinate,
    Optional<MapRegion> displayMapRegion,
    List<String> formattedAddressLines,
    Optional<StructuredAddress> structuredAddress,
    String country,
    String countryCode
)
FieldTypeDescription
idOptional<String>Apple Maps place identifier, if available.
alternateIdsList<String>Alternate identifiers associated with this place. Never null.
nameStringDisplay name of the place. Never null.
coordinateLocationLatitude/longitude coordinate. Never null.
displayMapRegionOptional<MapRegion>Suggested map region for display, if available.
formattedAddressLinesList<String>Human-readable address lines (for example, ["880 Harrison St", "San Francisco, CA 94107", "United States"]). Never null.
structuredAddressOptional<StructuredAddress>Machine-readable address components, if available. See StructuredAddress.
countryStringCountry name. Never null.
countryCodeStringISO 3166-1 alpha-2 country code. Never null.

StructuredAddress

Import: com.williamcallahan.applemaps.domain.model.StructuredAddress
Contained in: Place.structuredAddress, SearchResponsePlace.structuredAddress, AutocompleteResult.structuredAddress
public record StructuredAddress(
    Optional<String> administrativeArea,
    Optional<String> administrativeAreaCode,
    Optional<String> subAdministrativeArea,
    List<String> areasOfInterest,
    List<String> dependentLocalities,
    Optional<String> fullThoroughfare,
    Optional<String> locality,
    Optional<String> postCode,
    Optional<String> subLocality,
    Optional<String> subThoroughfare,
    Optional<String> thoroughfare
)
FieldTypeDescription
administrativeAreaOptional<String>State or province, e.g. "California".
administrativeAreaCodeOptional<String>Short code for the administrative area, e.g. "CA".
subAdministrativeAreaOptional<String>County or district within the administrative area, if available.
areasOfInterestList<String>Named areas of interest at this location. Never null.
dependentLocalitiesList<String>Sub-locality names, e.g. ["Yerba Buena"]. Never null.
fullThoroughfareOptional<String>Street number and name combined, e.g. "880 Harrison St".
localityOptional<String>City or town, e.g. "San Francisco".
postCodeOptional<String>Postal code, e.g. "94107".
subLocalityOptional<String>Neighborhood, e.g. "Yerba Buena".
subThoroughfareOptional<String>Street number, e.g. "880".
thoroughfareOptional<String>Street name without number, e.g. "Harrison St".

SearchResponse

Import: com.williamcallahan.applemaps.domain.model.SearchResponse
Returned by: AppleMaps.search, AppleMaps.resolveCompletionUrl, AppleMaps.resolveCompletionUrls
public record SearchResponse(
    Optional<SearchMapRegion> displayMapRegion,
    Optional<PaginationInfo> paginationInfo,
    List<SearchResponsePlace> results
)
FieldTypeDescription
displayMapRegionOptional<SearchMapRegion>Suggested map region bounding the results, if available. Pass to SearchRegion.fromSearchMapRegion to use as a region hint in a follow-up request.
paginationInfoOptional<PaginationInfo>Pagination metadata, present when pagination is enabled and more results exist.
resultsList<SearchResponsePlace>Matching places. Never null.

SearchResponsePlace

Each element in SearchResponse.results is a SearchResponsePlace:
public record SearchResponsePlace(
    Optional<String> id,
    List<String> alternateIds,
    String name,
    Location coordinate,
    Optional<MapRegion> displayMapRegion,
    List<String> formattedAddressLines,
    Optional<StructuredAddress> structuredAddress,
    String country,
    String countryCode,
    Optional<PoiCategory> poiCategory
)
SearchResponsePlace contains all fields from Place plus poiCategory — the point-of-interest category for the result, if applicable.

SearchAutocompleteResponse

Import: com.williamcallahan.applemaps.domain.model.SearchAutocompleteResponse
Returned by: AppleMaps.autocomplete
public record SearchAutocompleteResponse(List<AutocompleteResult> results)
FieldTypeDescription
resultsList<AutocompleteResult>Autocomplete suggestions. Never null.

AutocompleteResult

public record AutocompleteResult(
    String completionUrl,
    List<String> displayLines,
    Optional<Location> location,
    Optional<StructuredAddress> structuredAddress
)
FieldTypeDescription
completionUrlStringURL to resolve to full place data. Pass to AppleMaps.resolveCompletionUrl. Never null.
displayLinesList<String>Human-readable suggestion lines suitable for display in a suggestion dropdown. Never null.
locationOptional<Location>Approximate location of the suggestion, if available.
structuredAddressOptional<StructuredAddress>Structured address for the suggestion, if available.

DirectionsResponse

Import: com.williamcallahan.applemaps.domain.model.DirectionsResponse
Returned by: AppleMaps.directions
public record DirectionsResponse(
    Optional<Place> origin,
    Optional<Place> destination,
    List<DirectionsRoute> routes,
    List<DirectionsStep> steps,
    List<List<Location>> stepPaths
)
FieldTypeDescription
originOptional<Place>Resolved origin place, if available.
destinationOptional<Place>Resolved destination place, if available.
routesList<DirectionsRoute>One or more routes. Never null.
stepsList<DirectionsStep>Flat list of all steps across all routes. Never null.
stepPathsList<List<Location>>Coordinate arrays for each step’s path. Indexed by DirectionsStep.stepPathIndex. Never null.

DirectionsRoute

public record DirectionsRoute(
    Optional<String> name,
    Optional<Long> distanceMeters,
    Optional<Long> durationSeconds,
    Optional<Boolean> hasTolls,
    List<Integer> stepIndexes,
    Optional<TransportType> transportType
)
FieldTypeDescription
nameOptional<String>Route name, if available.
distanceMetersOptional<Long>Total route distance in meters.
durationSecondsOptional<Long>Expected travel time in seconds.
hasTollsOptional<Boolean>Whether the route passes through tolled roads.
stepIndexesList<Integer>Indexes into the DirectionsResponse.steps list for this route. Never null.
transportTypeOptional<TransportType>Transport mode for this route.

DirectionsStep

public record DirectionsStep(
    Optional<Integer> stepPathIndex,
    Optional<Long> distanceMeters,
    Optional<Long> durationSeconds,
    Optional<String> instructions,
    Optional<TransportType> transportType
)
FieldTypeDescription
stepPathIndexOptional<Integer>Index into DirectionsResponse.stepPaths for this step’s coordinate path.
distanceMetersOptional<Long>Step distance in meters.
durationSecondsOptional<Long>Step travel time in seconds.
instructionsOptional<String>Human-readable navigation instruction (for example, “Turn left onto Main St”).
transportTypeOptional<TransportType>Transport mode for this step.

EtaResponse

Import: com.williamcallahan.applemaps.domain.model.EtaResponse
Returned by: AppleMaps.etas
public record EtaResponse(List<EtaEstimate> etas)
FieldTypeDescription
etasList<EtaEstimate>One estimate per destination, in the same order as EtaInput.destinations. Never null.

EtaEstimate

public record EtaEstimate(
    Optional<Location> destination,
    Optional<Long> distanceMeters,
    Optional<Long> expectedTravelTimeSeconds,
    Optional<Long> staticTravelTimeSeconds,
    Optional<TransportType> transportType
)
FieldTypeDescription
destinationOptional<Location>Destination coordinate matched by the API.
distanceMetersOptional<Long>Travel distance in meters.
expectedTravelTimeSecondsOptional<Long>Real-time travel time estimate in seconds (accounts for current traffic).
staticTravelTimeSecondsOptional<Long>Historical average travel time in seconds (no real-time traffic).
transportTypeOptional<TransportType>Transport mode used for this estimate.

PlacesResponse

Import: com.williamcallahan.applemaps.domain.model.PlacesResponse
Returned by: AppleMaps.lookupPlaces
public record PlacesResponse(List<Place> results, List<PlaceLookupError> errors)
FieldTypeDescription
resultsList<Place>Successfully resolved places. Never null.
errorsList<PlaceLookupError>Per-ID errors for place IDs that could not be resolved. Never null.
A single lookupPlaces call may partially succeed — some IDs may appear in results while others appear in errors.

PlaceLookupError

public record PlaceLookupError(PlaceLookupErrorCode errorCode, String rawId)
FieldTypeDescription
errorCodePlaceLookupErrorCodeError code from the API. Never null.
id()Optional<String>The place ID associated with the error (accessor method, not a record component).

PlaceLookupErrorCode

Import: com.williamcallahan.applemaps.domain.model.PlaceLookupErrorCode
Used in: PlaceLookupError
ConstantDescription
FAILED_INVALID_IDThe request provided an invalid place identifier.
FAILED_NOT_FOUNDThe requested place could not be found.
FAILED_INTERNAL_ERRORThe lookup failed due to an internal error on Apple’s side.

PaginationInfo

Import: com.williamcallahan.applemaps.domain.model.PaginationInfo
Contained in: SearchResponse.paginationInfo
Present when SearchInput.enablePagination(true) is set and more results are available.
public record PaginationInfo(
    Optional<String> nextPageToken,
    Optional<String> prevPageToken,
    long totalPageCount,
    long totalResults
)
FieldTypeDescription
nextPageTokenOptional<String>Token to pass to .pageToken() in the next SearchInput to retrieve the next page. Empty if on the last page.
prevPageTokenOptional<String>Token for the previous page, if applicable.
totalPageCountlongTotal number of pages available.
totalResultslongTotal number of results across all pages.

AlternateIdsResponse

Import: com.williamcallahan.applemaps.domain.model.AlternateIdsResponse
Returned by: AppleMaps.lookupAlternateIds
public record AlternateIdsResponse(List<AlternateIdsEntry> results, List<PlaceLookupError> errors)
FieldTypeDescription
resultsList<AlternateIdsEntry>Successfully resolved alternate ID entries. Never null.
errorsList<PlaceLookupError>Per-ID errors for place IDs that could not be resolved. Never null.

AlternateIdsEntry

public record AlternateIdsEntry(Optional<String> id, List<String> alternateIds)
FieldTypeDescription
idOptional<String>The primary place ID that was queried.
alternateIdsList<String>Alternate identifiers for the place (for example, identifiers from other mapping data providers). Never null.

Enum types

TransportType

Import: com.williamcallahan.applemaps.domain.model.TransportType
Used in: DirectionsInput, EtaInput, DirectionsRoute, DirectionsStep, EtaEstimate
ConstantAPI valueDescription
AUTOMOBILE"Automobile"Car/road routing.
TRANSIT"Transit"Public transit routing.
WALKING"Walking"Pedestrian routing.
CYCLING"Cycling"Bicycle routing.

DirectionsAvoid

Import: com.williamcallahan.applemaps.domain.model.DirectionsAvoid
Used in: DirectionsInput
ConstantAPI valueDescription
TOLLS"Tolls"Avoids tolled roads where an alternative exists.

PoiCategory

Import: com.williamcallahan.applemaps.domain.model.PoiCategory
Used in: SearchInput, SearchAutocompleteInput, SearchResponsePlace
Complete list of all 42 constants:
ConstantAPI value
AIRPORT"Airport"
AIRPORT_GATE"AirportGate"
AIRPORT_TERMINAL"AirportTerminal"
AMUSEMENT_PARK"AmusementPark"
ATM"ATM"
AQUARIUM"Aquarium"
BAKERY"Bakery"
BANK"Bank"
BEACH"Beach"
BREWERY"Brewery"
BOWLING"Bowling"
CAFE"Cafe"
CAMPGROUND"Campground"
CAR_RENTAL"CarRental"
EV_CHARGER"EVCharger"
FIRE_STATION"FireStation"
FITNESS_CENTER"FitnessCenter"
FOOD_MARKET"FoodMarket"
GAS_STATION"GasStation"
HOSPITAL"Hospital"
HOTEL"Hotel"
LAUNDRY"Laundry"
LIBRARY"Library"
MARINA"Marina"
MOVIE_THEATER"MovieTheater"
MUSEUM"Museum"
NATIONAL_PARK"NationalPark"
NIGHTLIFE"Nightlife"
PARK"Park"
PARKING"Parking"
PHARMACY"Pharmacy"
PLAYGROUND"Playground"
POLICE"Police"
POST_OFFICE"PostOffice"
PUBLIC_TRANSPORT"PublicTransport"
RELIGIOUS_SITE"ReligiousSite"
RESTAURANT"Restaurant"
RESTROOM"Restroom"
SCHOOL"School"
STADIUM"Stadium"
STORE"Store"
THEATER"Theater"
UNIVERSITY"University"
WINERY"Winery"
ZOO"Zoo"
LANDMARK"Landmark"

SearchResultType

Import: com.williamcallahan.applemaps.domain.model.SearchResultType
Used in: SearchInput
ConstantAPI valueDescription
POI"poi"Point of interest.
ADDRESS"address"Address result.
PHYSICAL_FEATURE"physicalFeature"Physical geographic feature.
POINT_OF_INTEREST"pointOfInterest"Point of interest (alternate value).

SearchACResultType

Import: com.williamcallahan.applemaps.domain.model.SearchACResultType
Used in: SearchAutocompleteInput
Extends SearchResultType with an additional QUERY value for query suggestions:
ConstantAPI valueDescription
POI"poi"Point of interest suggestion.
ADDRESS"address"Address suggestion.
PHYSICAL_FEATURE"physicalFeature"Physical feature suggestion.
POINT_OF_INTEREST"pointOfInterest"Point of interest (alternate value).
QUERY"query"Generic query suggestion (not tied to a specific place).