Skip to content

SearchText

Source: src/AWS/GeoPlaces/SearchText.ts

Runtime binding for geo-places:SearchText — free-form place search that returns ranked results (POIs, addresses, streets) for a text query.

geo-places is a standalone, pay-per-call Amazon Location API with no resource to manage: the binding takes no arguments and grants the function geo-places:SearchText. Requests and responses are raw distilled types (no marshalling).

Provide the SearchTextHttp implementation layer on the Function effect (.pipe(Effect.provide(AWS.GeoPlaces.SearchTextHttp))), bind in the init phase, then call the client at runtime.

// init
const searchText = yield* AWS.GeoPlaces.SearchText();
// runtime
const result = yield* searchText({
QueryText: "Space Needle, Seattle",
MaxResults: 5,
});
const first = result.ResultItems?.[0];