LibraryActive

what3words JavaScript/TypeScript API Wrapper

JavaScript/TypeScript wrapper that integrates the what3words Public API into Node.js and browser environments.

Open source page

Field note

What it does

A JavaScript/TypeScript API wrapper for the what3words Public API, with clients, transports, and helper functions for Node.js and browser use.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

sdk

JavaScript / https://developer.what3words.com/tutorial/javascript

sdk

Python / Not filed

sdk

Java / Not filed

pypi

python / what3words

pypi

PHP / what3words/w3w-php-wrapper

sdk

objective-c / what3words

rest

Not filed / https://developer.what3words.com/public-api

sdk

Go / github.com/what3words/w3w-go-wrapper

sdk

dotnet / what3words.dotnet.wrapper

sdk

Java / Not filed

Product features

Product features

API

Convert 3-word addresses to coordinates and vice versa.

AutoSuggest

Validates user input and limits it to certain geographic areas.

AutoSuggest with clip-to-bounding-box

AutoSuggest with clip-to-bounding-box.

AutoSuggest with clip-to-circle

AutoSuggest with clip-to-circle.

AutoSuggest with focus and clip-to-country

AutoSuggest with focus and clip-to-country.

AutoSuggest clipping

Narrow suggestions to countries or a geographic area and set a Focus location.

AutoSuggest with focus

AutoSuggest with focus only.

autosuggest

Returns suggestions for possibly mistyped 3 word addresses.

AutoSuggest with Voice

AutoSuggest with Voice.

availableLanguages

Returns currently supported languages.

Built-in transports

Two built-in transports are available: isomorphic-unfetch and axios, requiring peer dependencies.

Carthage installation

Install the wrapper via Carthage from the GitHub repository.

API Clients

Clients validate request options and handle request/response and errors against an API endpoint; each extends ApiClient.

Clipping

Narrow AutoSuggest results to countries or a geographic area.

CocoaPods installation

Install the wrapper via CocoaPods using the git repository.

Convert to what3words address

Converts coordinates to a what3words address.

Convert to coordinates

Converts a what3words address to latitude and longitude.

ConvertToCoordinates

Converts a what3words address to latitude and longitude coordinates.

convertTo3wa

Converts coordinates to a what3words address.

convertToCoordinates

Converts a 3 word address to coordinates.

Custom endpoint

Specify your own Enterprise Suite API Server URL via withEndpoint.

Custom headers

Send custom headers to your own server via an optional setup parameter.

Custom server URL

Point the wrapper at your own Enterprise Suite API Server URL.

Custom transport

Design Assets

Get assets and best practice to design with what3words.

Error handling

Determine success via isSuccessful() and access code/message via getError().

Focus

Set Focus to the user's current location to improve AutoSuggest results.

GeoJSON serialization

Serialize results to GeoJSON.

Grid section

Returns a section of the 3m x 3m grid as lines for drawing onto a map.

GridSection

Returns a section of the 3m x 3m grid as lines for drawing on a map.

gridSection

Returns a 3m x 3m grid section as lines for map drawing.

isPossible3wa

isValid3wa

isPossible3wa

RegEx function that checks if a string could be a what3words address without calling the API.

isSuccessful / getError

Check call success and retrieve error code and message.

isValid3wa

RegEx function that verifies a what3words address with the API.

Manual installation

Drop W3wGeocoder.m and W3wGeocoder.h into your project.

Marketing Resources

Ready-to-go marketing assets for various industries.

Transports

A transport function executes requests against the API and returns a promise resolving to a TransportResponse.

W3WApiTextDataSource

Handles text-based tasks like address searching and conversions.

W3WApiVoiceDataSource

Specialises in voice-based address suggestions.

What3wordsService

Instantiates API clients and provides helpers for setting host, API version, and API key across clients.

withEndpoint