# Enterprise Suite The Enterprise Suite offers all the functionality of the what3words API and can also be embedded within apps or local infrastructure, offering: Section: [Enterprise Suite](https://developer.what3words.com/enterprise-suite.md) Source: https://developer.what3words.com/enterprise-suite Updated: 2026-11-27 - Offline functionality for under 5MB - Reduced latency - Ability to run on your own infrastructure [Watch the Enterprise Suite video](https://vimeo.com/364830963/e66bdd5a5d) - [Mobile SDKs](https://developer.what3words.com/enterprise-suite/mobile-offline-sdk): iOS and Android SDKs with offline functionality and reduced latency. - [C++ and Java SDKs](https://developer.what3words.com/enterprise-suite/cpp-java-sdk): A C++ library optimised for speed and memory, with a Java wrapper. - [API Server](https://developer.what3words.com/enterprise-suite/api-server): The what3words API as a Docker image, hosted on your own servers. ## Pricing The API Server and SDKs are charged via annual licence, or on a per-device basis, for example, car, phone or UAV. ## Get started To find out more or to get started with the Enterprise Suite, get in touch using the form below. > The enquiry form (first name, last name, email, company, industry and details) is on the web page given as Source above. It has a reCAPTCHA check, so it can only be sent from a browser. For information on how we will handle your contact details, please refer to our [privacy policy](https://what3words.com/privacy/). --- # API Server The API Server contains all the functionality of the what3words API, with the benefit of being hosted on local servers. Section: [Enterprise Suite](https://developer.what3words.com/enterprise-suite.md) Source: https://developer.what3words.com/enterprise-suite/api-server Updated: 2026-11-27 The API Server is provided as a Docker image, providing a quick and simple way of getting up and running and is then accessible from any programming language. The core features are: - Conversion of 3 word addresses to coordinates - Conversion of coordinates to 3 word addresses - Autosuggest - 60+ languages The easiest way to get started is to build using our Public API first before switching to the API Server, as this is licensed as part of the Enterprise Suite, for which businesses pay a monthly or annual fee. [Watch the Enterprise Suite video](https://vimeo.com/364830963/e66bdd5a5d) ## Get started To find out more or to get started with the Enterprise Suite, get in touch using the form below. > The enquiry form (first name, last name, email, company, industry and details) is on the web page given as Source above. It has a reCAPTCHA check, so it can only be sent from a browser. For information on how we will handle your contact details, please refer to our [privacy policy](https://what3words.com/privacy/). --- # C++ and Java SDKs The C++ and Java SDKs contain all the functionality of the what3words API, while offering offline functionality and lower latency. Section: [Enterprise Suite](https://developer.what3words.com/enterprise-suite.md) Source: https://developer.what3words.com/enterprise-suite/cpp-java-sdk Updated: 2026-11-27 The C++ library is highly optimised for speed and memory (RAM) footprint while the Java SDK provides a simple Java wrapper for the C++ SDK. Some of the key features: - Conversion of 3 word addresses to coordinates - Conversion of coordinates to 3 word addresses - Autosuggest - 60+ languages [Watch the Enterprise Suite video](https://vimeo.com/364830963/e66bdd5a5d) ## Get started To find out more or to get started with the Enterprise Suite, get in touch using the form below. > The enquiry form (first name, last name, email, company, industry and details) is on the web page given as Source above. It has a reCAPTCHA check, so it can only be sent from a browser. For information on how we will handle your contact details, please refer to our [privacy policy](https://what3words.com/privacy/). --- # Mobile SDKs The iOS and Android SDKs contain all the functionality of the what3words API, while also offering offline functionality and reduced latency. Section: [Enterprise Suite](https://developer.what3words.com/enterprise-suite.md) Source: https://developer.what3words.com/enterprise-suite/mobile-offline-sdk Updated: 2026-11-27 The code makes use of our C++ code, which is highly optimised for speed and memory (RAM) footprint. Core features: - Conversion of 3 word addresses to coordinates - Conversion of coordinates to 3 word addresses - Autosuggest - 60+ languages [Watch the Enterprise Suite video](https://vimeo.com/364830963/e66bdd5a5d) ## Get started To find out more or to get started with the Enterprise Suite, get in touch using the form below. > The enquiry form (first name, last name, email, company, industry and details) is on the web page given as Source above. It has a reCAPTCHA check, so it can only be sent from a browser. For information on how we will handle your contact details, please refer to our [privacy policy](https://what3words.com/privacy/). --- # Get started with the what3words API New to what3words? Use our step by step guide to find out how to tailor what3words to your needs. Section: [Get Started](https://developer.what3words.com/public-api.md) Source: https://developer.what3words.com/public-api Updated: 2026-11-27 [Get an API Key](https://accounts.what3words.com/select-plan?referrer=/public-api) · [Speak to the team](https://share.hsforms.com/1XLGKuKLPSBe8uNy5-5fukQ1p3ix) ## what3words API The what3words API is a fast and simple interface that allows you to convert 3 word addresses to coordinates and vice versa. It features a powerful AutoSuggest function, which can validate user input and limit it to certain geographic areas. We offer a variety of libraries, including Java, JavaScript, Swift, Python, Node.js, PHP and more to make our API easy to integrate for your business. [Reference docs](https://developer.what3words.com/public-api/docs) ## API wrappers - [.NET](https://developer.what3words.com/tutorial/dotnet) - [Android](https://developer.what3words.com/tutorial/android) - [C++](https://developer.what3words.com/tutorial/cpp) - [Dart](https://developer.what3words.com/tutorial/dart) - [Flutter](https://developer.what3words.com/tutorial/flutter) - [Go](https://developer.what3words.com/tutorial/go) - [Java](https://developer.what3words.com/tutorial/java) - [JavaScript](https://developer.what3words.com/tutorial/javascript) - [Objective-C](https://developer.what3words.com/tutorial/objective-c) - [PHP](https://developer.what3words.com/tutorial/php) - [Python](https://developer.what3words.com/tutorial/python) - [Ruby](https://developer.what3words.com/tutorial/ruby) - [Rust](https://developer.what3words.com/tutorial/rust) - [Swift](https://developer.what3words.com/tutorial/swift) --- # Help & support View our support pages for answers to common questions. Alternatively, contact us at [support@what3words.com](mailto:support@what3words.com). Section: [Guidelines & Support](https://developer.what3words.com/docs/guidelines-support.md) Source: https://developer.what3words.com/support Updated: 2026-11-27 [Go to support pages](https://support.what3words.com) · [Speak to the team](https://share.hsforms.com/1XLGKuKLPSBe8uNy5-5fukQ1p3ix) ## FAQs ### Does the what3words API provide speech recognition technology? Our API is designed to work with the speech recognition technology of your current voice supplier. If your voice supplier needs help recognising 3 word addresses, don't hesitate to get in touch. ### Does the what3words API provide online or offline maps, navigation or route optimisation? The what3words API translates 3 word addresses to GPS coordinates. It does not provide map or routing data. However, our API does provide a layer that can be used with any mapping software, meaning it can work well as part of your existing mapping, addressing and route optimisation solutions. ### How can I display part of the what3words grid on a map? The what3words API has a grid-section function (learn more in the [grid section of the API reference](https://developer.what3words.com/public-api/docs#grid-section)). This returns grid lines for the area supplied in GeoJSON format, which can be directly added to a web map or desktop GIS such as QGIS. To add the what3words grid to a Google Map, read this short tutorial: [Displaying the what3words grid on a Google Map](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-google-map). ### I have an Excel file of 3 word addresses. How can I add coordinates to them? Adding coordinates to a spreadsheet is easy using the what3words Excel Add-in. Once installed, you can use a formula to call the API and display a column of coordinates. To install our Excel Add-in, read our simple tutorial: [Using the what3words for Excel add-in](https://developer.what3words.com/tutorial/using-the-what3words-for-excel-add-on). ### How can I plot a file of 3 word addresses on a map? Adding a file of 3 word addresses is easy using the what3words ArcGIS Locator. Simply add the Locator to ArcGIS Online or Desktop and then drag and drop onto the map. Read the tutorial, [Plot what3words addresses on ArcGIS Online](https://developer.what3words.com/tutorial/how-to-plot-a-file-of-3-word-addresses-in-arcgis-online), for full details on how to add a CSV to ArcGIS Online. ### What languages does the what3words API support? The what3words API supports 60+ languages with more being added all the time (see the full, live list of languages [here](https://support.what3words.com/en/articles/1520194)). You can call the what3words API to find out the available languages programmatically using the available-languages function. Learn how in the [API reference](https://developer.what3words.com/public-api/docs#available-languages). ### I'm building a mobile app that uses the what3words API. Do you have any libraries to help me integrate? We have a range of API wrappers for easy integration into a mobile app. Find out more in the tutorials below: - [Swift](https://developer.what3words.com/tutorial/swift) - [Objective-C](https://developer.what3words.com/tutorial/objective-c) - [Android](https://developer.what3words.com/tutorial/android) ### I'm building a website that uses the what3words API. Do you have any libraries to help me integrate? Our range of API wrappers make it easy to integrate what3words into any website. Find out how to use them by reading the relevant tutorial: - [JavaScript and Node.js](https://developer.what3words.com/tutorial/javascript) - [PHP](https://developer.what3words.com/tutorial/php) - [Java](https://developer.what3words.com/tutorial/java) ### Do you have guidelines for how to display a 3 word address on my website? It's easy to add a 3 word address to a website by using the [embed code generator](https://what3words.com/products/embed-code-generator/). Check out our [UX guidelines](https://developer.what3words.com/tutorial/ux-guidelines). ### Do you have guidelines for how to display 3 word address search results on my website? For information on how to display search results, read our [UX guidelines](https://developer.what3words.com/tutorial/ux-guidelines). We recommend displaying the country flag and nearest region to give users context. ### Is it possible to restrict results that appear on my checkout page to only suggest 3 word addresses in my country? The results are automatically restricted to the delivery country field for all of our ecommerce plugins. For example, if a user selects a delivery country of the United Kingdom, all 3 word addresses suggested will be in the United Kingdom. ### I can't find a plugin to add a checkout page input field to my platform. Can I still add what3words to my checkout page? As long as your platform allows for customisation of your checkout page, you can add a 3 word address input field to the page. We recommend using our JavaScript Autosuggest Component, which just involves adding a script and an HTML element to the page. Read this quick tutorial to find out more: [Web Search Box](https://developer.what3words.com/tutorial/javascript-autosuggest-component). ### Is it possible for my website / app to open the what3words app at a specific 3 word address? You can open the what3words app at a specific 3 word address from your app using our Android intents or iOS Custom URL scheme `w3w://show?threewords=index.home.raft`. For examples of how to do this on Android and in Swift/Objective-C on iOS, read the following tutorial: [Mobile linking to the what3words app](https://developer.what3words.com/tutorial/mobile-linking-to-the-what3words-app). ### Do you have instructions for how to set up the what3words ArcGIS Locator in ArcGIS Desktop and Online? Adding the what3words ArcGIS Locator to ArcGIS Online is straightforward. Read the following tutorial for step-by-step instructions: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Can I make the what3words ArcGIS Locator available to the whole of my organisation in ArcGIS Online? You can add the locator as Content in ArcGIS Online and then make it available to your whole organisation as a Utility Service from within the Organization settings. Read the following tutorial for a step-by-step guide: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Is POI data provided with the what3words API? Our API returns GPS coordinates when a 3 word address is entered. It does not provide additional information about buildings, addresses or points of interest nearby. ### Does the what3words ArcGIS Locator work with the ArcGIS apps? The what3words ArcGIS Locator works within apps that connect to ArcGIS Online and accept a custom locator. The locator works with Survey123 and can be used to search and discover 3 word addresses, and add them as a survey question. Read a step-by-step tutorial here: [Survey123](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online-and-survey123). ### Is there a QGIS plugin available for the what3words API? Yes. The QGIS plugin was developed by Planet Federal and is compatible with QGIS 2. It allows for searching and discovering 3 word addresses, and can be downloaded from GitHub and added to QGIS as a plugin. To get started, read the tutorial: [Adding the Planet Federal what3words plugin to QGIS](https://developer.what3words.com/tutorial/adding-the-planet-federal-what3words-plugin-to-qgis). ### I can't find a plugin for my GIS platform. Can I still add the what3words API to my GIS? There are other third-party plugins available for many GIS tools, for example, FME and Cadcorp: [what3words map tools](https://what3words.com/products/?category=Map%20tools). Our Python wrapper makes it straightforward to build a new plugin or build a bespoke workflow. Get started by reading our tutorial for the Python wrapper: [Python](https://developer.what3words.com/tutorial/python). ### Can I download a GIS file of 3 word addresses and grid? Yes. The what3words API has a GeoJSON response parameter (find out more in the [grid section of the API reference](https://developer.what3words.com/public-api/docs#grid-section)). This function returns the grid lines for the area, or the 3 word address supplied in GeoJSON format, which can then be directly added to a web map or desktop GIS such as QGIS. The steps to add to QGIS for a small area are as follows: 1. Put the grid section URL into your internet browser specifying the bounding box and GeoJSON response type 2. Copy the GeoJSON response to a shapefile 3. Load the shapefile into QGIS ### Does the what3words ArcGIS Locator work offline? The public what3words ArcGIS Locator is available for online applications only. In order to set up an offline version of the Locator you can set up a local version of the Locator alongside our API Server or C++ SDK. Find out more in the [Enterprise Suite](https://developer.what3words.com/enterprise-suite) section. ### Is it possible to use what3words within an offline app? You can use what3words offline with the what3words mobile SDKs for Android and iOS. For more information see the [Enterprise Suite](https://developer.what3words.com/enterprise-suite) section. ### Is there a guide to how to migrate from what3words API V2 to API V3? Migrating from what3words API V2 to V3 is straightforward with a simplified interface. Read our tutorial to learn the differences between versions and how to migrate: [Migrating an application from API V2 to API V3](https://developer.what3words.com/tutorial/migrating-an-application-from-api-v2-to-api-v3). ### Do you have a regular expression for a 3 word address? We have a RegEx for partial 3 word addresses (to recognise when a 3 word address is being typed) as well as for full 3 word addresses. To learn more, read our tutorial on the RegEx expression: [Regex](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address). ### Does ArcGIS support China? Yes. Our ArcGIS locator provides the same response as our API does for a record in China. You will need to make sure you display the 3 word address in the correct coordinate system that matches your other datasets. If you display the 3 word address on a map, make sure the map is a licensed Chinese map using the correct coordinate system. The standard ArcGIS Online map will work for this purpose. --- # Tools Our tools provide an easy way to use the what3words API within other products without needing to do any development. Source: https://developer.what3words.com/tools Updated: 2026-11-27 To use what3words with one of our tools, first sign up for a developer account and create an API key. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). [Watch the what3words tools video](https://vimeo.com/1125865557/e66bdd5a5d) ## Tools and resources - [E-commerce](https://developer.what3words.com/tools/e-commerce): It’s easy to add a 3 word address field to your storefront with one of the what3words e-commerce plugins. - [Excel Add-in](https://developer.what3words.com/tools/excel-addin): Access the what3words API functionality easily within Microsoft Excel by downloading the what3words Excel Add-in. - [GIS extensions](https://developer.what3words.com/tools/gis-extension): Display the 3 word address for any location or search for a 3 word address, either individually or via batch conversion to and from GPS coordinates, using what3words GIS extensions. --- # E-commerce plugins It’s easy to add a 3 word address field to your online checkout. what3words plugins are available for all major e-commerce platforms. Source: https://developer.what3words.com/tools/e-commerce Updated: 2026-11-27 [Watch the what3words e-commerce plugins video](https://vimeo.com/1125865557/e66bdd5a5d) - [Adobe Commerce (formerly Magento)](https://developer.what3words.com/tools/e-commerce/adobe-commerce) - [WooCommerce](https://developer.what3words.com/tools/e-commerce/woocommerce) - [WordPress](https://developer.what3words.com/tools/e-commerce/wordpress) - [OpenCart](https://developer.what3words.com/tools/e-commerce/opencart) - [Shopify](https://developer.what3words.com/tools/e-commerce/shopify) - [AeroCommerce](https://developer.what3words.com/tutorial/installing-the-what3words-aerocommerce-extension) - [CubeCart](https://developer.what3words.com/tutorial/installing-the-what3words-cubecart-extension) - [BigCommerce](https://developer.what3words.com/tutorial/installing-the-what3words-bigcommerce-app) - [Ecwid](https://developer.what3words.com/tutorial/installing-the-what3words-ecwid-app) - [Haravan](https://developer.what3words.com/tutorial/adding-what3words-field-to-your-haravan-store) - [Shopware](https://developer.what3words.com/tutorial/installing-the-what3words-shopware-plugin) - [NopCommerce](https://www.nopcommerce.com/en/what3words-plugin) - [Wix](https://developer.what3words.com/tutorial/adding-your-what3words-ecwid-app-to-your-wix-site) - [Swiftcomplete](https://developer.what3words.com/tutorial/adding-swiftcomplete-address-autocomplete-to-ecommerce-checkout) ## E-commerce FAQs ### Is it possible to restrict results that appear on my checkout page to only suggest 3 word addresses in my country? The results are automatically restricted to the delivery country field for all of our ecommerce plugins. For example, if a user selects a delivery country of the United Kingdom, all 3 word addresses suggested will be in the United Kingdom. ### I can't find a plugin to add a checkout page input field to my platform. Can I still add what3words to my checkout page? As long as your platform allows for customisation of your checkout page, you can add a 3 word address input field to the page. We recommend using our JavaScript Autosuggest Component, which just involves adding a script and an HTML element to the page. Read this quick tutorial to find out more: [Web Search Box](https://developer.what3words.com/tutorial/javascript-autosuggest-component). [View all FAQs](https://developer.what3words.com/support) --- # Installing the Adobe Commerce (formerly Magento 2) extension Adding and configuring the what3words Adobe Commerce (formerly Magento 2) extension. Topics: Adobe Commerce (formerly Magento), E-Commerce Source: https://developer.what3words.com/tools/e-commerce/adobe-commerce Updated: 2026-11-27 ### Step by step The what3words Adobe Commerce (formerly Magento 2) extension allows you to add a 3 word address field to a checkout page. Store users can then add a 3 word address to orders and are provided 3 word address suggestions as they type. The user can also save 3 word addresses to their account for future use. **Magento 2 Minimum Supported Version:** 2.3, 2.4, 2.4.4, 2.4.5, 2.4.6 ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The Adobe Commerce (formerly Magento 2) extension can be installed in 2 ways: 1. Follow this [installation guide](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/extensions.html); 2. Use `Composer` and `Packagist` to ensure that all dependencies are installed along with the extension. To add the extension to a store using `composer` and `packagist`, first, connect to your server and start the command line interface. From the CLI run the composer command to install the files and dependencies required by the extension, it will pull the latest release of this plugin from this [what3words GitHub page](https://github.com/what3words/magento2-w3w-plugin/releases) **PHP** ```php composer config repositories.what3words git https://github.com/what3words/magento2-w3w-plugin.git composer require what3words/module-what3words ``` Next, to compile the site to ensure it includes the new extension run the following commands (as with any other Magento module): **PHP** ```php php bin/magento deploy:mode:set --skip-compilation production php bin/magento setup:di:compile php bin/magento setup:static-content:deploy # here set the themes to be compiled and the language php bin/magento maintenance:enable php bin/magento setup:upgrade --keep-generated php bin/magento maintenance:disable ``` We also recommend running `php bin/magento cache:clean` and `php bin/magento cache:flush` to ensure the site cache is cleared. ## 3. Enable module ![magento2 settings page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/824c333afe5c340494c7a7c4277df15dc540bdd8ecaf6b21b518bf16664c549d.png) Select the store settings and a new category `what3words` will be available. Within the configuration page add the API Key. We also recommend using a `placeholder` text with an example of the what3words address to demonstrate to users the correct format they should follow to enter their own what3words. For example, `eg. ///filled.count.soap`. Find out how can you customise your extension in the [**Additional Settings**](https://developer.what3words.com/tutorial/installing-the-magento-2-extension#additional-settings) section below. ![magento2-w3w-field-checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bc75435e01b527a0592f0d59d2b0b112ae9c6f69bb1b7cece370af95712a5bbe.png) A new field will then be available on the site’s checkout page. ## 4. Add to Address template ![magento2-config-addr-template](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b9b48676678849c2d915165574937051171f258e1ba899c2c12582051de8433.png) For the what3words address to appear on invoices, delivery labels, and packaging slips you will need to add the following attributes to the Customer Address Templates: `w3w` → the chosen 3 words address returned by the address validation and saved in the database; `w3w_nearest` → the value of the nearest place of the chosen 3 words address saved in the database. This value will be available only if the option *Save nearest place* is set to yes in the settings page of the what3words plugin. `w3w_coordinates`  → the coordinates of the chosen 3 word address saved in the database.  This value will be available only if the option *Save coordinates* is set to yes in the settings page of the what3words plugin. To get to the Customer Address Templates of your Store: `“Stores”  > “Configuration”> “Customers” > “Customer Configuration” > “Address  Templates”` Add the following to each of the templates: **PHP** ```php Text: {{if w3w}}{{var w3w}}{{/if}} {{if w3w_nearest}}{{var w3w_nearest}}{{/if}} {{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}} Text One Line: {{var w3w}}, {{var w3w_nearest}}, {{var w3w_coordinates}}, HTML: {{if w3w}}{{var w3w}}{{/if}}
{{if w3w_nearest}}{{var w3w_nearest}}{{/if}}
{{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}}
PDF: {{if w3w}}{{var w3w}}{{/if}}| {{if w3w_nearest}}{{var w3w_nearest}}{{/if}}| {{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}}| ``` ## 5. Obtain what3words via Stores API In Magento, the what3words address attributes are stored in the customers’ shipping addresses of the Magento Customers and Orders REST APIs. 1\. The API request to make to the Magento Customers REST API should be: `GET {{magento_base_url}}/rest/V1/customers/{{customer_id}}` The API response should be: **JavaScript** ```javascript "addresses": [ { "id": 3, "customer_id": 4, ... "custom_attributes": [ { "attribute_code": "w3w", "value": "filled.count.soap" }, { "attribute_code": "w3w_coordinates", "value": "-0.195521 ,51.520847" }, { "attribute_code": "w3w_nearest", "value": "Bayswater, London" } ] }, ... ] ``` 2\. The API request to make to the Magento Orders REST API should be: `GET {{magento_base_url}}/rest/V1/orders?searchCriteria[currentPage]=0` The API response should be: **JavaScript** ```javascript "extension_attributes": { "shipping_assignments": [ {"shipping": { "address": { "address_type": "shipping", ... "extension_attributes": { "w3w": "///filled.count.soap" } }, ... ``` ## 6. Localising strings The what3words extension allows you to modify default strings in your custom theme to load and use [translation dictionaries](https://developer.adobe.com/commerce/frontend-core/guide/translations/dictionary#terms). Learn more about locales, modifying strings, and how the application searches and applies translations in this [tutorial page](https://developer.adobe.com/commerce/frontend-core/guide/translations/dictionary). In case you are using a PWA (progressive app) in Magento. The way to translate the strings of our plugin is mentioned in this [developer guide](https://developer.adobe.com/commerce/pwa-studio/guides/general-concepts/internationalization/). ## 7. Upgrade module To update or upgrade the what3words module: 1. Download the updated file from [Marketplace](https://marketplace.magento.com/what3words-module-what3words.html) or another extension developer. Take note of the module name and version. 2. Export the contents to your application root directory. 3. Since the Composer package exists for this module, run one of the following. Update per module name: **PHP** ```php composer update what3words/module-what3words ``` Update per version: **PHP** ```php composer update what3words/module-what3words ^x.x.x ``` Run the following commands to upgrade, deploy, and clean the cache. **PHP** ```php bin/magento setup:upgrade --keep-generated bin/magento setup:static-content:deploy bin/magento cache:clean ``` ## 8. Uninstall In case you wish to uninstall the what3words Magento plugin that has been installed by composer, you can use the following command: **PHP** ```php php bin/magento module:uninstall What3Words_What3Words --remove-data ``` ## 9. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 10. Additional settings ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. The coordinates will added to your order and visible in your Sales page on Magento. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Save nearest place If you need to capture the nearest place information for a three word address to help with delivery information, for example, you should check the *Save nearest place* checkbox. The nearest place info will added to your order and visible in your Sales page on Magento. ### Custom Label You can override the default label for the address field by selecting this option and specifying the placeholder text. We recommend you use the default label value, as it provides your customers with an example of how to use the what3words Address Field. ### Custom Placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field. ### Tooltip In order to provide guidance to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > *what3words addresses help our delivery partners find you first time. Find yours at [what3words.com](https://delivery.w3w.co/).* ### Custom Tooltip message You can override the default Tooltip explainer text that you can see when you click on the question mark icon next to the what3words field. ### Custom Error message You can override the default Error message when you enter an invalid what3words address in the input field. ### Support of RTL language You can set the HTML direction of your site using a right-to-left language on the configuration page. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field.** For most checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### AutoSuggest Focus In addition to country clipping, it is also possible to add focus to your what3words address suggestions by selecting the Autosuggest Focus feature. The AutoSuggest Focus feature uses the users’ location as focus for AutoSuggest to provide better suggestions if the store has the users’ location permission. ## 11. Support **Have any questions?** We’re here to support you! If you have any questions while using what3words, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com) --- # Installing the what3words OpenCart Extension Adding and configuring the what3words OpenCart plugin. Topics: OpenCart, E-Commerce Source: https://developer.what3words.com/tools/e-commerce/opencart Updated: 2026-11-27 ### Step by step The OpenCart Extension enables you to add a field to your checkout page that can accept 3 word addresses and provide autosuggest results as a user type. **OpenCart Minimum Supported Version**: > 2.3.x up to 3.0.x, and 3.0.x up to 4.0.x ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e492ab1c2df50607adce7d4915c643d70d69997428cc9c0b635d834751db6e92.png) Add a what3words address field to your checkout page on OpenCart by clicking this button below [DOWNLOAD](https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=31868) Upload the file to your store within the OpenCart admin portal using the Extension Installer. ## 3. Enable plugin ![opencart-modules](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ea17fd92828ac0093b64c5f0c0166d9dffda3c75d9e073a4f524fe0e666bad31.png) Once installed, go to the admin panel section `Extensions > Extensions`, and from the drop-down select `Modules`, where you should see the `what3words` extension appear. Click on the `Edit` button, then to enable the module you need to change the status of the `what3words` module to `Enabled`. ## 4. Add your API Key ![opencart-settings-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ce9d45cedb75b42814b3d608cf0d283f82c33852544c08fa99397da2ea6154e2.png) You will need a what3words API key to use this plugin, as it authenticates and interacts with the [what3words API](https://developer.what3words.com/public-api). If you don’t have a what3words API key yet, you can quickly and easily [sign up and register](https://accounts.what3words.com/create-api-key) for one. Once you have a what3words API key: 1. Enter your API Key into the API key field. 2. Click *Save* ## 5. Check if the field is appearing ![opencart-checkout-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ba21f36912d43f4940d4bdd881285e0ac722bceb8788cd1c826723a824026f3e.png) A new field should now be appearing on your checkout under Billing and Shipping. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible in order preview and shipping label screens. ## 6. How to obtain the what3words field using Stores API In OpenCart, the what3words address attributes are stored in the customers’ orders of the OpenCart Orders REST APIs as: - `shipping_three_word_address` - `shipping_w3w_coordinatesLng` when the `save coordinates` option is enabled - `shipping_w3w_coordinatesLat` when the `save coordinates` option is enabled - `shipping_w3w_nearestPlace` when the `save nearest place` option is enabled The API request to make to the OpenCart Orders REST API should be: `GET {{your-opencart-site}}/index.php?route=api/order/info&api_token={{api_token}}&order_id={{order_id}}` The API response should be: **JavaScript** ```javascript { "order": { "order_id": "3", ... "shipping_three_word_address": "///filled.count.soap", "shipping_w3w_coordinatesLng": -0.195521, "shipping_w3w_coordinatesLat": 51.520847, "shipping_w3w_nearestPlace": Bayswater, London, ... "comment": "ship to w3w address ///filled.count.soap", ... } ``` ## 7. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error message: `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional settings ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. The coordinates will added to your order and visible in your Sales page on Opencart. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Save nearest place If you need to capture the nearest place information for a three word address to help with delivery information, for example, you should check the *Save nearest place* checkbox. The nearest place info will added to your order and visible in your Sales page on Opencart. ### Custom Label You can override the default label for the address field by selecting this option and specifying the placeholder text. We recommend you use the default label value, as it provides your customers with an example of how to use the what3words Address Field. ### Custom Placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field. ### Tooltip In order to provide guidance to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > *By entering your 3 word address you make it much easier for our delivery partners to find you first time. To discover your 3 word address, visit [what3words.com](https://delivery.w3w.co/).* ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field.** For most checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### AutoSuggest Focus In addition to country clipping, it is also possible to add focus to your what3words address suggestions by selecting the Autosuggest Focus feature. The AutoSuggest Focus feature uses the users’ location as focus for AutoSuggest to provide better suggestions if the store has the users’ location permission. --- # Adding the what3words Shopify app Adding and configuring the what3words Shopify Plus and Shopify Basic apps. Topics: Shopify, E-Commerce Source: https://developer.what3words.com/tools/e-commerce/shopify Updated: 2026-11-27 The what3words Shopify app allows a what3words address field to be added to a Shopify store. Customers can then provide a what3words address with orders for faster and more reliable deliveries. ## 1. Add app to your Store Add a what3words address field to your checkout page on Shopify by clicking this button below [Install](https://apps.shopify.com/what3words-address-field) ## 2. Select your theme (instructions will show based on theme selected) ### Basic Theme OS 2.0 For a quick walkthrough, please watch [this tutorial](https://youtu.be/VAheKz1ryn8) ### Installation process 1\. Go to the what3words app on the Shopify app store and click on **Install** 2\. From your Shopify admin, go to **Online Store > Themes** 3\. Click **Customize** 4\. Navigate to the **Cart** page 5\. Under **Apps**, select **Add Block > what3words Widget** 6\. Drag the what3words app block so it’s above the checkout button on the Cart page 7\. Click the **I have completed the steps** button to finalise the installation. **Note:** You can now add the what3words address to your cart drawer page instead of your cart page by following these easy steps: 1\. From your Shopify admin, go to **Online Store > Themes** 2\. Click  **… > Edit code** 3\. In the **Templates** directory, click **cart-drawer.liquid**. Find a suitable place in your theme where you want to use the widget and insert the following code shown below. We recommend placing it above the **customer** **note** or **checkout** button:
**data-alignment** is used to align the field to the right, left, or center **data-width** is used to specify the width of the field, e.g. 350px. ### Basic Theme OS 1.0 For a quick walkthrough, please watch [this tutorial](https://youtu.be/RywrHXet0sE) ### Installation process 1\. Go to the what3words app on the Shopify app store and click on **Install** 2\. From your Shopify admin, go to **Online Store > Themes** 3\. Click  **… > Edit code** 4\. In the **Templates** directory, click **cart.liquid**. Find a suitable place in your theme where you want to use the widget and insert the following code shown below. We recommend placing it above the **checkout** button:
**Note:** If you have a **cart-drawer.liquid** you could add this code snippet to it, then the what3words address field will be visible on your cart drawer page instead of your cart page. 5\. Click the **I have completed the steps** button to finalise the installation. ### Plus - Checkout Extension For a quick walkthrough, please watch [this tutorial](https://youtu.be/-acIEiMvchs) ### Installation process 1\. Go to the what3words app on the Shopify app store and click **Install.** 2\. From your Shopify admin left-hand panel, open **Online** **Store** in a new tab to keep the **Installation process** page open. 3\. The page will open on **Themes**, click **Customize**. 4\. In the dropdown menu at the top of the page, select **Checkout**. 5\. Click **Add** **app** **block** in the bottom left and select ‘**checkout-ui-extension**’ by what3words from the list. 6\. We also strongly recommend enabling the following feature: - ***Store address in notes*** This is to pass what3words addresses on to carriers and order management software. ![shopify-notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/49cec7bfb05b136bd4ba47127354a75a5493d4601941ce218495e187894ae7f2.w1600.webp) 7\. Scroll back up and click the arrow at the top of the left-hand panel to **go back** to your sections 8\. Click and drag **checkout-ui-extension** down to below Shipping address. 9\. Click **Save** at the top right of the page. 10\. Return to the **Installation****process** tab and click **I have completed the steps.** ## 3. Customisation and extra features ### Customisable settings There are several settings that can be altered via the “Settings” page of the app: **Enable what3words field:** By default, the what3words address field will be visible on your site. Uncheck this to remove the what3words field. **Enable tooltip**: By default an `(i)` icon will appear next to the field with a tooltip to explain what3words and a link to the what3words Map Site. Uncheck this to remove the icon and tooltip. **Custom field label**: By default the field label is `what3words address (optional)`. We recommend keeping this as is but it can be changed if desired. **Custom placeholder**: Changes the placeholder text of the field. **AutoSuggest Focus**: If the website knows the user’s location then use the location to provide better what3words address suggestions. **Add what3words address to your Order Notes**: You can easily add the what3words address as an optional note that a shop owner can attach to the order. Currently, the what3words address is added by default as extra information in the `Additional details` section of an order details page. **Save Recent what3words Addresses:** You can choose whether recent what3words addresses should be saved and shown in the app block, cart snippet and checkout for logged-in customers. When enabled, saved addresses will be suggested for future purchases. Merchants can now save recent what3words addresses within orders by adding what3words order metafields, supporting internal reporting, location analytics, and improved customer experience. **Clipping options**: Restrict suggestions to a country, circle, bounding box, or polygon ![shopify-basic-settings.png](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a3baedc594d0d1e8e2213ed3b438b1d7a5a4aaeb06140112f851491069f2508d.w1600.webp) ### Viewing the what3words address for an order The what3words address is saved against an order within the **Additional Details** section of the order page. This can then be printed on order summaries or exported with orders to pass on to delivery companies. ![Orders Admin page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e8cd113aa72bce76d703cb7f6c33baca29155c35e938bf6c7e5e0b9202121ce0.w1600.webp) ### Adding what3words Addresses to Order Notes To enhance order tracking and reporting, you can add a what3words address as an optional Order notes attached to each order. By default, the what3words address is included as extra information in the `Additional details section` of the order details page. For a more customised setup, consider adding the what3words address to your order notes. This setup not only allows shop owners to easily view and manage precise location data within their order records but also enables seamless transfer of what3words addresses to carriers or any other Order Management Systems (OMS). This supports internal reporting, and location-based analytics, and improves customer experience by simplifying accurate address management and integration with delivery workflows. ![shopify-add-orders-notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ab7a93be98fe6e46edbe0a3a28c20ad7dc066093106057dac11ca93bdf841f19.w1600.webp) ### Saving Recent what3words Addresses to Orders and as Order Metafields You can allow recent what3words addresses to be saved and displayed in the app block, cart snippet, and checkout for logged-in customers. Here is the settings page of the plugin in a Shopify Plus store: ![shopify-plus-save-recents-on-settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b2baf8c0c3a9fceb9d3a36ae6593423b86dec53123852d5cdf1d5817c3cd122.w1600.webp) When enabled, these saved addresses will appear as suggestions for future purchases, enhancing user convenience. Additionally, merchants can save recent what3words addresses within orders by creating a dedicated what3words orders metafield. This enables internal reporting, supports location analytics, and enhances customer experience with streamlined, location-specific data. Here’s a step-by-step guide to adding an orders metafield for what3words addresses in Shopify: 1\. Access Metafields: Start by navigating to `Settings` and searching for `Metafields`. 2\. Define Metafields: Go to Metafield Definitions and select `Orders` from the list. 3\. Unstructured Metafields: Within Orders, select `View unstructured metafields`. 4\. Add what3words Address: Locate the new definition `what3words.address`. Click `Add Definition`. 5\. Set Name and Description: Provide a clear name (e.g., “what3words Address”) and description (e.g., “Stores the 3 word address for each order”). 6\. Select Data Type: Choose `Single line text` as the data type. You may also add a JavaScript regex for validating the format of a what3words address: ``[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}`` You can find out more on how to find what3words within a text in this [tutorial](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address#ai-llms-no-real-time-autosuggest). 7\. Configure Access Options: In the options section, select **Read** for *Storefront Access* to allow customers to view the address, and **Read and Write** for *Customer Accounts Access* to enable saving and updating addresses. This setup ensures that customer data is secure while allowing necessary access for updates. 8\. Save: Click `Save` to finalise the metafield configuration. Once saved, return to Orders to see your new what3words order metafield. This field will automatically populate whenever customers add a what3words address, giving merchants easy access to precise location data for order processing and reporting. ![Shopify-add-order-metafield](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/67f1a53d8f289629d91d37dbd5d0e4f91989eddacf45f55181434c48a11d5be7.w1600.webp) ### Enabling the what3words Field in Shop Pay for Shopify Plus (Checkout Extension) Our checkout extension can now be integrated with Shop Pay for Shopify Plus stores using the checkout extension. Shop Pay offers a fast, secure checkout experience, allowing customers to save their information for streamlined future purchases. By updating the checkout behaviour of the what3words plugin, you can include a dedicated what3word field at the bottom of the Shop Pay form, enabling precise location data collection right at checkout. Steps to Enable the what3words Field in Shop Pay: 1\. Access Your Checkout Page: Start by navigating to your checkout page in your Shopify admin. 2\. Locate the what3words App Block: Find the what3words app block within the checkout page configuration. 3\. Configure Settings: • Open the Settings page for the what3words plugin. • Go to **Checkout Behavior** and enable the option to **Include App Block in Shop Pay**. 4\. Preview Shop Pay: Verify that Shop Pay is enabled in your payment settings, then preview the checkout to confirm that the what3words field appears within the Shop Pay form. Once configured, the what3words field will display on the Shop Pay checkout form, storing the precise 3 word address directly in the order details as standard, ready for use in order processing and reporting. ![shopify-plus-shop-pay](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a9fe777d53f3063caa57eee9e1de62a52a778d852a3ad9bbed2362995ed247aa.w1600.webp) ### Adding what3words to your order confirmation email 1. Go to the **Dashboard** of the plugin. 2. From your Shopify admin, go to **Settings > Notifications > Order** confirmation. 3. Find the Liquid variable `{{ shipping_address | format_address }}` that references the shipping address. 4. Insert this code immediately below: {% if attributes\["what3words address"\] %} what3words address {{ attributes\["what3words address"\] }} {% endif %} ### Adding what3words to your order invoice 1. Go to the **Dashboard** of the plugin. 2. From your Shopify admin, go to **Settings > Notifications > Order** confirmation. 3. Find the Liquid variable `{{ shipping_address | format_address }}` that references the shipping address. 4. Insert this code immediately below: {% if attributes\["what3words address"\] %} what3words address {{ attributes\["what3words address"\] }} {% endif %} ### Sharing the what3words address with Order Management Systems **Note:** This section is for customers that would like to share the what3words address of each order with Order Management Systems. In Shopify, the what3words address attributes are stored in the customers’ orders of the Shopify Orders REST API as `note_attributes` and also as `note`. For more information on how endpoints and requests to the Shopify REST ADMIN API, please [follow this guide](https://shopify.dev/api/admin-rest#endpoints). The API request to make to the Shopify Orders REST API should be: `GET {{your-shopify-site}}/admin/api/2022-07/orders/{{your-order-number}}.json` The API response should be: "note": "what3words address: ///filled.count.soap" "note\_attributes": \[{ "name": "what3words address", "value": "filled.count.soap" }\] Another way to display easily what you can retrieve from the Shopify REST ADMIN API is by going to the `Admin page > Orders > (number of order)` and adding at the end of this path `.json`. For example: `https://.myshopify.com/admin/orders/4253206970468.json`. Search for `note` and `note_attributes`, your what3words address will be stored within this parameter. **Note:** By attaching what3words address to the `note` the store owner can now print shipping labels and packaging slips with the what3words address as a note of the order. ![Shopify Orders API](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3cb4cbb1332aa58f295c806342ee14376427015d4f3cc3e292c58663809474dc.w1600.webp) ### Troubleshooting If you are stuck with the installation of our plugin or are using a custom theme, you can give our support team collaborator access to your Shopify admin directly through your own Partner Dashboard or using the Shopify app. These collaborator permissions give our support team access to only the sections of your store that you want us to see. Only the store owner or staff with **Manage collaborator requests** permission, can view collaborator access requests or grant collaborator access to a store. Otherwise, contact our [support team](mailto:support@what3words.com) they will be able to submit a request to access your store, and you will receive an email about the request and a notification on your Shopify Home. Please make sure you mentioned your store website. Alternatively, if you have a collaborator request code enabled, then you need to provide the collaborator request code to our [support team](mailto:support@what3words.com). --- # Installing the what3words Address Field Plugin for WooCommerce Adding and configuring the what3words WooCommerce plugin. Topics: WooCommerce, WordPress, E-Commerce Source: https://developer.what3words.com/tools/e-commerce/woocommerce Updated: 2026-11-27 The what3words WooCommerce app allows a what3words address field to be added to the checkout page of a WooCommerce store. This enables customers to provide a what3words address with orders for faster and more reliable deliveries. For a quick walkthrough, please watch this video: [https://youtu.be/YT5gAkxtjLI](https://youtu.be/YT5gAkxtjLI) ### Step by step **WordPress Minimum Supported Version**: 4.7 or higher [Arabic version](https://drive.google.com/file/d/1zb8wH6BW_r9Fh_IUytgCOLt7UwvDDYjs/view?usp=sharing) ## 1. Get an API Key Generate a what3words API key so you can use the app on your checkout [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installing the what3words plugin for WooCommerce Go to your WordPress Dashboard, select **Plugins**, click **Add New** then search for what3words. Click **Install** and then **Activate**. [Get the app](https://wordpress.org/plugins/3-word-address-validation-field/#description) ## 3. Locate the app Find the what3words app in your Plugins list and click **Settings**. ## 4. Add your API key Copy in the API key you created earlier and press **Save**. ## 5. Add widget to checkout page Under **Settings**, make sure **Add what3words address field to my checkout for me** is selected and press **Save**. ## 6. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional Settings ### Using custom fields Instead of letting the plugin create a field,  you can customise which field(s) to convert to a what3words Address Field by selecting *Convert an existing field to a what3words Address Field* option and providing selectors for the inputs to convert. You can use any DOM compliant query selector(s) here to specify a single or multiple fields that you wish to convert. **N.B. When using input selectors you should ensure each input field has a unique name attribute to ensure clashes do not occur if multiple what3words Address Fields appear on a single page.** If you want to add a new custom field to extend as a what3words Address Field you should first create an input field on the page you wish to add this functionality to and provide with a name, id and/or that can then use in the input selector to specify it. (Be careful when using classes as it can apply this behaviour to multiple fields.) If you want to capture the selected what3words address you should wrap this field in a form with a submit button and this will then be submitted as specified by your form. ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. If you have added the what3words Address Field to your WooCommerce checkout and you select *Save coordinates* the coordinates for the billing and shipping address fields will added to your order and visible in your Orders page on WooCommerce. If you are using custom field(s) for the address then you the component will automatically attach hidden fields for both the latitude and longitude of the coordinates for the adddress prefixed with the name you supplied to the input field. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Adding a label For improved accessibility it is recommended that you add a label to your what3words Address Field. By checking this option and supplying some text for the label you can easily associate a label to each of your address field(s). For WooCommerce customers this option allows you to override the default label associated to the address field(s), while for custom field users this option tells the plugin to create a label field for you. ### Custom placeholder You can override the default placeholder for the address field(s) by selecting this option and specifying the placeholder text. We recommed you use the default placeholder value as it provides your customers with an example of how to use the what3words Address Field. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the overlap of the polygons is what forms the suggestions provided when using the what3words Address Field.** For WooCommerce checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### Viewing the what3words address of an order When a what3words address is captured in this field, it will be saved within the **order details** and will be visible in the order preview and shipping label screens. ### How to obtain the what3words field using Stores API In WooCommerce, the what3words address attributes are stored in the customers’ orders of the WooCommerce Orders REST API as a `meta_data` field. The API request to make to the WooCommerce Orders REST API should be: `GET {{your-wordpress-site}}/wp-json/wc/v3/orders` The API response should be: "meta\_data": \[ { "id": 606, "key": "\_billing\_w3w", "value": "///filled.count.slap" }, { "id": 607, "key": "\_billing\_nearest\_place", "value": "Wednesfield, W. Midlands" }, { "id": 608, "key": "\_billing\_w3w\_lat", "value": "52.599329" }, { "id": 609, "key": "\_billing\_w3w\_lng", "value": "-2.083533" }, { "id": 610, "key": "\_shipping\_w3w", "value": "///filled.count.slap" }, { "id": 611, "key": "\_shipping\_nearest\_place", "value": "Wednesfield, W. Midlands" }, { "id": 612, "key": "\_shipping\_w3w\_lat", "value": "52.599329" }, { "id": 613, "key": "\_shipping\_w3w\_lng", "value": "-2.083533" }, ... \], ### Have any questions? We’re here to support you! Get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Installing the what3words Address Field Plugin for WordPress Adding and configuring the what3words WordPress plugin. Topics: WooCommerce, WordPress, E-Commerce Source: https://developer.what3words.com/tools/e-commerce/wordpress Updated: 2026-11-27 ### Step by step The what3words Address Field plugin helps you capture what3words addresses at checkout, using an address validation field. It includes support for WooCommerce checkouts as well as customised WordPress pages. Getting started with Andy, what3words Product Manager, showing how to add a what3words address field plugin to WordPress|WooCommerce in [this video](https://www.youtube.com/watch?v=tX-pF9G57yw) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ![Search to add plugin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/da900a0b97c0f3f3e3fe9d0ee5e6ef70d3eef3b35a0e0df9b967f19f615d921d.png) *Add what3words plugin* You can install the what3words Address Field plugin through the WordPress plugins page in your WordPress admin panel. 1. Navigate to the *Plugins > Add New* page 2. Search for “what3words” 3. Click the *Install Now* button. 4. Once installed, you can activate the plugin on the *Plugins* page. You can also find a link directly to the plugin on wordpress.org here: [https://wordpress.org/plugins/3-word-address-validation-field/](https://wordpress.org/plugins/3-word-address-validation-field/) ## 3. Add your API Key ![what3words wordpress plugin admin screen](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c9965d9c698b6430e50af0415494d5b1c10afc1c470b54ffef54526468afdeab.jpg) You will need a what3words API key to use this plugin, as it authenticates and interacts with the [what3words API](https://developer.what3words.com/public-api). If you don’t have a what3words API key yet, you can quickly and easily [sign up and register](https://accounts.what3words.com/create-api-key) for one. Once you have a what3words API key: 1. Click the *what3words* menu item on your wp-admin page. 2. Enter your API Key into the API key field. 3. Click *Save   svsv cn b * ## 4. Default Woocommerce settings ![wordpress plugin default settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7dd44d6d9554ddb6898eb6a0ac24fb92e4c8a5a52a3a0ad8db8333c491006e1f.png) The general settings allow you to customise how the what3words Address Field is configured on your site. For WooCommerce users the plugin can automatically add an address field for both billing and shipping information, allowing your customer to specify a three word address for both billing and/or shipping address to help you locate your customers with ease. By default this option is selected and if you have configured your WooCommerce plugin it will automatically add these fields for you on your checkout page. Or you can select the *Add what3words Address Field to my checkout page for me* option. ## 5. Check if the field is appearing ![what3words wordpress plugin on a checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ae12b1028bef5ae4edb67773a9673c2fa29d7ad315c868018551d44029f2cac4.jpg) A new field should now be appearing on your checkout under Billing and Shipping. When a what3words address is captured in this field it will be saved alongside your order details and will be visible in order preview and shipping label screens. ## 6. Troubleshooting If you find your what3words address field displayed at the top of your checkout page, and you would like to keep it at the bottom of your address form please follow this step-by-step guide: 1. Log in to your WordPress dashboard. 2. Go to Appearance > Customize. 3. Click on Additional CSS. This will open the Customizer’s CSS editor. 4. Paste the following CSS code into the editor: `#w3w-billing_field { order: 20; }` 5. Click on the Publish button to save your changes. If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional Settings ### Using custom fields Instead of letting the plugin create a field,  you can customise which field(s) to convert to a what3words Address Field by selecting *Convert an existing field to a what3words Address Field* option and providing selectors for the inputs to convert. You can use any DOM compliant query selector(s) here to specify a single or multiple fields that you wish to convert. **N.B. When using input selectors you should ensure each input field has a unique name attribute to ensure clashes do not occur if multiple what3words Address Fields appear on a single page.** If you want to add a new custom field to extend as a what3words Address Field you should first create an input field on the page you wish to add this functionality to and provide with a name, id and/or that can then use in the input selector to specify it. (Be careful when using classes as it can apply this behaviour to multiple fields.) If you want to capture the selected what3words address you should wrap this field in a form with a submit button and this will then be submitted as specified by your form. ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox with will also retrieve the coordinates for the captured three word address. If you have added the what3words Address Field to your WooCommerce checkout and you select *Save coordinates* the coordinates for the billing and shipping address fields will added to your order and visible in your Orders page on WooCommerce. If you are using custom field(s) for the address then you the component will automatically attach hidden fields for both the latitude and longitude of the coordinates for the adddress prefixed with the name you supplied to the input field. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Adding a label For improved accessibility it is recommended that you add a label to your what3words Address Field. By checking this option and supplying some text for the label you can easily associate a label to each of your address field(s). For WooCommerce customers this option allows you to override the default label associated to the address field(s), while for custom field users this option tells the plugin to create a label field for you. ### Custom placeholder You can override the default placeholder for the address field(s) by selecting this option and specifying the placeholder text. We recommed you use the default placeholder value as it provides your customers with an example of how to use the what3words Address Field. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each is what forms the suggestions provided when using the what3words Address Field.** For WooCommerce checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. --- # Excel Add-in Start adding what3words formulas to your spreadsheet today with our Excel Add-in. Source: https://developer.what3words.com/tools/excel-addin Updated: 2026-11-27 - [Using the what3words for Excel add-in](https://developer.what3words.com/tutorial/using-the-what3words-for-excel-add-on): With the what3words for Excel add-in, it's easy to convert coordinates into 3 word addresses and vice versa, translate 3 word addresses, and return AutoSuggest results for incomplete 3 word addresses – all from an Excel spreadsheet. --- # GIS extensions Communicate exact locations easily in just three words by adding what3words to your GIS software. It’s easy to set up without writing any code. Source: https://developer.what3words.com/tools/gis-extension Updated: 2026-11-27 [Watch the what3words GIS extensions video](https://vimeo.com/1125865557/e66bdd5a5d) - [ArcGIS](https://developer.what3words.com/tools/gis-extensions/arcgis) - [QGIS](https://developer.what3words.com/tools/gis-extensions/qgis) - [Geocortex](https://developer.what3words.com/tools/gis-extensions/geocortex) - [Cadcorp](https://developer.what3words.com/tools/gis-extensions/cadcorp) ## GIS extension FAQs ### Do you have instructions for how to set up the what3words ArcGIS Locator in ArcGIS Desktop and Online? Adding the what3words ArcGIS Locator to ArcGIS Online is straightforward. Read the following tutorial for step-by-step instructions: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Can I make the what3words ArcGIS Locator available to the whole of my organisation in ArcGIS Online? You can add the locator as Content in ArcGIS Online and then make it available to your whole organisation as a Utility Service from within the Organization settings. Read the following tutorial for a step-by-step guide: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Does the what3words ArcGIS Locator work with the ArcGIS apps? The what3words ArcGIS Locator works within apps that connect to ArcGIS Online and accept a custom locator. The locator works with Survey123 and can be used to search and discover 3 word addresses, and add them as a survey question. Read a step-by-step tutorial here: [Survey123](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online-and-survey123). ### I can't find a plugin for my GIS platform. Can I still add the what3words API to my GIS? There are other third-party plugins available for many GIS tools, for example, FME and Cadcorp: [what3words map tools](https://what3words.com/products/?category=Map%20tools). Our Python wrapper makes it straightforward to build a new plugin or build a bespoke workflow. Get started by reading our tutorial for the Python wrapper: [Python](https://developer.what3words.com/tutorial/python). ### Can I download a GIS file of 3 word addresses and grid? Yes. The what3words API has a GeoJSON response parameter (find out more in the [grid section of the API reference](https://developer.what3words.com/public-api/docs#grid-section)). This function returns the grid lines for the area, or the 3 word address supplied in GeoJSON format, which can then be directly added to a web map or desktop GIS such as QGIS. The steps to add to QGIS for a small area are as follows: 1. Put the grid section URL into your internet browser specifying the bounding box and GeoJSON response type 2. Copy the GeoJSON response to a shapefile 3. Load the shapefile into QGIS ### Does the what3words ArcGIS Locator work offline? The public what3words ArcGIS Locator is available for online applications only. In order to set up an offline version of the Locator you can set up a local version of the Locator alongside our API Server or C++ SDK. Find out more in the [Enterprise Suite](https://developer.what3words.com/enterprise-suite) section. ### Does ArcGIS support China? Yes. Our ArcGIS locator provides the same response as our API does for a record in China. You will need to make sure you display the 3 word address in the correct coordinate system that matches your other datasets. If you display the 3 word address on a map, make sure the map is a licensed Chinese map using the correct coordinate system. The standard ArcGIS Online map will work for this purpose. [View all FAQs](https://developer.what3words.com/support) --- # Using the what3words ArcGIS Locator across the ArcGIS platform Adding and using the what3words Locator across the ArcGIS Platform. Topics: ArcGIS, GIS Source: https://developer.what3words.com/tools/gis-extensions/arcgis Updated: 2026-11-27 ### Step by step The what3words ArcGIS Locator brings the functionality of the what3words API to the ArcGIS platform. You can use the Locator throughout the ArcGIS product suite wherever a custom locator can be added. This includes ArcGIS Desktop – ArcCatalog and ArcMap as well as ArcGIS Pro. On web, you can use the Locator within ArcGIS Online and any products able to connect to Online such as in app using Survey123. Or for GIS developers the ArcGIS APIs and SDKs in the Developer suite can harness the ArcGIS Locator as a REST API. The Locator gives you the ability to convert to and from coordinates, or more commonly known within ArcGIS as forward/reverse address geocoding. Functionality varies by ArcGIS product so take a look at our tutorials to see how the locator works within ArcGIS. ## 1. Sign up for Locator access You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Upgrading Locator version The current version of the what3words Locator is v2.0. For users of what3words Locator v1.0 you will need to upgrade to V2.0 to continue to use the service. In order to upgrade the Locator you will need to change the following: **URL:** Change the URL prefix from [https://arcgis.what3words.com/w3w/rest/services/](https://arcgis.what3words.com/w3w/rest/services/) to [https://arcgis.what3words.com/v2/arcgis/rest/services/](https://arcgis.what3words.com/v2/arcgis/rest/services/) **Username:** This should now be your email address **Password:** This should now be your API key ## 3. Adding to ArcGIS Desktop The Locator can be added as an ArcGIS web service via ArcCatalog. View this **[TUTORIAL](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-desktop/)** for the steps to add to ArcCatalog. Once added, the Locator can be used within the rest of the ArcGIS desktop suite to: - [Search for 3 word addresses](https://developer.what3words.com/tutorial/discover-and-search-for-3-word-addresses-in-arcmap/) - [Discover the 3 word address for a location](https://developer.what3words.com/tutorial/discover-and-search-for-3-word-addresses-in-arcmap/) - Batch geocode locations within ArcGIS Toolbox. Requires ArcGIS 10.6 or newer. ## 4. Adding to ArcGIS Online Once the Locator is added as Content within ArcGIS Online it will be available across ArcGIS Online and any product that connects to ArcGIS Online such as ArcGIS Pro and Survey123. View this **[TUTORIAL](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online/)** for the steps to add to ArcGIS Online. Once added the Locator can be used to: - [Search for 3 word addresses](https://developer.what3words.com/tutorial/search-for-3-word-addresses-in-arcgis-online/) - [Plot a CSV file of addresses](https://developer.what3words.com/tutorial/how-to-plot-a-file-of-3-word-addresses-in-arcgis-online/) - [Use within ArcGIS Pro for reverse and forward geocoding](https://developer.what3words.com/tutorial/using-the-what3words-arcgis-locator-in-arcgis-pro) ## 5. Adding to ArcGIS Pro First, add the what3words Locator to your ArcGIS Online account. Once added the Locator will be available In ArcGIS Pro to: - Search for 3 word addresses using the Locate feature - Discover a 3 word address by right-clicking on the map and selecting “What’s here?” - Batch convert between 3 word address and coordinates and coordinates and 3 word addresses using the Toolbox. ## 6. Adding to Portal for ArcGIS Enterprise The process for adding the Locator to Portal for ArcGIS Enterprise is very similar to ArcGIS Online. Once the Locator is added as Content within Portal for ArcGIS it will be available across Portal and any product that connects to Portal such as ArcGIS Pro and Survey123. View this **[TUTORIAL](https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-portal-for-arcgis-enterprise)** for the steps to add to Portal for ArcGIS Enterprise. Once added the Locator can be used to: - [Search for 3 word addresses](https://developer.what3words.com/tutorial/search-for-3-word-addresses-in-arcgis-online/) - [Plot a CSV file of addresses](https://developer.what3words.com/tutorial/how-to-plot-a-file-of-3-word-addresses-in-arcgis-online/) - [Use within ArcGIS Pro for reverse and forward geocoding](https://developer.what3words.com/tutorial/using-the-what3words-arcgis-locator-in-arcgis-pro) ## 7. Adding to Survey123 Survey123 enables the creation of a survey for use in apps out in the field. Adding the Locator to Survey123 allows for 3 word addresses to be collected or viewed when out in the field. First, add the what3words Locator to your ArcGIS Online account. Then you will be able to [**add to your survey**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online-and-survey123/) using the GeoPoint feature. ## 8. Adding to Field Maps Field Maps helps mobile workers perform data collection and editing, find assets and information, and report their real-time locations. Adding the Locator to Field Maps allows for 3 word addresses to be viewed and collected when out in the field. First, add the what3words Locator to your ArcGIS Online account. Then you will be able to **[use it on your survey](https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-arcgis-online-and-field-maps/)** using the Field Maps app. ## 9. Adding to ArcGIS JavaScript API The what3words ArcGIS Locator can be accessed as a REST API from the ArcGIS API for JavaScript. A collection of resources for developers using the ArcGIS API for JavaScript to integrate the what3words ArcGIS Locator can be found **[HERE](https://developer.what3words.com/tutorial/using-the-what3words-arcgis-locator-within-arcgis-api-for-javascript)**. For more information on how to call a `Locator` in ArcGIS see [this ArcGIS developer guide](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). ## 10. Adding to Web App Builder The what3words ArcGIS Locator can be used within our widget built using Web AppBuilder for ArcGIS. This widget will help you to perform reverse geocoding (convert a point to a what3words address) on your ArcGIS Online or Portal for ArcGIS. First, make sure you have added correctly the what3words Locator to your ArcGIS Online or Portal for ArcGIS. Then you will be able to use it within your web application by following this **[TUTORIAL](https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-web-appbuilder-for-arcgis/).** ## 11. Adding to Experience Builder The what3words ArcGIS Locator can be used within our widget built using ArcGIS Experience Builder. This widget will help you to perform reverse geocoding (convert a point to a what3words address) on your ArcGIS Online or Portal for ArcGIS. First, make sure you have added correctly the what3words Locator to your ArcGIS Online or Portal for ArcGIS. Then you will be able to use it within your web application by following this **[TUTORIAL](https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-experience-builder-for-arcgis)**. ## 12. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## ArcGIS FAQs ### Do you have instructions for how to set up the what3words ArcGIS Locator in ArcGIS Desktop and Online? Adding the what3words ArcGIS Locator to ArcGIS Online is straightforward. Read the following tutorial for step-by-step instructions: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Can I make the what3words ArcGIS Locator available to the whole of my organisation in ArcGIS Online? You can add the locator as Content in ArcGIS Online and then make it available to your whole organisation as a Utility Service from within the Organization settings. Read the following tutorial for a step-by-step guide: [ArcGIS Online set up](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online). ### Does the what3words ArcGIS Locator work with the ArcGIS apps? The what3words ArcGIS Locator works within apps that connect to ArcGIS Online and accept a custom locator. The locator works with Survey123 and can be used to search and discover 3 word addresses, and add them as a survey question. Read a step-by-step tutorial here: [Survey123](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online-and-survey123). ### Does the what3words ArcGIS Locator work offline? The public what3words ArcGIS Locator is available for online applications only. In order to set up an offline version of the Locator you can set up a local version of the Locator alongside our API Server or C++ SDK. Find out more in the [Enterprise Suite](https://developer.what3words.com/enterprise-suite) section. ### Does ArcGIS support China? Yes. Our ArcGIS locator provides the same response as our API does for a record in China. You will need to make sure you display the 3 word address in the correct coordinate system that matches your other datasets. If you display the 3 word address on a map, make sure the map is a licensed Chinese map using the correct coordinate system. The standard ArcGIS Online map will work for this purpose. --- # Adding what3words to Cadcorp SIS Desktop and Cadcorp SIS WebMap what3words can be integrated with Cadcorp SIS Desktop and Cadcorp SIS WebMap. Topics: Cadcorp, GIS Source: https://developer.what3words.com/tools/gis-extensions/cadcorp Updated: 2025-05-22 what3words can be integrated with Cadcorp SIS Desktop and Cadcorp SIS WebMap. ## Adding what3words to Cadcorp SIS Desktop SIS Desktop search options support what3words, so users can search a what3words address or click on the map to learn the what3words address for that location. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Search what3words addresses 1\. In SIS Desktop, you can enable what3words searching by first including it in the `Ribbon.json` file (`C:\Program Files\Cadcorp SIS Desktop 9.1\Options\Desktop`) by adding `“what3words”: true` parameter within a text editor. ![Desktop-Ribbon-json](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e9bd05c9a6864e394f3507f7efb8159db6241e44b8b8b68888a02a6b9e7f02d8.w1600.webp) 2\. Open SIS Desktop and start typing in the Search field to see the included list; ![Desktop-Search-dialog-w3w](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4391297510534d5af61e53af0280648dd7089b6fe7bd57c56f41e778cc13156e.w1600.webp) 3\. Click `Configure` to enter the API key, and all searches will now include results from what3words; 4\. **Search**: Type the full what3words address, such as `filled.count.soap`, select from the dropdown confirmation, and the map zooms to the 3m square; ![Desktop-w3w-Search-1173x630](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4940ce9b8e1bef25f2a8e4d962e3e166c1a91b41c74603a2aa0f4c55fc1aacb6.w1600.webp) 5\. **Click-to-identify**: `View ▸ Status Bar ▸ what3words` to see live what3words cursor tracking. ![Desktop-Status-Bar-w3w-1173x634](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8ea8ca910d59a37f3df2aca7fa07635325e4c03956e1e6870fb1aa4ccd65f664.w1600.webp) ### Advanced Analyst Tools & Bulk Operations 1\. **Bulk geocode**: Use the Geocode Process Operation on a table with a w3w column to create a layer of points created by geocoding the w3w addresses; 2\. **View geometry**: Use Add `Overlay → View Geometry` and select any table containing what3words addresses. This allows users to take, for example, a spreadsheet or database table containing what3words addresses and display the locations in SIS Desktop as a map overlay. Make sure you select what3words as the BLOB configuration format. ![Desktop-w3w-Geocode-1173x496](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/925b91fc949bc1c30cbeddbf99ee30e681af0ba963cc8aaab7f44c6eb9e8a368.w1600.webp) ## Adding what3words to Cadcorp SIS WebMap what3words can be integrated with [Cadcorp SIS WebMap](https://www.cadcorp.com/products/web-mapping/cadcorp-sis-webmap/) and accessed via a button on the map’s interface. The user can either click on the map to return the what3words address for that location, or input three words to zoom to the location. When the user types in the first two words and any letter from the third, they’re offered suggestions for the final word. ## 3. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 4. Contact Cadcorp Send the API key to [sales@cadcorp.com.](mailto:sales@cadcorp.com) Your Cadcorp account manager will then contact you to send you terms of use and to arrange for the resource to be added. ## 5. Search what3words addresses 1\. In SIS WebMap Manager, select the what3words configuration section and add an API key. Then, restart SIS WebMap; 2. In SIS WebMap, clicking on the map returns the what3words address for that location. The address can be copied as text; ![WebMap-w3w-click-1173x800](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8c93549f5ac1c1d53be34d525db843e5364251b234b525355a3f6154d756102f.w1600.webp) 3\. Typing in the what3words address zooms to the location and places a pin on the map. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7a5cea820a48373eac22bc4e79c76f168da44c8cb0da0ebe1a7864301015aa1d.w1600.webp) ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Configuring Geocortex Essentials to use what3words Adding the what3words service to Geocortex Essentials. Topics: Geocortex, GIS Source: https://developer.what3words.com/tools/gis-extensions/geocortex Updated: 2024-12-02 what3words can be integrated as a geocoding service within [Geocortex Essentials](https://www.geocortex.com/products/geocortex-essentials/). Adding the what3words ArcGIS Locator functions just as any other geocode service within the Geocortex Essentials application allowing you to discover what3words addresses or search for a what3words address. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Open Geocortex Essentials Manager ![Essentials Manager Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/589b1eba0e49c2478aefcd57dc9c4a366b6f18bfd8b2091dd54174651ffa97ca.png) Open your Site in Geocortex Essentials Manager and navigate to the Geocoding tab of GIS Services ## 3. Add a Geocoding Service ![Service Type Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/245e1da8ce60699658c2e27bdd1950cb40de975cb4a7eea1cb84e06230a1938c.png) Select the ArcGIS Geocoding Service type ![Service Name Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c49715e52974f0a811cafb2fc6be9d823538f90ab2ed698714bffb3ee3ce24d6.png) Enter an appropriate display name for the service ![Token security screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5cfd67c500e433fb1b41d7d533ccf75f5b05492a11deb2e9e256766e93019bdd.png) Enter an appropriate display name for the service Populate the service URL, Username, and Password field. **URL:** `https://arcgis.what3words.com/v2/arcgis/rest/services` **Username:** Email address you used to create a what3words API key **Password:** your what3words API key. ![Geocoding Service selection screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/970b90d2a8920133e7d74b26c6bb30893fef10b32851aa0c6275078c4505aa8a.png) Select the service name from the list with the language required. ![default service screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e9ba5b72563ea455ec1f59b63bac0d32ae9b585717c87d52e0ce563bd940432a.png) You can now configure your new what3words geocode service to be the default geocode service. ![global search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/fb7bdfe61e703df988c59cce4fe0a0ada5bcc6f777ded3dd39ebb77aae5950a2.png) Click “Include in Global Search:” to use within the Global Search ## 4. Using the service ![What3Words right-click reverse geocode result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/402e9bc773cf8c161e64db0fcbb0c90a8d410d2642ac5d96e5af3f6f0717ab66.jpg) Find out the what3words address for a location through the right-click context window. ![Geocortex geocode search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b22c9e8581c2c67ce22719a63de67f35a6dbb74c05c3704e2a9c8e481bb18c80.jpg) Find a what3words address through the search ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). If you have an issue with displaying the what3words geocoding system on GeoCortex Essentials, it could be that the token of the what3words ArcGIS geocoding service has expired since, by default, GeoCortex Essentials assumes the token duration of all your ArcGIS services is 60 minutes, which is the ArcGIS default. However, if the token duration of any of your ArcGIS services is shorter, you must specify the token duration in Essentials. Here is a [tutorial](https://docs.vertigisstudio.com/essentials/latest/admin-help/Default.htm#ge/admin/geocoding-services.htm) in GeoCortex Essential that explains how to specify the token duration. You can also follow these steps to update the token duration of your what3words ArcGIS geocoding service: 1. Open the Essentials `web.config file` 2. In the `appSettings` element, add a new add element. 3. Add a key attribute to `appSettings` and set it to `ArcGisRestMapServiceBase.MaximumTokenDuration`. 4. Add a value attribute to `appSettings` and set it to the maximum token duration in minutes. For example, to set the maximum token duration to 5 minutes: `` **Note:** It was tested that reducing the `MaximumTokenDuration` to 5 minutes can help to retrieve the token faster and avoids any interruptions in your current workflow. --- # Adding the Planet Federal what3words plugin to QGIS Adding and configuring the what3words plugin to QGIS Topics: QGIS, GIS Source: https://developer.what3words.com/tools/gis-extensions/qgis Updated: 2026-11-25 ### Step by step The QGIS plugin brings the functionality of the what3words API to the QGIS platform. You can use the plugin to convert from coordinates to 3 word addresses by adding a field to a Shapefile, as well as searching for 3 word addresses or inspecting the map to view the 3 word address for a location. **QGIS Minimum Supported Requirements:** 3.0.0 QGIS Versions 1-3, Copyright (C) 2016-2020 build by Planet Federal QGIS Version 4, Copyright (C) 2020-2022, updated by what3words Limited Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Desktop in [this video](https://youtu.be/Q-5JYh3RpK4) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Download the plugin You can now download the `What3words Tools` directly from the [QGIS Python Plugins Repository](https://plugins.qgis.org/plugins/). Open QGIS and click on **Plugins > Manage and Install Plugins >** type on the search bar for the `what3words` plugin and click on **Install Plugin** button. ## 3. Adding the plugin to QGIS ![QGIS plugin Settings link](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/221cff5a5dab2d4c00a46cce8df3f864b07581b6e7b01e894cc86c2ca30a3846.png) Once enabled, you will see what3words under the **Plugins** tab, choose the **Settings** menu and then **paste the API Key** you have copied from your [what3words account](https://accounts.what3words.com/). ## 4. Using the plugin Here are all the available tools in the what3words QGIS plugin: **Grid & Map Tools:** **1\. Click on the map** to capture and display the what3words address for that location. **2\. Toggle the what3words grid overlay** to visualise the 3m x 3m square system (click again to disable). **3\. Open the what3words map site** directly from the plugin for external address lookup. **Table Management Tools:** **4\. Import** what3words addresses or coordinates from CSV. **5\. Export** the address table to a CSV for external use. **6. Create a temporary feature layer** from stored what3words addresses. **7\. Delete** **the selected what3words address** from the address table. **8.** **Delete all the what3words addresses** from the address table. **Settings:** **9.** Access plugin settings from the toolbar: - Enter your API key; - Set your preferred language for addresses; - Configure a custom or enterprise API endpoint (if needed). **Marker Management:** **10.** **Toggle visibility** of map markers associated with what3words addresses. **11.** **Clear all map markers** from the basemap as required. **Address Table:** **12\.** When clicking on the map, addresses appear in the table below. You can: - Copy cell content - Zoom to feature - Flash or highlight the feature - Select a feature by clicking on its record **AutoSuggest Search:** **13\.** Start typing a what3words address in the **AutoSuggest input field** to receive up to 3 matching suggestions instantly. ![QGIS plugin - Key features](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f5680d78d1a045e4994513649c94e0ff4d157af15fd8f132389c96c2b2b8ef7d.w1600.webp) ![QGIS plugin - field calculator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/71299535d24dd6851f4df59c3e51ab1d7e459a67007edbcf7ec74a5ea93b1c11.png) ### ⚖️ Field Calculator Integration The what3words plugin lets you perform the field calculations directly within the attribute table of any vector layer Within attribute tables, you can: - **Convert** between coordinates and what3words; - **Change** the language of existing what3words addresses; - Use **AutoSuggest** when editing fields to help complete valid what3words addresses. To get started: - Open the attribute table of any vector layer; - Click the `Field Calculator` (🧮) icon in the toolbar. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/db3bef13add143c4688152e6dfce88278c1ffea52b849e96562a1828d49eb16a.png) ### ⚙️ Processing Toolbox Integration Use the what3words tools directly in your geoprocessing workflows via the QGIS Processing Toolbox: - **Generate a what3words grid** for any selected area - **Convert the language** of what3words address attributes in vector features - **Add a what3words address field** to a layer using coordinate geometry - **Geocode a CSV file** containing what3words addresses into point layers for spatial analysis To get started, open the **Processing Toolbox** in QGIS by navigating to `Processing` > `Toolbox` from the top menu. Then, expand the **what3words** section to access the available tools. ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). Use the `QGIS What3words Tools` to convert coordinates in any coordinate system to what3words. If you have data in a different coordinate system than WGS84, our `What3words Tools` handles the transformation of the original coordinate system to WGS84, as it is expected by what3words. ![1-csv-file-with-bng-coords](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0511f50805d300ba3e70a1eb74ba6b9cef101fa3b4c23f4cfd35cf674afc76c2.png) In this example, we will show how a CSV file with coordinates (Easting and Northing) in EPSG:27700 – OSGB 1936 / British National Grid can be imported into QGIS and how our `What3words Tools` can handle the transformation from this coordinate system to WGS84 while adding the what3words address to this file. **Note**: make sure the Easting and Northing are integer numbers. ![2-import-csv-to-qgis](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2af75cc1fad5996e214e7b99f33a6c5582ca0971d40ce6f8c10db24779501751.png) To import this CSV to QGIS we need to go to `Layer > Add Layer > Add Delimited Text Layer`. ![3-assign-csv-to-crs](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b3dac7aef83631e9a6c2afe0be864b53001703d14303e50dad321a96265c264b.png) 1. Then Import the **File name** from the original source by clicking on the 3 dots button. 2. Choose the **Geometry Definition**, Point coordinates and assign your x field to your easting and the y field to your northing (since our example it is using the British National Grid, otherwise you should choose the longitude and latitude instead); 3. Then assign the **Geometry CRS** to your CSV file, in our case the EPSG: 27700, it might ask you to choose some transformation, please use the most appropriate for your project. 4. Then you are ready to click the **Add** button to import this file onto your QGIS project. You will see point features being plotted on the map. ![4-batch-geocode-add-w3w-to-layer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b037fbf726b272edf10ec93e20dcdadd67c6ab02369bb73d160c55b438994bd3.png) Now we want to add what3words addresses to these point features. After enabling the what3words tools plugin on your QGIS project, open the Processing Toolbox, the what3words tools plugin would be visible at the bottom. Click on the tool **Add what3words address field to layer**. Choose your input layer, and output otherwise QGIS will save it as a temporary file, then click the button **Run**. ![5-add-w3w-to-layer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a31a498580fc0ba5faf5bee88c3e66a8b98e07c02c249a78b84f3bd4f9e3cad7.png) After the tool run successfully, if you open the attribute table of your point feature you will see a new column called **w3w** at the end of this table. --- # Add what3words to Salesforce Adding the what3words API to Salesforce Topics: Salesforce, Website Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [Others](https://developer.what3words.com/docs/search-box/others.md) Source: https://developer.what3words.com/tutorial/add-what3words-to-salesforce Updated: 2026-11-27 ### Step by step This tutorial outlines how to add the what3words API to Salesforce and provides the starting point for using what3words throughout the Salesforce platform. It demonstrates how to build a simple flow that listens for changes to a what3words address field, calls the what3words API to obtain the coordinates, and then adds them to a Salesforce Geolocation field. It requires minimal development work to copy and paste Apex Classes and requires only a few changes to be made within Salesforce Setup. This allows you to start using what3words addresses reported by users within Salesforce, such as within Service Cloud and allows your users to share precise locations with colleagues. More complex flows can then be created to use what3words addresses throughout the Salesforce platform. In this tutorial, the example provided is for Service Cloud but the what3words address field and geolocation field can be added to any Salesforce Object. Amending the example flow and trigger to point to these objects allows for what3words addresses and coordinates to be added anywhere in Salesforce. ### Prerequisites - You will need a Salesforce account. Sign up [here](https://www.salesforce.com/uk/form/signup/freetrial-sales-pe/) to get started or set up a sandbox environment. - You will need a user account with permissions to be able to modify your Salesforce settings in Setup. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add new fields to Objects Two new fields need to be created for each object that you would like to use what3words addresses with. 1. ‘what3words’ field with type Text and length 200. This is used to store the what3words address. 2. ‘Location’ field with type Geolocation (decimal), This is used to store the coordinates for the what3words address in decimal degree format. In this example, we add the fields to the Case and Contact objects for use in Service Cloud. ![Case search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cc3c471033dd858fe25a39b8664f2936a812b1b7466dd150eecf975ed46e94a8.png) Click on the Object Manager tab and search for “case”. ![Add new fields](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8b438434aac05f9a720ce66a4814a641b8a6397e60b945c84597a1f73d67c226.png) Select “Fields & relationships” and add the 2 new fields Repeat for the Contact object. ## 3. Create Apex Classes Next, we need to create two new Apex Classes. The classes do the following: 1. Call the what3words API convert to coordinates function passing through the what3words address 2. Take the response from the API and extract the coordinates ![search for Apex class](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ad302d9a1015f975af8bdf69a1ba211679d399727bd1deecfd82d7e603f79de2.png) Select the Home tab in Setup and search for class and select “Apex Class” ![Create Invocable callout class](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f9e98d26fd1d43db7e095bb36b58af55dbf5d3d5e9a12cb87fbdf9ad9071741c.png) Create a new class `W3WInvocableCallout` and paste in the following code. **You will need to replace `API-KEY` with your what3words API key from Step 1 above.** **Apex** ```apex public with sharing class W3WInvocableCallout { @InvocableMethod(label='Get W3W Coordinates' description='Returns the Latitude and Longitude of the W3W provided' category='Case') public static List getW3WCoordinates(List cases) { for (Case theCase : cases) { updateCase(JSON.serialize(theCase)); } return null; } @future(callout=true) public static void updateCase(String theCaseStr ) { Case theCase = (Case)JSON.deserialize(theCaseStr, Case.class); Http http = new Http(); HttpRequest request = new HttpRequest(); String theURL = 'https://api.what3words.com/v3/convert-to-coordinates?words='+theCase.what3words__c+'&key=API-KEY'; request.setEndpoint(theURL); request.setMethod('GET'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. if (response.getStatusCode() == 200) { // Deserialize the JSON string into collections of primitive data types. What3Words theResult = What3Words.parse(response.getBody()); theCase.Location__latitude__s = theResult.coordinates.lat; theCase.Location__longitude__s = theResult.coordinates.lng; update theCase; } } } ``` ![Create what3words class](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/89e4d8615310c7bc93ffb01f11cec0cb8d89ac488cfd5a8a4bf3b70592d29707.png) Create a second class `what3words` and paste in the following code. **Apex** ```apex public class What3Words { public String country {get;set;} public Square square {get;set;} public String nearestPlace {get;set;} public Southwest coordinates {get;set;} public String words {get;set;} public String language {get;set;} public String mapUrl {get;set;} // in json: map public What3Words(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'country') { country = parser.getText(); } else if (text == 'square') { square = new Square(parser); } else if (text == 'nearestPlace') { nearestPlace = parser.getText(); } else if (text == 'coordinates') { coordinates = new Southwest(parser); } else if (text == 'words') { words = parser.getText(); } else if (text == 'language') { language = parser.getText(); } else if (text == 'map') { mapUrl = parser.getText(); } else { System.debug(LoggingLevel.WARN, 'What3Words consuming unrecognized property: '+text); consumeObject(parser); } } } } } public class Square { public Southwest southwest {get;set;} public Southwest northeast {get;set;} public Square(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'southwest') { southwest = new Southwest(parser); } else if (text == 'northeast') { northeast = new Southwest(parser); } else { System.debug(LoggingLevel.WARN, 'Square consuming unrecognized property: '+text); consumeObject(parser); } } } } } } public class Southwest { public Double lng {get;set;} public Double lat {get;set;} public Southwest(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'lng') { lng = parser.getDoubleValue(); } else if (text == 'lat') { lat = parser.getDoubleValue(); } else { System.debug(LoggingLevel.WARN, 'Southwest consuming unrecognized property: '+text); consumeObject(parser); } } } } } } public static void consumeObject(System.JSONParser parser) { Integer depth = 0; do { System.JSONToken curr = parser.getCurrentToken(); if (curr == System.JSONToken.START_OBJECT || curr == System.JSONToken.START_ARRAY) { depth++; } else if (curr == System.JSONToken.END_OBJECT || curr == System.JSONToken.END_ARRAY) { depth--; } } while (depth > 0 && parser.nextToken() != null); } public static What3Words parse(String json) { System.JSONParser parser = System.JSON.createParser(json); return new What3Words(parser); } } ``` ## 4. Create a flow to obtain coordinates We are now going to create a simple flow that: 1. Listens for a change to the what3words field on the Case object (e.g. a user pastes an address into it) 2. Uses an action and the Apex Classes to call the what3words API 3. Puts the resulting coordinates into the Location field ![New flow](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/11b2407ddc81c6fe60fa00f3ebb66ac694a295764241c2b965fd50f080bbcb4b.png) Search for flows on the Home tab. Click “New” flow and select ”Record triggering flow” Select the Object to be “Case” and set to trigger the flow when “A record is created or updated”. Then set the Conditions Requirement to be “Any condition is met (OR)” with the following settings: - Field: “what3words\_\_c” - Operator: “Is Changed” - Value: “True” Click “Done” ![Salesforce add flow](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ba3c47b9afc9f383c4759d88cdca28d5319c71d3120b51051ab185bf390c69a0.png) Next click the + icon on the flow diagram to add an action. ![New action](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ab98804691ea9e2cbc01be2ae4a3eb0c09122372f9309fc25a36354b10f7b22c.png) Select Action and search for “Get W3W Coordinates” to select the Apex Class added in Step 3. ![Action details](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5894cb8a44e7d399697825d204d5e3f3b824e6a06591c0e7e6f7a5e97611eac8.png) Enter a name of “Get coords” and toggle on “Include”. Then in the Cases field – select “Record” and remove the full stop so it appears as `{!$Record}`. ## 5. Add security exception ![Remote site settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bb54d43be0af416e3f806f9032f5edc5e58944684756289aad7df5b466ee970c.png) The what3words API is an external API and therefore in order for Salesforce to call the API a security exemption needs to be added to the Security settings. Search for “Remote site settings” in the Security category and add a new remote setting for the what3words API URL `https://api.what3words.com/v3`. ## 6. Test the changes We will now check that the new setup is all working correctly by creating a new case in Service Cloud. ![Select Service Cloud](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7e2c518c630823c9fa9a022bbeeb9a98b2b5478544ec70c21408d74cbacbe4b9.png) Select Service Cloud from the menu ![New case](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a8ec1eaaac9c009eb51d8a9f0669b300d0a8064eb282ee83a493c3c064c69dd2.png) Then select Cases dropdown and click “New’ ![Populate Case](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e74cb1d6a6bc75ce0aa50897b52e0b53b4dd10d1d424192bd7e8abca2cee0a07.png) Populate the case details and ensure you add a what3words address to the what3words field and click done. ![Object manager case](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a24e0f0c35dc38d683101f129da2a16759762a4e017a0087d2b3bb3f10f68039.png) Click on the case and the coordinates should now appear in the Location field. ## 7. Convert to what3words address Alternatively, it is possible to create a similar flow that takes the coordinates entered into the Location geolocation field and converts them to a what3words address stored within the what3words field. The process is similar to the steps above but after creating the fields in step 2, the following Apex classes `C23waInvocableCallout` and `what3words` will need to be created. You will need to replace API-KEY with your what3words API key from Step 1: **Apex** ```apex public with sharing class C23waInvocableCallout { @InvocableMethod(label='Get W3W Address' description='Returns the 3 word address for coordinates' category='Case') public static List getW3WAddress(List cases) { for (Case theCase : cases) { updateCase(JSON.serialize(theCase)); } return null; } @future(callout=true) public static void updateCase(String theCaseStr ) { Case theCase = (Case)JSON.deserialize(theCaseStr, Case.class); String lat = String.valueOf(theCase.Location__latitude__s); String lng = String.valueOf(theCase.Location__longitude__s); Http http = new Http(); HttpRequest request = new HttpRequest(); String theURL = 'https://api.what3words.com/v3/convert-to-3wa?coordinates='+lat+','+lng+'&key=API-KEY'; request.setEndpoint(theURL); request.setMethod('GET'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. if (response.getStatusCode() == 200) { // Deserialize the JSON string into collections of primitive data types. What3Words theResult = What3Words.parse(response.getBody()); theCase.what3words__c = theResult.words; update theCase; } } } ``` **Apex** ```apex public class What3Words { public String country {get;set;} public Square square {get;set;} public String nearestPlace {get;set;} public Southwest coordinates {get;set;} public String words {get;set;} public String language {get;set;} public String mapUrl {get;set;} // in json: map public What3Words(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'country') { country = parser.getText(); } else if (text == 'square') { square = new Square(parser); } else if (text == 'nearestPlace') { nearestPlace = parser.getText(); } else if (text == 'coordinates') { coordinates = new Southwest(parser); } else if (text == 'words') { words = parser.getText(); } else if (text == 'language') { language = parser.getText(); } else if (text == 'map') { mapUrl = parser.getText(); } else { System.debug(LoggingLevel.WARN, 'What3Words consuming unrecognized property: '+text); consumeObject(parser); } } } } } public class Square { public Southwest southwest {get;set;} public Southwest northeast {get;set;} public Square(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'southwest') { southwest = new Southwest(parser); } else if (text == 'northeast') { northeast = new Southwest(parser); } else { System.debug(LoggingLevel.WARN, 'Square consuming unrecognized property: '+text); consumeObject(parser); } } } } } } public class Southwest { public Double lng {get;set;} public Double lat {get;set;} public Southwest(JSONParser parser) { while (parser.nextToken() != System.JSONToken.END_OBJECT) { if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { String text = parser.getText(); if (parser.nextToken() != System.JSONToken.VALUE_NULL) { if (text == 'lng') { lng = parser.getDoubleValue(); } else if (text == 'lat') { lat = parser.getDoubleValue(); } else { System.debug(LoggingLevel.WARN, 'Southwest consuming unrecognized property: '+text); consumeObject(parser); } } } } } } public static void consumeObject(System.JSONParser parser) { Integer depth = 0; do { System.JSONToken curr = parser.getCurrentToken(); if (curr == System.JSONToken.START_OBJECT || curr == System.JSONToken.START_ARRAY) { depth++; } else if (curr == System.JSONToken.END_OBJECT || curr == System.JSONToken.END_ARRAY) { depth--; } } while (depth > 0 && parser.nextToken() != null); } public static What3Words parse(String json) { System.JSONParser parser = System.JSON.createParser(json); return new What3Words(parser); } } ``` Then follow steps 4-6 but for step 4 the Conditions Requirement should be set to “Any condition is met (OR)” with the following criteria: - Field: “Location\_\_Latitude\_\_s” - Operator: “Is Changed” - Value: “True” OR - Field: “Location\_\_Longitude\_\_s” - Operator: “Is Changed” - Value: “True” When selecting the action for your flow, search for “Get W3W Address” to use the class above that obtains the what3words address for the coordinates. ## 8. Troubleshooting The best way to determine where an issue is occurring is by running your flow in “Debug” mode. This will step through the flow and show you the outcome and any errors with each step. Additionally, if there is a problem with one of the Apex Classes administrators should receive an automated email from Salesforce with errors. **Coordinates are not populated after editing a case:** Ensure you have added the security exemption in step 5 to allow Salesforce to call the what3words API. **Coordinates are not populated after editing a case:** Ensure you have added your what3words key to the Apex class `W3WInvocableCallout` If you encounter errors or issues related to convert-to-coordinate requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Adding Swiftcomplete to e-commerce checkout The tutorial explains how e-commerce businesses can integrate Swiftcomplete to enhance delivery accuracy and reduce costs by allowing customers to specify precise locations at checkout. Topics: BigCommerce, Ecwid, Shopify, SwiftComplete, Wix, WooCommerce, WordPress, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Plugins](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/plugins.md) Source: https://developer.what3words.com/tutorial/adding-swiftcomplete-address-autocomplete-to-ecommerce-checkout Updated: 2026-11-27 [Swiftcomplete](https://what3words.com/swiftcomplete/) helps your customers add their address quickly and accurately at checkout. It reduces delivery issues, supports what3words, and works with both major platforms and custom checkouts, all for just 3p per validated address. This tutorial explains how e-commerce businesses can integrate Swiftcomplete at checkout to enhance delivery accuracy. [Watch this walkthrough on YouTube](https://www.youtube.com/watch?v=TquHOfzA-0E) ## Why use Swiftcomplete for e-commerce? **⚡ Low-latency autocomplete:** Suggestions appear almost instantly, shortening checkout time. **🏠 Delivery‑ready results:** Multi-residence data **and Not Yet Built data** ensure couriers reach the correct flat or unit. **/// what3words address field:** Let’s shoppers add their 3‑word address so drivers stop at the right entrance. **💸 Flat 3p per lookup:** Transparent cost—no surprises at peak traffic. **🧩 Plugins & SDK:** Choose a 5‑minute plugin install or JavaScript component for headless builds. **📈 Fewer failed deliveries:** Validated addresses cut “return‑to‑sender” costs and boost CSAT. ## How do I start using Swiftcomplete? (2 Steps) ## 1. Get a Swiftcomplete API key Create a Swiftcomplete account (or sign in) if you’re already registered. [GET API KEY](https://www.swiftcomplete.com/account/register) ## 2. Pick the integration method that matches your stack #### A) Pre‑built e‑commerce plugins (manual installation required) Swiftcomplete provides downloadable plugin packages for the following platforms. These are not available via standard app marketplaces and must be manually uploaded and configured: [ ![WooCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/29b7db83d00eeacafa4f33980464aac7788d94fcfa3596fa25c8cdebce50a7e9.w1600.webp) ](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-woocommerce)[ ![Shopify Plus](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/46da8593bcb6e86025186ce45a69be8c2ece83eed05aa67225ecc96d9df42f85.w1600.webp) ](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-shopify)[ ![BigCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/07ca3a79ce901d7dd157a9b2dc27f79fd0a9788ae48de7b82d1f7268e0be91cd.w1600.webp) ](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-bigcommerce)[ ![Ecwid](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1cb19da39cf15b01ad6b5ad7f5bfd490babd6db3c84b277a74d1e5437f334c7f.w1600.webp) ](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-ecwid) #### B) JavaScript Component (for bespoke or headless builds) Use this when you control the HTML of your checkout or need a single‑page app integration. - Drop-in script - Fully customisable fields & events - See [guide](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-javascript-component) ### Retrieval of the what3words address ### How to extract the what3words address from the order data? You will need to extract or isolate the what3words address within the order data to pass it on correctly. - **E-commerce platforms:** For instructions on retrieving what3words addresses from your platform, please get in touch with us at [Technology.partnerships@what3words.com](mailto:Technology.partnerships@what3words.com) for further support. - **Bespoke/Self-built e-commerce sites:** See the following guide, which describes how you can use what3words API wrapper functions such as “**IsPossible3wa**”, “**isValid3wa**”, or the what3words RegEx formulae to detect a what3words address format. Using these tools, you can extract and validate what3words addresses from a bulk of text, so that you can isolate them and pass them forward as required. - [Detecting if the text is in the format of a what3words address using RegEx](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address) ### Delivery to the what3words address ### Does a third party(s) handle your e-commerce deliveries? Assess where your customer-provided address data flows in third-party systems and ensure that what3words is sent to the correct data field. - **Order management systems:** Many order management systems will have a dedicated field for what3words. Check with your account manager or contact us at [Technology.partnerships@what3words.com](mailto:Technology.partnerships@what3words.com) for further support. - **Last-mile carriers:** Many last-mile carriers have a dedicated field for sending what3words addresses within delivery order creation. Contact your account manager to check, or contact [Technology.partnerships@what3words.com](mailto:Technology.partnerships@what3words.com)  for further support. You can see a full list of our carriers and logistics software partners [here](https://what3words.com/business/what3words-enabled-logistics-carriers-and-software). ### Do you handle your own e-commerce deliveries? Follow these steps if you have your own delivery fleet or handle all e-commerce deliveries yourself. You can retrieve the coordinates for any what3words addresses sent to you by consumers. 1. To retrieve the coordinates for a what3words address, use the `convert-to-coordinates` call of the what3words API. See this guide: [Public API – convert-to-coordinates](https://developer.what3words.com/public-api/docs#convert-to-coords); 2. If you are using a what3words component, the `return_coordinates` parameter may be used for simplicity in retrieving the coordinates; 3. Important notes regarding convert-to-coordinates: - This call type is chargeable – [see available API usage plans here](https://accounts.what3words.com/select-plan); - If you are retrieving coordinates for what3words addresses, the `convert-to-coordinates` call must be executed once for every e-commerce delivery made to a what3words address. This applies even for repeat deliveries to the same what3words address, to comply with what3words T&C’s. ## Contact Support ### Have any questions? We’re here to support you! If you have any questions while using our what3words Regex expressions, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Adding the Planet Federal what3words plugin to QGIS Adding and configuring the what3words plugin to QGIS Topics: QGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) Source: https://developer.what3words.com/tutorial/adding-the-planet-federal-what3words-plugin-to-qgis Updated: 2026-11-27 ### Step by step The QGIS plugin brings the functionality of the what3words API to the QGIS platform. You can use the plugin to convert from coordinates to 3 word addresses by adding a field to a Shapefile, as well as searching for 3 word addresses or inspecting the map to view the 3 word address for a location. **QGIS Minimum Supported Requirements:** 3.0.0 QGIS Versions 1-3, Copyright (C) 2016-2020 build by Planet Federal QGIS Version 4, Copyright (C) 2020-2022, updated by what3words Limited ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Download the plugin You can now download the `What3words Tools` directly from the [QGIS Python Plugins Repository](https://plugins.qgis.org/plugins/). Open QGIS and click on **Plugins > Manage and Install Plugins >** type on the search bar for the `what3words` plugin and click on **Install Plugin** button. ## 3. Adding the plugin to QGIS ![QGIS plugin Settings link](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/221cff5a5dab2d4c00a46cce8df3f864b07581b6e7b01e894cc86c2ca30a3846.png) Once enabled, you will see what3words under the **Plugins** tab, choose the **Settings** menu and then **paste the API Key** you have copied from your [what3words account](https://accounts.what3words.com/). ## 4. Using the plugin Here are all the available tools in the what3words QGIS plugin: **Grid & Map Tools:** **1\. Click on the map** to capture and display the what3words address for that location. **2\. Toggle the what3words grid overlay** to visualise the 3m x 3m square system (click again to disable). **3\. Open the what3words map site** directly from the plugin for external address lookup. **Table Management Tools:** **4\. Import** what3words addresses or coordinates from CSV. **5\. Export** the address table to a CSV for external use. **6. Create a temporary feature layer** from stored what3words addresses. **7\. Delete** **the selected what3words address** from the address table. **8.** **Delete all the what3words addresses** from the address table. **Settings:** **9.** Access plugin settings from the toolbar: - Enter your API key; - Set your preferred language for addresses; - Configure a custom or enterprise API endpoint (if needed). **Marker Management:** **10.** **Toggle visibility** of map markers associated with what3words addresses. **11.** **Clear all map markers** from the basemap as required. **Address Table:** **12\.** When clicking on the map, addresses appear in the table below. You can: - Copy cell content - Zoom to feature - Flash or highlight the feature - Select a feature by clicking on its record **AutoSuggest Search:** **13\.** Start typing a what3words address in the **AutoSuggest input field** to receive up to 3 matching suggestions instantly. ![QGIS plugin - Key features](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f5680d78d1a045e4994513649c94e0ff4d157af15fd8f132389c96c2b2b8ef7d.w1600.webp) ![QGIS plugin - field calculator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/71299535d24dd6851f4df59c3e51ab1d7e459a67007edbcf7ec74a5ea93b1c11.png) ### ⚖️ Field Calculator Integration The what3words plugin lets you perform the field calculations directly within the attribute table of any vector layer Within attribute tables, you can: - **Convert** between coordinates and what3words; - **Change** the language of existing what3words addresses; - Use **AutoSuggest** when editing fields to help complete valid what3words addresses. To get started: - Open the attribute table of any vector layer; - Click the `Field Calculator` (🧮) icon in the toolbar. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/db3bef13add143c4688152e6dfce88278c1ffea52b849e96562a1828d49eb16a.png) ### ⚙️ Processing Toolbox Integration Use the what3words tools directly in your geoprocessing workflows via the QGIS Processing Toolbox: - **Generate a what3words grid** for any selected area - **Convert the language** of what3words address attributes in vector features - **Add a what3words address field** to a layer using coordinate geometry - **Geocode a CSV file** containing what3words addresses into point layers for spatial analysis To get started, open the **Processing Toolbox** in QGIS by navigating to `Processing` > `Toolbox` from the top menu. Then, expand the **what3words** section to access the available tools. ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). Use the `QGIS What3words Tools` to convert coordinates in any coordinate system to what3words. If you have data in a different coordinate system than WGS84, our `What3words Tools` handles the transformation of the original coordinate system to WGS84, as it is expected by what3words. ![1-csv-file-with-bng-coords](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0511f50805d300ba3e70a1eb74ba6b9cef101fa3b4c23f4cfd35cf674afc76c2.png) In this example, we will show how a CSV file with coordinates (Easting and Northing) in EPSG:27700 – OSGB 1936 / British National Grid can be imported into QGIS and how our `What3words Tools` can handle the transformation from this coordinate system to WGS84 while adding the what3words address to this file. **Note**: make sure the Easting and Northing are integer numbers. ![2-import-csv-to-qgis](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2af75cc1fad5996e214e7b99f33a6c5582ca0971d40ce6f8c10db24779501751.png) To import this CSV to QGIS we need to go to `Layer > Add Layer > Add Delimited Text Layer`. ![3-assign-csv-to-crs](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b3dac7aef83631e9a6c2afe0be864b53001703d14303e50dad321a96265c264b.png) 1. Then Import the **File name** from the original source by clicking on the 3 dots button. 2. Choose the **Geometry Definition**, Point coordinates and assign your x field to your easting and the y field to your northing (since our example it is using the British National Grid, otherwise you should choose the longitude and latitude instead); 3. Then assign the **Geometry CRS** to your CSV file, in our case the EPSG: 27700, it might ask you to choose some transformation, please use the most appropriate for your project. 4. Then you are ready to click the **Add** button to import this file onto your QGIS project. You will see point features being plotted on the map. ![4-batch-geocode-add-w3w-to-layer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b037fbf726b272edf10ec93e20dcdadd67c6ab02369bb73d160c55b438994bd3.png) Now we want to add what3words addresses to these point features. After enabling the what3words tools plugin on your QGIS project, open the Processing Toolbox, the what3words tools plugin would be visible at the bottom. Click on the tool **Add what3words address field to layer**. Choose your input layer, and output otherwise QGIS will save it as a temporary file, then click the button **Run**. ![5-add-w3w-to-layer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a31a498580fc0ba5faf5bee88c3e66a8b98e07c02c249a78b84f3bd4f9e3cad7.png) After the tool run successfully, if you open the attribute table of your point feature you will see a new column called **w3w** at the end of this table. --- # Adding the what3words Shopify app Adding and configuring the what3words Shopify Plus and Shopify Basic apps. Topics: Shopify, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/adding-the-what3words-shopify-app Updated: 2026-11-27 The what3words Shopify app allows a what3words address field to be added to a Shopify store. Customers can then provide a what3words address with orders for faster and more reliable deliveries. ## 1. Add app to your Store Add a what3words address field to your checkout page on Shopify by clicking this button below [Install](https://apps.shopify.com/what3words-address-field) ## 2. Select your theme (instructions will show based on theme selected) ### Basic Theme OS 2.0 For a quick walkthrough, please watch [this tutorial](https://youtu.be/VAheKz1ryn8) ### Installation process 1\. Go to the what3words app on the Shopify app store and click on **Install** 2\. From your Shopify admin, go to **Online Store > Themes** 3\. Click **Customize** 4\. Navigate to the **Cart** page 5\. Under **Apps**, select **Add Block > what3words Widget** 6\. Drag the what3words app block so it’s above the checkout button on the Cart page 7\. Click the **I have completed the steps** button to finalise the installation. **Note:** You can now add the what3words address to your cart drawer page instead of your cart page by following these easy steps: 1\. From your Shopify admin, go to **Online Store > Themes** 2\. Click  **… > Edit code** 3\. In the **Templates** directory, click **cart-drawer.liquid**. Find a suitable place in your theme where you want to use the widget and insert the following code shown below. We recommend placing it above the **customer** **note** or **checkout** button:
**data-alignment** is used to align the field to the right, left, or center **data-width** is used to specify the width of the field, e.g. 350px. ### Basic Theme OS 1.0 For a quick walkthrough, please watch [this tutorial](https://youtu.be/RywrHXet0sE) ### Installation process 1\. Go to the what3words app on the Shopify app store and click on **Install** 2\. From your Shopify admin, go to **Online Store > Themes** 3\. Click  **… > Edit code** 4\. In the **Templates** directory, click **cart.liquid**. Find a suitable place in your theme where you want to use the widget and insert the following code shown below. We recommend placing it above the **checkout** button:
**Note:** If you have a **cart-drawer.liquid** you could add this code snippet to it, then the what3words address field will be visible on your cart drawer page instead of your cart page. 5\. Click the **I have completed the steps** button to finalise the installation. ### Plus - Checkout Extension For a quick walkthrough, please watch [this tutorial](https://youtu.be/-acIEiMvchs) ### Installation process 1\. Go to the what3words app on the Shopify app store and click **Install.** 2\. From your Shopify admin left-hand panel, open **Online** **Store** in a new tab to keep the **Installation process** page open. 3\. The page will open on **Themes**, click **Customize**. 4\. In the dropdown menu at the top of the page, select **Checkout**. 5\. Click **Add** **app** **block** in the bottom left and select ‘**checkout-ui-extension**’ by what3words from the list. 6\. We also strongly recommend enabling the following feature: - ***Store address in notes*** This is to pass what3words addresses on to carriers and order management software. ![shopify-notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/49cec7bfb05b136bd4ba47127354a75a5493d4601941ce218495e187894ae7f2.w1600.webp) 7\. Scroll back up and click the arrow at the top of the left-hand panel to **go back** to your sections 8\. Click and drag **checkout-ui-extension** down to below Shipping address. 9\. Click **Save** at the top right of the page. 10\. Return to the **Installation****process** tab and click **I have completed the steps.** ## 3. Customisation and extra features ### Customisable settings There are several settings that can be altered via the “Settings” page of the app: **Enable what3words field:** By default, the what3words address field will be visible on your site. Uncheck this to remove the what3words field. **Enable tooltip**: By default an `(i)` icon will appear next to the field with a tooltip to explain what3words and a link to the what3words Map Site. Uncheck this to remove the icon and tooltip. **Custom field label**: By default the field label is `what3words address (optional)`. We recommend keeping this as is but it can be changed if desired. **Custom placeholder**: Changes the placeholder text of the field. **AutoSuggest Focus**: If the website knows the user’s location then use the location to provide better what3words address suggestions. **Add what3words address to your Order Notes**: You can easily add the what3words address as an optional note that a shop owner can attach to the order. Currently, the what3words address is added by default as extra information in the `Additional details` section of an order details page. **Save Recent what3words Addresses:** You can choose whether recent what3words addresses should be saved and shown in the app block, cart snippet and checkout for logged-in customers. When enabled, saved addresses will be suggested for future purchases. Merchants can now save recent what3words addresses within orders by adding what3words order metafields, supporting internal reporting, location analytics, and improved customer experience. **Clipping options**: Restrict suggestions to a country, circle, bounding box, or polygon ![shopify-basic-settings.png](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a3baedc594d0d1e8e2213ed3b438b1d7a5a4aaeb06140112f851491069f2508d.w1600.webp) ### Viewing the what3words address for an order The what3words address is saved against an order within the **Additional Details** section of the order page. This can then be printed on order summaries or exported with orders to pass on to delivery companies. ![Orders Admin page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e8cd113aa72bce76d703cb7f6c33baca29155c35e938bf6c7e5e0b9202121ce0.w1600.webp) ### Adding what3words Addresses to Order Notes To enhance order tracking and reporting, you can add a what3words address as an optional Order notes attached to each order. By default, the what3words address is included as extra information in the `Additional details section` of the order details page. For a more customised setup, consider adding the what3words address to your order notes. This setup not only allows shop owners to easily view and manage precise location data within their order records but also enables seamless transfer of what3words addresses to carriers or any other Order Management Systems (OMS). This supports internal reporting, and location-based analytics, and improves customer experience by simplifying accurate address management and integration with delivery workflows. ![shopify-add-orders-notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ab7a93be98fe6e46edbe0a3a28c20ad7dc066093106057dac11ca93bdf841f19.w1600.webp) ### Saving Recent what3words Addresses to Orders and as Order Metafields You can allow recent what3words addresses to be saved and displayed in the app block, cart snippet, and checkout for logged-in customers. Here is the settings page of the plugin in a Shopify Plus store: ![shopify-plus-save-recents-on-settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b2baf8c0c3a9fceb9d3a36ae6593423b86dec53123852d5cdf1d5817c3cd122.w1600.webp) When enabled, these saved addresses will appear as suggestions for future purchases, enhancing user convenience. Additionally, merchants can save recent what3words addresses within orders by creating a dedicated what3words orders metafield. This enables internal reporting, supports location analytics, and enhances customer experience with streamlined, location-specific data. Here’s a step-by-step guide to adding an orders metafield for what3words addresses in Shopify: 1\. Access Metafields: Start by navigating to `Settings` and searching for `Metafields`. 2\. Define Metafields: Go to Metafield Definitions and select `Orders` from the list. 3\. Unstructured Metafields: Within Orders, select `View unstructured metafields`. 4\. Add what3words Address: Locate the new definition `what3words.address`. Click `Add Definition`. 5\. Set Name and Description: Provide a clear name (e.g., “what3words Address”) and description (e.g., “Stores the 3 word address for each order”). 6\. Select Data Type: Choose `Single line text` as the data type. You may also add a JavaScript regex for validating the format of a what3words address: ``[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}`` You can find out more on how to find what3words within a text in this [tutorial](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address#ai-llms-no-real-time-autosuggest). 7\. Configure Access Options: In the options section, select **Read** for *Storefront Access* to allow customers to view the address, and **Read and Write** for *Customer Accounts Access* to enable saving and updating addresses. This setup ensures that customer data is secure while allowing necessary access for updates. 8\. Save: Click `Save` to finalise the metafield configuration. Once saved, return to Orders to see your new what3words order metafield. This field will automatically populate whenever customers add a what3words address, giving merchants easy access to precise location data for order processing and reporting. ![Shopify-add-order-metafield](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/67f1a53d8f289629d91d37dbd5d0e4f91989eddacf45f55181434c48a11d5be7.w1600.webp) ### Enabling the what3words Field in Shop Pay for Shopify Plus (Checkout Extension) Our checkout extension can now be integrated with Shop Pay for Shopify Plus stores using the checkout extension. Shop Pay offers a fast, secure checkout experience, allowing customers to save their information for streamlined future purchases. By updating the checkout behaviour of the what3words plugin, you can include a dedicated what3word field at the bottom of the Shop Pay form, enabling precise location data collection right at checkout. Steps to Enable the what3words Field in Shop Pay: 1\. Access Your Checkout Page: Start by navigating to your checkout page in your Shopify admin. 2\. Locate the what3words App Block: Find the what3words app block within the checkout page configuration. 3\. Configure Settings: • Open the Settings page for the what3words plugin. • Go to **Checkout Behavior** and enable the option to **Include App Block in Shop Pay**. 4\. Preview Shop Pay: Verify that Shop Pay is enabled in your payment settings, then preview the checkout to confirm that the what3words field appears within the Shop Pay form. Once configured, the what3words field will display on the Shop Pay checkout form, storing the precise 3 word address directly in the order details as standard, ready for use in order processing and reporting. ![shopify-plus-shop-pay](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a9fe777d53f3063caa57eee9e1de62a52a778d852a3ad9bbed2362995ed247aa.w1600.webp) ### Adding what3words to your order confirmation email 1. Go to the **Dashboard** of the plugin. 2. From your Shopify admin, go to **Settings > Notifications > Order** confirmation. 3. Find the Liquid variable `{{ shipping_address | format_address }}` that references the shipping address. 4. Insert this code immediately below: {% if attributes\["what3words address"\] %} what3words address {{ attributes\["what3words address"\] }} {% endif %} ### Adding what3words to your order invoice 1. Go to the **Dashboard** of the plugin. 2. From your Shopify admin, go to **Settings > Notifications > Order** confirmation. 3. Find the Liquid variable `{{ shipping_address | format_address }}` that references the shipping address. 4. Insert this code immediately below: {% if attributes\["what3words address"\] %} what3words address {{ attributes\["what3words address"\] }} {% endif %} ### Sharing the what3words address with Order Management Systems **Note:** This section is for customers that would like to share the what3words address of each order with Order Management Systems. In Shopify, the what3words address attributes are stored in the customers’ orders of the Shopify Orders REST API as `note_attributes` and also as `note`. For more information on how endpoints and requests to the Shopify REST ADMIN API, please [follow this guide](https://shopify.dev/api/admin-rest#endpoints). The API request to make to the Shopify Orders REST API should be: `GET {{your-shopify-site}}/admin/api/2022-07/orders/{{your-order-number}}.json` The API response should be: "note": "what3words address: ///filled.count.soap" "note\_attributes": \[{ "name": "what3words address", "value": "filled.count.soap" }\] Another way to display easily what you can retrieve from the Shopify REST ADMIN API is by going to the `Admin page > Orders > (number of order)` and adding at the end of this path `.json`. For example: `https://.myshopify.com/admin/orders/4253206970468.json`. Search for `note` and `note_attributes`, your what3words address will be stored within this parameter. **Note:** By attaching what3words address to the `note` the store owner can now print shipping labels and packaging slips with the what3words address as a note of the order. ![Shopify Orders API](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3cb4cbb1332aa58f295c806342ee14376427015d4f3cc3e292c58663809474dc.w1600.webp) ### Troubleshooting If you are stuck with the installation of our plugin or are using a custom theme, you can give our support team collaborator access to your Shopify admin directly through your own Partner Dashboard or using the Shopify app. These collaborator permissions give our support team access to only the sections of your store that you want us to see. Only the store owner or staff with **Manage collaborator requests** permission, can view collaborator access requests or grant collaborator access to a store. Otherwise, contact our [support team](mailto:support@what3words.com) they will be able to submit a request to access your store, and you will receive an email about the request and a notification on your Shopify Home. Please make sure you mentioned your store website. Alternatively, if you have a collaborator request code enabled, then you need to provide the collaborator request code to our [support team](mailto:support@what3words.com). --- # Adding what3words field to your Haravan store (Thêm trường what3words vào cửa hàng Haravan) Adding and configuring the what3words AutoSuggest component to the checkout page of your Haravan store. (Cách thêm và định cấu hình thành tố Tự động gợi ý vào trang thanh toán của cửa hàng Haravan.) Topics: Haravan, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/adding-what3words-field-to-your-haravan-store Updated: 2026-11-27 ### Tiếng Việt Hướng dẫn chi tiết cách thêm trường địa chỉ what3words vào trang giỏ hàng của cửa hàng Haravan, giúp khách hàng nhập và xác minh địa chỉ what3words mỗi khi đặt đơn hàng. Cách dễ nhất để thêm trường địa chỉ what3words vào cửa hàng Haravan là sử dụng thành tố Tự động gợi ý. Thành tố này cho phép người dùng nhập nhanh và đúng địa chỉ what3words trên trang thanh toán bằng cách đưa ra các gợi ý khi người dùng gõ địa chỉ, nhằm đảm bảo giá trị đầu vào là địa chỉ what3words hợp lệ. **Chú ý:** Phương pháp tích hợp này đã được thử nghiệm trong các giao diện: **Evo watch, Luxe Mode,** và **Fresh Organic Food**. ## 1. yêu cầu Bạn sẽ cần tạo khóa API miễn phí để bắt đầu. Chọn khóa API what3words để tích hợp Thành phần tự động đề xuất. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Thêm thành tố Tự động gợi ý vào trang Giỏ hàng ![haravan-edit-theme](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/37f736f0e3bd703e147fd4c54acc3fdd58edda64eb76bb517f548b9b5971795a.png) 1\. Sau khi đăng nhập vào Haravan, chọn mục **Website > Giao diện** 2\. Nhấp vào biểu tượng ba dấu chấm (**…**) **> Chỉnh sửa code** ![haravan-theme-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c7d1844500846555b3a72680977e6d07cefb163ae6169b37172dbf1d9aa6c17f.png) 3\. Mở thư mục **Layouts** 4\. Tìm **file Giao diện chính**. Trong ví dụ này, các file đó được gọi là **theme.liquid** và **en.liquid** (phiên bản tiếng Anh của file giao diện gốc). 5\. Sao chép hai đoạn script sau rồi dán vào giữa tag **** như bên dưới trong **file Giao diện chính**. **Lưu ý:** Hai đoạn script này sẽ cho phép bạn sử dụng thành tố Tự động gợi ý. **HTML** ```html ``` ![haravan-add-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e07a2c9d2245827b4f552e6840f3595b33cea2e353e123acc93fc63447f0d9b1.png) 6\. Mở thư mục **Snippets** 7\. Nhấp vào **Thêm mới một snippet** 8\. Tạo snippet mới, đặt tên là **w3w-autosuggest** 9\. Sau đó nhấp vào **Thêm** 10\. Một file mới có tên **w3w-autosuggest.liquid** sẽ được tạo trong thư mục **Snippets** 11\. Sao chép code snippet dưới đây rồi dán vào file **w3w-autosuggest.liquid** **JavaScript** ```javascript ``` **Lưu ý:** Đoạn script này sẽ hiển thị địa chỉ what3words trong: - thuộc tính **note\_attributes**, xuất hiện ở endpoint của API Đơn hàng tại `https:///cart/update.js`, nhớ thay `` bằng URL cửa hàng của bạn - và phần **Ghi chú đơn hàng** trên trang đơn hàng cụ thể (sau khi nhấp vào mã đơn hàng). ![haravan-cart-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a39311a3a532c2f27911aeda3e79662abe1c4fcbec0b5d0ad2f13d9ca2491a34.png) 12\. Mở thư mục **Giao diện** 13\. Mở file **cart.liquid** và **cart.en.liquid** (nếu có phiên bản tiếng Anh của file **cart.liquid**) 14\. Thêm đoạn script sau vào phần dưới cùng của file **cart.liquid** và **cart.en.liquid** 15\. Thay YOUR-API-KEY bằng khóa API what3words của bạn 16\. Nếu trang **Giỏ hàng** của bạn có hai chế độ xem khác nhau dành cho máy tính và thiết bị di động, vui lòng thay `desktopParentSelector` và `mobileParentSelector` bằng selector `.class` hoặc `#id` của code snippet cho máy tính và thiết bị di động tương ứng ở ngay trước nút thanh toán. Nếu bạn chỉ có một chế độ xem duy nhất, bạn có thể dùng chung selector `.class` hoặc `#id` của code snippet cho máy tính hoặc thiết bị di động. **Lưu ý:** Code snippet này hiển thị trường địa chỉ what3words trên trang Giỏ hàng của cửa hàng. **Liquid** ```liquid {% assign apiKey = 'YOUR-API-KEY' %} {% assign desktopParentSelector = 'REPLACE WITH YOUR CLASS OR ID SELECTORS' %} {% assign mobileParentSelector = 'REPLACE WITH YOUR CLASS OR SELECTORS' %} {% include 'w3w-autosuggest' %} ``` Trong ví dụ sau, đối với chế độ xem **Máy tính**, hãy dùng lớp `summary-total` làm selector lớp. Trong giao diện **Luxe Mode**, hai chế độ xem máy tính và thiết bị di động đều giống nhau nên bạn có thể dùng chung một lớp cho cả hai: `{% assign apiKey = 'YOUR-API-KEY' %}` `{% assign desktopParentSelector = 'summary-total' %}` `{% assign mobileParentSelector = 'summary-total' %}` `{% include 'w3w-autosuggest' %}` ![haravan-desktop-view](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ea01df2849b5ed0b48047a47915d52642fb8cf819e384bca239baa9720216ea7.w1600.webp) ![haravan-order-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a68f41563ebc89d1056455cb31ecc716a55d1861d1bd46675c6ed31f083d18af.png) Sau khi khách hàng gửi đơn hàng, địa chỉ what3words sẽ được lưu theo đơn đó, trong phần **Ghi chú đơn hàng** trên trang đơn hàng tương ứng. Bạn có thể in địa chỉ này cùng với các thông tin khác của đơn hàng hoặc xuất ra cùng với đơn hàng để chuyển cho công ty giao vận. ## 3. Tùy chỉnh cài đặt Thêm ngôn ngữ dự phòng ưu tiên dưới dạng `setAttribute` vào thành tố Tự động gợi ý như minh họa dưới đây: **JavaScript** ```javascript ``` Tùy chỉnh placeholder dưới dạng `setAttribute` cho dữ liệu đầu vào, như minh họa dưới đây. Bạn nên dùng **địa chỉ what3words** làm placeholder. **JavaScript** ```javascript ``` Giới hạn các kết quả gợi ý trong phạm vi một quốc gia hoặc một danh sách quốc gia nhất định được phân tách bằng dấu phẩy. Ví dụ: `clip_to_country="VN"`. Để tìm hiểu các phương án giới hạn khác, vui lòng tham khảo hướng dẫn [tại đây](https://developer.what3words.com/tutorial/javascript-autosuggest-component#component-attributes). **JavaScript** ```javascript ``` Bên cạnh việc giới hạn quốc gia, bạn cũng có thể cung cấp thêm phạm vi tập trung của kết quả bằng thuộc tính `autosuggest_focus`. Phạm vi này phải được cung cấp dưới dạng kinh độ và vĩ độ, thường là vị trí của người dùng lấy từ chức năng GPS trên thiết bị của họ. Việc cung cấp phạm vi tập trung sẽ đảm bảo rằng những gợi ý hiển thị cho người dùng phù hợp hơn với vị trí của họ. **JavaScript** ```javascript ``` Bạn có thể ghi đè thông báo lỗi bằng một giá trị tùy chỉnh. Ví dụ: `invalid_address_error_message="Không tìm thấy địa chỉ what3words cho tổ hợp này"`. **JavaScript** ```javascript ``` ## 4. Thêm địa chỉ what3words vào email xác nhận đơn hàng - Sau khi đăng nhập vào Haravan, truy cập **Cấu hình > Thông báo > Xác nhận đơn hàng**. - Tìm biến `Liquid {% if requires_shipping and shipping_address %}` gắn với địa chỉ giao hàng. - Nhập đoạn mã này vào bên dưới địa chỉ giao hàng: **Liquid** ```liquid {% if attributes["what3words_address"] != blank %}

what3words address

{{ attributes["what3words_address"] }}

{% endif %} ``` ## 5. Thêm trường what3words vào hóa đơn Sau khi đăng nhập vào Haravan, truy cập **Cấu hình > Thông báo > Gửi hóa đơn đề nghị thanh toán**. Tìm biến `Liquid {% if requires_shipping and shipping_address %}` gắn với địa chỉ giao hàng. Nhập đoạn mã này vào bên dưới địa chỉ giao hàng: **Liquid** ```liquid {% if attributes["what3words_address"] != blank %}

what3words address

{{ attributes["what3words_address"] }}

{% endif %} ``` ## 6. Chia sẻ địa chỉ what3words với Hệ thống quản lý đơn hàng **Lưu ý**: Phần này dành cho những khách hàng muốn chia sẻ địa chỉ what3words trên từng đơn hàng với Hệ thống quản lý đơn hàng. Trong Haravan, thuộc tính địa chỉ what3words được lưu trong đơn hàng của khách hàng tại REST API Đơn hàng Haravan bằng `note_attributes`. Để biết thêm thông tin về các endpoint và yêu cầu gửi tới `Haravan REST ADMIN API`, vui lòng [**tham khảo hướng dẫn này**](https://docs.haravan.com/docs/get-started/overview/). (Chỉ có tiếng Anh). Cú pháp cho yêu cầu API gửi tới REST API Đơn hàng Haravan là: `GET https://apis.haravan.com/com/orders/{{order_id}}.json` **Lưu ý**: Thay `order_id` bằng số/mã đơn hàng. Cú pháp phản hồi API là: **JSON** ```json "note_attributes": [{ "name": "what3words_address", "value": "///filled.count.soap" }] ``` ## 7. Liên hệ hỗ trợ ### Bạn có thắc mắc? Chúng tôi luôn sẵn lòng hỗ trợ! Nếu bạn có bất kỳ câu hỏi nào liên quan đến việc sử dụng what3words cho Excel, vui lòng liên hệ với chúng tôi qua email [support@what3words.com](mailto:support@what3words.com). ### In English A step-by-step guide to show you how to add what3words address field to your Haravan store’s cart page, allowing your customers to easily enter and validate a what3words address when placing an order. The easiest way to add the what3words address field to your Haravan store is to use our AutoSuggest Component. It allows users to quickly and correctly input a what3words address to a form input on the checkout page by providing suggestions as a user types, to ensure the input value is a valid what3words address. **Note:** This integration has been tested in the themes: **Evo watch****, Luxe Mode**, and **Fresh Organic Food.** ## 1. Requirements You will need to create a free API key to get started. Choose a what3words API key to integrate the AutoSuggest Component. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the AutoSuggest Component to the Cart page ![haravan-edit-theme](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/37f736f0e3bd703e147fd4c54acc3fdd58edda64eb76bb517f548b9b5971795a.png) 1\. From your Haravan Admin, go to **Website > Themes** 2\. Click on the **…** (3 dots button) **\> Edit Code** ![haravan-theme-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c7d1844500846555b3a72680977e6d07cefb163ae6169b37172dbf1d9aa6c17f.png) 3\. Go to the **Layouts** directory 4\. Search for the **main Theme file.** In this example, the files are called **theme.liquid** and **en.liquid** (the English version of your original theme file). 5\. Copy the following 2 scripts and paste them within the **** tag as shown below in your **main Theme file.** **Note:** These scripts allow you to use the what3words AutoSuggest Component. **HTML** ```html ``` ![haravan-add-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e07a2c9d2245827b4f552e6840f3595b33cea2e353e123acc93fc63447f0d9b1.png) 6\. Go to the **Snippets** directory 7\. Click on **Add a new snippet** 8\. Create a new snippet called **w3w-autosuggest** 9\. Then click on **Create snippet** 10\. A new file called **w3w-autosuggest.liquid** would be created in the **Snippets** folder 11\. Copy the following code snippet in this file **w3w-autosuggest.liquid** **JavaScript** ```javascript ``` **Note:** This script allows you to display the what3words address to: - the **note\_attributes** which is visible in the endpoint of the Orders API at `https:///cart/update.js`, replace the `` with your store URL - and the **Additional Information** on the Orders Admin page. ![haravan-cart-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a39311a3a532c2f27911aeda3e79662abe1c4fcbec0b5d0ad2f13d9ca2491a34.png) 12\. Go to the **Templates** directory 13\. Open the **cart.liquid** and **cart.en.liquid** files (if you have an English version of the **cart.liquid** file) 14\. Add the following scripts at the bottom of the **cart.liquid** and **cart.en.liquid** files 15\. Replace `YOUR-API-KEY` to your what3words API key 16\. If you have separate desktop and mobile views for your **Cart** page in your theme please replace the `desktopParentSelector` and the `mobileParentSelector` with the `.class` or `#id` selectors of your desktop and mobile code snippet that sits just before the checkout button. Otherwise, if you only have one view you can apply the same `.class` or `#id`selectors of your desktop or mobile code snippet **Note:** This code snippet allows you to display the what3words address field in the Cart page of your store. **Liquid** ```liquid {% assign apiKey = 'YOUR-API-KEY' %} {% assign desktopParentSelector = 'REPLACE WITH YOUR CLASS OR ID SELECTORS' %} {% assign mobileParentSelector = 'REPLACE WITH YOUR CLASS OR SELECTORS' %} {% include 'w3w-autosuggest' %} ``` In the following example, for the **Desktop** view, use the class `summary-total` as a class selector. In this theme **Luxe Mode**, the desktop and mobile view are the same so we can use the same class for both: `{% assign apiKey = 'YOUR-API-KEY' %}` `{% assign desktopParentSelector = 'summary-total' %}` `{% assign mobileParentSelector = 'summary-total' %}` `{% include 'w3w-autosuggest' %}` ![haravan-desktop-view](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ea01df2849b5ed0b48047a47915d52642fb8cf819e384bca239baa9720216ea7.w1600.webp) ![haravan-order-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a68f41563ebc89d1056455cb31ecc716a55d1861d1bd46675c6ed31f083d18af.png) After customers submit an order, the what3words address will be saved against an order within the **Additional Information** section of the order page. This can then be printed on order summaries or exported with orders to pass on to delivery companies. ## 3. Customisable settings Add preferred fallback language as a `setAttribute` to the AutoSuggest element as shown below: **JavaScript** ```javascript ``` Customise the placeholder as a `setAttribute` to the input, as shown below. We recommend keeping the placeholder as a **what3words address**. **JavaScript** ```javascript ``` Restrict suggestions to a given country or comma separated list of countries. Example: `clip_to_country="VN"`. For more clipping options please check this [guide](https://developer.what3words.com/tutorial/javascript-autosuggest-component#component-attributes). **JavaScript** ```javascript ``` In addition to country clipping, it is also possible to add focus to results using the `autosuggest_focus` attribute. The focus should be supplied as a lat and long, usually the user’s location from the GPS on their device. Supplying focus will ensure that suggestions displayed to the user are biassed to their location. **JavaScript** ```javascript ``` You can overwrite the error message with a custom value. Example value: `invalid_address_error_message="No valid what3words address found"`. **JavaScript** ```javascript ``` ## 4. Add what3words to your order confirmation email - From your Haravan admin, go to **Settings > Notifications > Order** **Confirmation**. - Find the Liquid variable `{% if requires_shipping and shipping_address %}` that references the shipping address. - Insert this code below the shipping address: **Liquid** ```liquid {% if attributes["what3words_address"] != blank %}

what3words address

{{ attributes["what3words_address"] }}

{% endif %} ``` ## 5. Add what3words to your order invoice - From your Haravan admin, go to **Settings > Notifications > Order** **invoice**. - Find the Liquid variable `{% if requires_shipping and shipping_address %}` that references the shipping address. - Insert this code below the shipping address: **Liquid** ```liquid {% if attributes["what3words_address"] != blank %}

what3words address

{{ attributes["what3words_address"] }}

{% endif %} ``` ## 6. Sharing what3words address with Order Management Systems **Note:** This section is for customers that would like to share the what3words address of each order with Order Management Systems. In Haravan, the what3words address attributes are stored in the customers’ orders of the Haravan Orders REST API as `note_attributes`. For more information on endpoints and requests to the Haravan REST ADMIN API, please **[follow this guide](https://docs.haravan.com/docs/get-started/overview/)**. The API request to make to the Haravan Orders REST API should be: `GET https://apis.haravan.com/com/orders/{{order_id}}.json` **Note:** Substitute `order_id` with your order number/id The API response should be: **JSON** ```json "note_attributes": [{ "name": "what3words_address", "value": "///filled.count.soap" }] ``` ## 7. Contact Support ### Have any questions****? We’re here to support you! If you have any questions while using what3words for Excel, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Adding what3words to Cadcorp SIS Desktop and Cadcorp SIS WebMap what3words can be integrated with Cadcorp SIS Desktop and Cadcorp SIS WebMap. Topics: Cadcorp, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) Source: https://developer.what3words.com/tutorial/adding-what3words-to-cadcorp-sis Updated: 2026-11-27 what3words can be integrated with Cadcorp SIS Desktop and Cadcorp SIS WebMap. ## Adding what3words to Cadcorp SIS Desktop SIS Desktop search options support what3words, so users can search a what3words address or click on the map to learn the what3words address for that location. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Search what3words addresses 1\. In SIS Desktop, you can enable what3words searching by first including it in the `Ribbon.json` file (`C:\Program Files\Cadcorp SIS Desktop 9.1\Options\Desktop`) by adding `“what3words”: true` parameter within a text editor. ![Desktop-Ribbon-json](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e9bd05c9a6864e394f3507f7efb8159db6241e44b8b8b68888a02a6b9e7f02d8.w1600.webp) 2\. Open SIS Desktop and start typing in the Search field to see the included list; ![Desktop-Search-dialog-w3w](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4391297510534d5af61e53af0280648dd7089b6fe7bd57c56f41e778cc13156e.w1600.webp) 3\. Click `Configure` to enter the API key, and all searches will now include results from what3words; 4\. **Search**: Type the full what3words address, such as `filled.count.soap`, select from the dropdown confirmation, and the map zooms to the 3m square; ![Desktop-w3w-Search-1173x630](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4940ce9b8e1bef25f2a8e4d962e3e166c1a91b41c74603a2aa0f4c55fc1aacb6.w1600.webp) 5\. **Click-to-identify**: `View ▸ Status Bar ▸ what3words` to see live what3words cursor tracking. ![Desktop-Status-Bar-w3w-1173x634](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8ea8ca910d59a37f3df2aca7fa07635325e4c03956e1e6870fb1aa4ccd65f664.w1600.webp) ### Advanced Analyst Tools & Bulk Operations 1\. **Bulk geocode**: Use the Geocode Process Operation on a table with a w3w column to create a layer of points created by geocoding the w3w addresses; 2\. **View geometry**: Use Add `Overlay → View Geometry` and select any table containing what3words addresses. This allows users to take, for example, a spreadsheet or database table containing what3words addresses and display the locations in SIS Desktop as a map overlay. Make sure you select what3words as the BLOB configuration format. ![Desktop-w3w-Geocode-1173x496](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/925b91fc949bc1c30cbeddbf99ee30e681af0ba963cc8aaab7f44c6eb9e8a368.w1600.webp) ## Adding what3words to Cadcorp SIS WebMap what3words can be integrated with [Cadcorp SIS WebMap](https://www.cadcorp.com/products/web-mapping/cadcorp-sis-webmap/) and accessed via a button on the map’s interface. The user can either click on the map to return the what3words address for that location, or input three words to zoom to the location. When the user types in the first two words and any letter from the third, they’re offered suggestions for the final word. ## 3. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 4. Contact Cadcorp Send the API key to [sales@cadcorp.com.](mailto:sales@cadcorp.com) Your Cadcorp account manager will then contact you to send you terms of use and to arrange for the resource to be added. ## 5. Search what3words addresses 1\. In SIS WebMap Manager, select the what3words configuration section and add an API key. Then, restart SIS WebMap; 2. In SIS WebMap, clicking on the map returns the what3words address for that location. The address can be copied as text; ![WebMap-w3w-click-1173x800](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8c93549f5ac1c1d53be34d525db843e5364251b234b525355a3f6154d756102f.w1600.webp) 3\. Typing in the what3words address zooms to the location and places a pin on the map. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7a5cea820a48373eac22bc4e79c76f168da44c8cb0da0ebe1a7864301015aa1d.w1600.webp) ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Adding what3words to e-commerce checkout The tutorial explains how e-commerce businesses can integrate what3words to enhance delivery accuracy and reduce costs by allowing customers to specify precise locations at checkout. Topics: Adobe Commerce (formerly Magento), BigCommerce, Ecwid, Haravan, OpenCart, Shopify, Shopware 6, SwiftComplete, Wix, WooCommerce, WordPress, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/adding-what3words-to-e-commerce-checkout Updated: 2026-11-27 Every checkout experience differs, so we’ve created three ways to integrate what3words into your checkout pages. This tutorial explains how e-commerce businesses can integrate what3words at checkout to enhance delivery accuracy. [Watch this walkthrough on YouTube](https://www.youtube.com/watch?v=Up2v77LujeY) ## Why use what3words for e-commerce? A quarter of street addresses don’t lead to a front door. When orders don’t reach customers, time is wasted dealing with extra delivery admin and delays also affect customer satisfaction. E-commerce businesses can offer customers the option to share a precise what3words address at checkout, alongside their traditional address information. This gives customers more confidence in placing their order, knowing it will arrive in exactly the right place. By making it easy for your customers to enter an exact delivery location at checkout, you’ll be able to reduce lost parcels, improve customer experience and avoid delivery admin – therefore reducing the costs associated with failed deliveries. ## How do I start using what3words? (2 Steps) ## 1. Capture what3words address at checkout There are three ways you can capture what3words addresses at checkout. Which is best for you depends on your site architecture. It is also possible to capture what3words addresses in multiple locations e.g. a Dedicated Field and Delivery Notes. **Please choose your option below:** ### Option 1 - Dedicated field ![Checkout Integration - Dedicated Field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/29225d80f1f1c5a5aea4f6e08d33f22e5539001531623283b39d4a744a20c22e.gif) ### Add a dedicated field to your checkout page This integration adds a dedicated what3words address field to your checkout, alongside the traditional address information you already collect. The field is entirely optional, so customers can choose to fill it in or leave it blank. This field can be added via a plugin or a what3words component. For instructions on how to add the dedicated field to your checkout, please choose the appropriate option below. ### If you use an e-commerce platform... #### Solution: Use a what3words plugin for your platform Convenient what3words plugins are available for many popular e-commerce platforms. See this guide: - [E-commerce Plugins](https://developer.what3words.com/tools/e-commerce) If you cannot find your e-commerce platform, please get in touch with us at [technology.partnerships@what3words.com](mailto:technology.partnerships@what3words.com) and our solutions team will explore options with you. [ ![Shopify Basic](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d90f983be150ce55f3c7a6ad5df0ea1838dad3d353b4b8ece3c7ea10a66943d2.w1600.webp) ](https://developer.what3words.com/tools/e-commerce/shopify) [ ![BigCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/07ca3a79ce901d7dd157a9b2dc27f79fd0a9788ae48de7b82d1f7268e0be91cd.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-bigcommerce-app) [ ![WooCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/29b7db83d00eeacafa4f33980464aac7788d94fcfa3596fa25c8cdebce50a7e9.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-woocommerce-plugin) [ ![CubeCart](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f621a9fe13b6d1d52c998430cc049a5858edf771252543d02bd3741d8c0ac614.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-cubecart-extension/) [ ![Adobe Commerce (formerly Magento)](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7da6f5a46dc450ea67aaad44ba923f368ee2e69adaf996f1929336daf710d8ef.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-magento-2-extension/) [ ![Shopify Plus](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/46da8593bcb6e86025186ce45a69be8c2ece83eed05aa67225ecc96d9df42f85.w1600.webp) ](https://developer.what3words.com/tutorial/adding-the-what3words-shopify-app/) [ ![nopCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9cb025ce76d81effcc2ffa96082ff2bf56eb46a5123a3c7fe085342026cf4a9a.w1600.webp) ](https://what3wordsnotion.notion.site/nopCommerce-Integration-ab7a1f21923b4a5f83e9a8160f74d4db) [ ![Ecwid](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1cb19da39cf15b01ad6b5ad7f5bfd490babd6db3c84b277a74d1e5437f334c7f.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-ecwid-app) [ ![OpenCart](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/454d5d386baf6aedc98c3c9fec31bc820b82ebcf1649713d9a2742962619db09.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-opencart-plugin/) [ ![Wix](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9c67e6474a961dc86ad0581c1cb814d141ee19f2e7c5cd3831f9f6c40682be74.w1600.webp) ](https://developer.what3words.com/tutorial/adding-your-what3words-ecwid-app-to-your-wix-site) [ ![Shopware](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/59f11106d31b4712d561ac7af9d865b0cfa3db43186ab34dc898f203a60100a6.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-shopware-plugin) [ ![Experian](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/563b6fe90601bb5d0649f340a707b756f323b3068955ab33a07505370a3b2844.w1600.webp) ](https://what3wordsnotion.notion.site/Experian-what3words-Integration-Guide-374fbc6522be440ba84ff333feaaeb54) [ ![Data8](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c3e3914d2b1bcedadc80d06e71762fcbaf650ba695edfcf333b68b2da3f74b79.w1600.webp) ](https://what3wordsnotion.notion.site/Data8-Integration-Guide-e81f57b4314840f9b70d40d0197b01cd) [ ![Woosmap](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f12bc4abd4a2e3014bb14ca063bd906e38644e92bc4b160a9a537df484467e8b.w1600.webp) ](https://developers.woosmap.com/products/w3w-api/how-to/what3words-to-address/) [ ![AeroCommerce](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7590a49a504eaac0204007f46ab1c5396bb2f66ceb9bb90c1d24a0741a947f7a.w1600.webp) ](https://developer.what3words.com/tutorial/installing-the-what3words-aerocommerce-extension) [ ![WordPress](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0222a4dd7d3a963f21e179bfea9f6db85b2cda4852b1db3e63751fd22b907309.w1600.webp) ](https://developer.what3words.com/tools/e-commerce/wordpress) [ ![Swiftcomplete](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f03dcb2ca71b0e7b7863e02878c2da3fe226bfd883b3c5bffb135b34b21bb7ef.svg) ](https://www.swiftcomplete.com/places/what3words/) ### If your e-commerce site is bespoke/self-built... #### Solution: Implement the what3words component A what3words component comprises a full what3words entry field, complete with AutoSuggest for validation. The components are fully localised and the style is easy to customise, enabling a native appearance within your existing checkout. - [what3words JavaScript Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) ### Option 2 - Address Validation ![Checkout Integration - Existing Field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f18c28d1c93f00928b3954da1d646a96a8f9a3185dfc809a6d27940342abbfcd.gif) ### Upgrade your address validation field on your checkout page This integration upgrades your existing address validation field to accept what3words. what3words can be switched on in compatible address validation software including: [![Experian](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1a6115b0c5aeb0581ea46b4147a5ae33824f0e32ba2c4cdac9e40970eb936373.w1600.webp)](https://what3wordsnotion.notion.site/Experian-what3words-Integration-Guide-374fbc6522be440ba84ff333feaaeb54?pvs=4) ![Woosmap](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3e5d35e2a0ce284e22cebd10404c216b3f1bec7118bb760aa4d72acea3418e04.w1600.webp) [![Swiftcomplete](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8f0ecfd96bf20a619fc0d3b38780a8cd94c47669e3818850d18ffaaa02ecead7.w1600.webp)](https://developer.what3words.com/tutorial/adding-swiftcomplete-address-autocomplete-to-ecommerce-checkout) [![Data8](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/83d6bb57a4b1806ce858b94b958f5825fe96b43c821c4e1320cc227ab5436dd9.w1600.webp)](https://what3wordsnotion.notion.site/Data8-Integration-Guide-e81f57b4314840f9b70d40d0197b01cd) [![AFD](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2d9cd098e51691453151d836dc0fb2aaebff80554883b8e55ca44bcf3cef8a4e.w1600.webp)](https://what3wordsnotion.notion.site/AFD-what3words-Integration-Guide-7d9ed120a8b54b86a91e759368813971?pvs=4) If you use address validation on your checkout page, please contact us at t[echnology.partnerships@what3words.com](mailto:echnology.partnerships@what3words.com) and our solutions team can explore options with you. ### Option 3 - Delivery Notes ![Checkout Integration - Delivery Notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/af19dc37a6ad930c30e6571eaaa63a54bd424a3fd2cb42aa07efac00c81d5f9e.gif) ### Upgrade your delivery notes to accept what3words addresses This integration upgrades your existing delivery notes free text box, enabling it to detect and validate a what3words address. As normal, customers can enter any extra delivery details as free text but if they start typing a what3words address this is automatically detected and Autosuggest is triggered to help them quickly enter and validate the what3words address. This means what3words addresses ingested from the free text field are pre-validated for onward use by couriers. To upgrade your delivery notes field to accept what3words address, you can read our Notes component tutorial linked below: - [what3words Notes component tutorial](https://developer.what3words.com/tutorial/using-the-notes-component) ## 2. Pass on what3words address for deliveries Now that you’re able to capture what3words addresses on your checkout page, the next step is to ensure these what3words addresses are passed onto your carrier or delivery drivers. ### Retrieval of the what3words address ### How to extract the what3words address from the order data? You will need to extract or isolate the what3words address within the order data to pass it on correctly. - **E-commerce platforms:** For instructions on retrieving what3words addresses from your platform, click the link below and select the e-commerce platform you use. - [Logistics software integration guide](https://docs.google.com/document/d/15H1S-yWY9witpffrecySE7UEK6huVZD-OQ_D7Flpl2w/edit?usp=sharing) - **Bespoke/Self-built e-commerce sites:** See the following guide, which describes how you can use what3words API wrapper functions such as “**IsPossible3wa**”, “**FindPossible3wa**”, “**isValid3wa**”, or the what3words RegEx formulae to detect a what3words address format. Using these tools, you can extract and validate what3words addresses from a bulk of text, so that you can isolate it and pass it forward as required. - [Detecting if the text is in the format of a what3words address using RegEx](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address) ### Delivery to the what3words address ### Does a third party(s) handle your e-commerce deliveries? Assess where your customer-provided address data flows in third-party systems and ensure that what3words is sent to the correct data field. - **Order management systems:** Many order management systems will have a dedicated field for what3words. Check with your account manager or contact us at [Technology.partnerships@what3words.com](mailto:Technology.partnerships@what3words.com) for further support. - **Last mile carriers:** Many last mile carriers have a dedicated field for what3words addresses to be sent, within delivery order creation. Contact your account manager to check, or contact [Technology.partnerships@what3words.com](mailto:Technology.partnerships@what3words.com)  for further support. You can see a full list of our carriers and logistics software partners [here](https://what3words.com/business/what3words-enabled-logistics-carriers-and-software). ### Do you handle your own e-commerce deliveries? Follow these steps if you have your own delivery fleet or handle all e-commerce deliveries yourself. You can retrieve the coordinates for any what3words addresses sent to you by consumers. 1. To retrieve the coordinates for a what3words address, use the `convert-to-coordinates` call of the what3words API. See this guide: [Public API – convert-to-coordinates](https://developer.what3words.com/public-api/docs#convert-to-coords); 2. If you are using a what3words component, the `return_coordinates` parameter may be used for simplicity in retrieving the coordinates; 3. Important notes regarding convert-to-coordinates: - This call type is chargeable – [see available API usage plans here](https://accounts.what3words.com/select-plan); - If you are retrieving coordinates for what3words addresses, the `convert-to-coordinates` call must be executed once for every e-commerce delivery made to a what3words address. This applies even for repeat deliveries to the same what3words address, to comply with what3words T&C’s. ## Contact Support ### Have any questions? We’re here to support you! If you have any questions while using our what3words Regex expressions, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Adding your what3words Ecwid app to your Wix site Adding your what3words Ecwid app to your Wix site. Topics: Ecwid, Wix, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/adding-your-what3words-ecwid-app-to-your-wix-site Updated: 2026-11-27 ### Step by step If you have already an Ecwid store and you have installed the [what3words Ecwid app](https://developer.what3words.com/tutorial/installing-the-what3words-ecwid-app), you can now add your Ecwid store to a Wix website following just a few easy steps. The what3words Ecwid app adds a what3words address field to your store’s checkout page allowing your customers to easily enter and validate a what3words address when placing an order. ## 1. Requirements To add the Ecwid store to your Wix site, you will need to: 1. Have already an [Ecwid Store](https://my.ecwid.com/cp/) and the [what3words Ecwid app](https://www.ecwid.com/apps/featured/what3words) installed; 2. Log in to your [Wix account;](https://www.wix.com) 3. Add the [Ecwid App](https://www.wix.com/app-market/online-store) (also called Online Store) to your Wix site. ## 2. Adding the Ecwid app ![ecwid app to wix](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2e4623263993105ebc0744e3300498d5647d3fa75cb217c99a0283ebf13fc279.png) 1. Log in to your Wix account; 2. Select the site you would like to add a store to; 3. Open [Ecwid App](https://www.wix.com/app-market/online-store). Otherwise, you can find it manually as shown here; 4. Click **Edit site;** 5. Click **Add Apps** on the sidebar; 6. Type “Ecwid” in the search bar, then click on **Online Store** by Ecwid; 7. Click **Add to Site** → **Agree and Add;** 8. Next, you will prompt to head over to the Editor or manage the store from the Dashboard, click **Go to Dashboard**; 9. Then log in to your Ecwid account. Click on **I already have an Ecwid account** link; 10. Click **Connect**. It will Connect your Ecwid store to your Wix site; 11. Grant the app permissions by clicking **Accept**. ![what3words Ecwid app into Wix](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4a3ee1222119c30582a305d7416ace83851f6d38368a94e855b1763883854913.png) That’s it! Your Ecwid store is now connected to your Wix website. And if you have already installed the [what3words Ecwid app](https://developer.what3words.com/tutorial/installing-the-what3words-ecwid-app#requirements) you will see it within your Ecwid **Apps → My Apps**. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f60c951eaf4e7e4a9d79a663684713d085c6dabda3c3462a20b0add6c9ec952d.png) Make sure you can see your Ecwid store on your Wix site. Go to your Wix site and check if you can see a new menu item, **Online Store** added to your menu bar. The Online Store is your Ecwid Store displayed on your Wix site. ## 3. Check if the what3words is appearing ![checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e069db476140ca6c78eb92a5bbed054b3f7808159be2b47da54e770bb62e0032.png) *checkout page* If you have installed the what3words Ecwid app to your Ecwid store correctly a what3words address field should be appearing on your checkout under the shipping address. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible on the order preview and shipping label screens. --- # Android Getting started with the what3words Android API wrapper. Topics: Android, Mobile App, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/android Updated: 2026-11-27 ### Step by step > #### If you are migrating from version 3.x of the Android API Wrapper library, please refer to the [Migration Guide from Version 3.x to 4.x](https://developer.what3words.com/tutorial/migrating-android-api-wrapper-from-version-3-x-to-4-x) for detailed instructions. The Android API wrapper helps developers easily integrate the [what3words API](https://docs.what3words.com/api/v3/) into their Android applications, avoiding the complexity of managing low-level API calls. The what3words API allows conversion between what3words addresses (e.g., ///index.home.raft) and coordinates (e.g., -0.203586, 51.521251). It features powerful autosuggest functions to validate and autocorrect user input, restrict suggestions to specific areas, request sections of the what3words grid as GeoJSON, and list all supported languages. Advanced users can also post-process voice output with autosuggest. All coordinates are in latitude, longitude pairs using the WGS-84 standard, with latitudes ranging from -90 to 90. Full sample app for the wrapper can be found in our Github repo [Android Sample Apps](https://github.com/what3words/w3w-android-samples) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The library is available through [Maven Central](https://search.maven.org/search?q=g:com.what3words). Please add the following to your `gradle.build:` **Android** ```java android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } repositories { mavenCentral() } dependencies { implementation("com.what3words:w3w-android-wrapper:$latest_version") } ``` ## 3. Setup #### Android Manifest Add to `AndroidManifest.xml`: **Android** ```java ``` ## 4. Usage This step-by-step guide demonstrates the usage of the new Android API Wrapper library using Kotlin Coroutines. For a cleaner architecture or a Java example, refer to the [sample app](https://github.com/what3words/w3w-android-samples/tree/main/wrappers-sample). We’ve restructured What3WordsV3 into two distinct classes, each serving specific functions: 1. **W3WApiTextDataSource**: Handles text-based tasks like address searching and conversions. 2. **W3WApiVoiceDataSource**: Specialises in voice-based address suggestions. ## 5. W3WApiTextDataSource The `W3WApiTextDataSource` class facilitates the conversion of coordinates to what3words addresses and vice versa, as well as providing suggestions for slightly incomplete what3words addresses. Create an instance of W3WApiTextDataSource via the factory method: **Android** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, "YOUR_API_KEY") ``` If you are running your own Enterprise Suite API Server, specify the URL to your server: **Android** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, "YOUR_API_KEY", "YOUR_SERVER_ENPOINT") ``` ### Convert Coordinates to what3words Address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `convertTo3wa`, including returned results, is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (lat:`51.222011`, long: `0.152311`): **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... val coordinates = W3WCoordinates("51.222011", "0.152311") val language = W3WRFC5646Language.EN_GB CoroutineScope(Dispatchers.IO).launch { // Run to convert method in Dispatchers.IO val result = textDataSource.convertTo3wa(coordinates, language) //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { Log.d("MainActivity", "what3words address: ${result.value.address}") } } } } } } ``` ### Convert what3words Address to Coordinates This function converts a 3 word address to a position, expressed as coordinates of latitude and longitude. This function takes the words parameter as a string of what3words address e.g.`filled.count.soap` More information about `convertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the coordinates for `///filled.count.soap`: **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... val w3wAddress = "filled.count.soap" CoroutineScope(Dispatchers.IO).launch { val result = textDataSource.convertToCoordinates(w3wAddress) withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { Log.d("MainActivity", "Coordinates: ${result.value.center.lat}, ${result.value.center.lng}") } } } } } } ``` ### AutoSuggest When presented with a what3words address that may be incorrectly entered, AutoSuggest returns a list of potential correct what3wordsaddresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural vs singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `focus` to user’s current location. This will make `autosuggest` return results which are closer to the user. More information about `autosuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Example:** Basic AutoSuggest call **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... val incompletedW3WAddress = "filled.count.so" CoroutineScope(Dispatchers.IO).launch { // Run to auto suggest method in Dispatchers.IO val result = textDataSource.autosuggest(incompletedW3WAddress) //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { if (result.value.isNotEmpty()) { Log.d("MainActivity", "Suggestions: ${result.value.joinToString { it.w3wAddress.address }}") } else { Log.d("MainActivity", "No suggestions found") } } } } } } } ``` ### Get Grid Section Grid Section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `gridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for (`51.222609, 0.152898`) in the south-west, and (`51.222011, 0.152311`) in the north-east: **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... CoroutineScope(Dispatchers.IO).launch { // Run to gridSection method in Dispatchers.IO val result = w3WApiTextDataSource.gridSection( W3WRectangle(W3WCoordinates(51.222609, 0.152898), W3WCoordinates(51.222011, 0.152311))) //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { val gridSection = result.value // Convert to GeoJSON val geoJsonString = gridSection.toGeoJSON() } } } } } } ``` ### Get Available Languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `availableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... CoroutineScope(Dispatchers.IO).launch { // Run to availableLanguages method in Dispatchers.IO val result = textDataSource.availableLanguages() //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { result.value.forEach { Log.d("MainActivity", "languageCode: ${it.code} - locale: ${it.locale}") } } } } } } } ``` ## 6. W3WApiVoiceDataSource The `W3WApiVoiceDataSource` class allows searching for what3words addresses using voice input. Ensure you have a Voice API plan enabled in your account to use this feature. Create a W3WApiVoiceDataSource Instance: **Android** ```kotlin val voiceDataSource = W3WApiVoiceDataSource("YOUR_API_KEY") ``` If you are running your own Enterprise Suite API Server, you can specify the URL to your server: **Android** ```kotlin val voiceDataSource = W3WApiVoiceDataSource("YOUR_API_KEY", "YOUR_SERVER_ENDPOINT") ``` Create a W3WMicrophone instance to handle voice recording: **Android** ```kotlin val microphone = W3WMicrophone() ``` You can set up callbacks to receive information about the recording progress: **Android** ```kotlin microphone.setEventsListener(object : W3WAudioStream.EventsListener { override fun onVolumeChange(volume: Float) { } override fun onError(error: W3WError) { } override fun onAudioStreamStateChange(state: W3WAudioStreamState) { } }) ``` ### Perform Voice AutoSuggest The Voice API AutoSuggest allows the user to say what3words and using speech recognition technology displays what3words address suggestions to the user. Before enabling Voice AutoSuggest you will need to add a Voice API plan in [your account](https://accounts.what3words.com/billing). For a full working example with voice and `AUDIO_RECORD` permission, request check our [sample app](https://github.com/what3words/w3w-android-samples/tree/main/wrappers-sample). **Note:** Please bear in mind that the Android Emulator cannot record audio. Therefore, you will need to test on a real device that can record. **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... val voiceLanguage = W3WRFC5646Language.EN_GB CoroutineScope(Dispatchers.IO).launch { // Perform the Voice AutoSuggest in Dispatchers.IO voiceDataSource.autosuggest( microphone, voiceLanguage, null, // W3WAutosuggestOptions null, // onSpeechDetected ) { result -> //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.IO) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { if (result.value.isNotEmpty()) { Log.d("MainActivity", "Suggestions: ${result.value.joinToString { it.w3wAddress.address }}") } else { Log.d("MainActivity", "No suggestions found") } } } } } } } ``` ## 7. Using AutosuggestHelper Class ### Add what3words AutoSuggest to an existing text field Add the API and helper wherever you make your class variables and be sure to use your [API key](https://what3words.com/select-plan): **Android** ```kotlin val dataSource = W3WApiTextDataSource.create(context, "YOUR_API_KEY_HERE") val autosuggestOptions = W3WAutosuggestOptions.Builder(). .focus(...) .clipToCountry(...) // others options as well .build() val autosuggestHelper = AutosuggestHelper(dataSource).options(autosuggestOptions) ``` Next step is to use a `TextWatcher` (or `doOnTextChanged EditText` extension) and let **AutoSuggestHelper** know about the changed text and add what3words suggestion data to your existing RecyclerView/Adapter. (check sample for complete working example with [custom data model and RecyclerView adapter](https://github.com/what3words/w3w-android-wrapper/blob/master/sample-multi-autosuggest-providers/src/main/java/com/what3words/sample_multi_autosuggest_providers/SuggestionsAdapter.kt) to show different autosuggest sources and [EditText and RecyclerView](https://github.com/what3words/w3w-android-wrapper/blob/master/sample-multi-autosuggest-providers/src/main/java/com/what3words/sample_multi_autosuggest_providers/MainActivity.kt) setup. **Android** ```java editText.doOnTextChanged { text, _, _, _ -> // update options in case of new clippings applying/changing dynamically i.e: Location. autosuggestHelper.options(autosuggestOptions).update( text.toString(), onSuccessListener = { suggestionResults -> suggestionResults.forEach { suggestion -> //Add suggestion to existing RecyclerView adapter list.add(suggestion) Log.i("MainActivity", suggestion.w3wAddress.address) } //notify adapter that there's changes on the data. adapter.notifyDataSetChanged() }, onFailureListener = { //log any errors returned by what3words API. Log.e("MainActivity", it.message) } ) } ``` ### Get the full what3words address once the user has selected a row When user selects a row from the RecyclerView `*autosuggestHelper.selected()*` or `*autosuggestHelper.selectedWithCoordinates()*` should be called to retrieve the full what3words address with or without coordinates. **Note:** that `selectedWithCoordinates()` will convert the what3words address to a lat/lng which will count against your plan’s quota. **Android** ```java autosuggestHelper.selectedWithCoordinates( query.text.toString(), selectedSuggestion, onSuccessListener = { suggestion -> Log.d("MainActivity", "suggestion selected from what3words: ${suggesstion.w3wAddress.address}, lat=${suggestion.w3wAddress.center?.lat} lng=${suggestion.w3wAddress.center?.lng}") }, onFailureListener = { Log.e("MainActivity", it.message) } ) ``` ## 8. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Android** ```java com.what3words.javawrapper.What3WordsV3.isPossible3wa("filled.count.soap") returns true com.what3words.javawrapper.What3WordsV3.isPossible3wa("not a 3wa") returns false com.what3words.javawrapper.What3WordsV3.isPossible3wa("not.3wa address") returns false ``` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ... CoroutineScope(Dispatchers.IO).launch { // Run to gridSection method in Dispatchers.IO val result = w3WApiTextDataSource.isValid3wa("filled.count.soap") //Switch to Dispatcher.Main to update your views with the results if needed withContext(Dispatchers.Main) { when (result) { is W3WResult.Failure -> { Log.e("MainActivity", "Error: ${result.message}") } is W3WResult.Success -> { Log.d("MainActivity", "isValid: ${result.value}") } } } } } } ``` ## 9. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Combining the what3words.js AutoSuggest Component with a Google Map Adding a what3words address to your website with a Google Map. Topics: JavaScript, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Other Map Types](https://developer.what3words.com/docs/display-map/other-map-types.md) Source: https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-google-map Updated: 2026-11-27 ### Step by step The what3words JavaScript API wrapper provides components to make using the what3words API even easier. In this tutorial, we will go through using the autosuggest component in combination with a Google Map. We will add the search field using the component and then respond to its select event to place a pin on the map at the inputted location. You will also need to sign up for a Google Maps developer account and be able to view other Google Maps tutorials at [https://developers.google.com/maps/documentation/javascript/tutorial](https://developers.google.com/maps/documentation/javascript/tutorial). We also have tutorials demonstrating its use with both [Mapbox](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-mapbox-map) and [LeafletJS](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-leafletjs-map). ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Create an HTML page Define an HTML page to create a map that is the full width and height of the web browser window. Add HTML and CSS to create a page with a map element. The `#map` is the element that displays the map and its CSS resets any browser settings, so it can take the full width and height of the browser. The `` tag is not required in CodeSandbox. If you are using a different editor or running the page on a local server, be sure to add this tag to the top of your HTML page. **HTML** ```html Autosuggest Component (Google Map)
``` ## 3. Reference the APIs In the `` tag, add references to the JS library for the Google Maps API and the JavaScript library for what3words API. You’ll need access to the Google Maps API using your own Google Maps API key. You can also attach the what3words API to the window, which is accessible via `window.what3words`, and set a callback function for it, using  `script` tags like the ones in the following example. Don’t forget to set your what3words API key. **Note:** We prefer to use a fixed version for the Production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **HTML** ```html ... // google js library (replace Google API Key) // what3words js library ... ... ``` ## 4. Loading a map using Google Maps Now you can place the map on the page, centered at a location of your choosing. The `#map` in the `` tag will render the map. **JavaScript** ```javascript ``` ## 5. Position the component on the map Determine the position of the component on the map. **CSS** ```css ``` Tie the component to the styling. Ensure you include `
` within the wrapper to display the map. **HTML** ```html
...
``` In a few lines of code, you can have an input box that will call the what3words AutoSuggest API endpoint. The `api_key` parameter contains your application’s API key. Replace `YOUR-API-KEY` with your what3words API key to get started. [Sign up](https://accounts.what3words.com) to obtain your free API key. **HTML** ```html
``` There are a number of ways you can configure the AutoSuggest component to better suit your use case, including clipping to country and custom validation errors. For more on the AutoSuggest component see the [what3words Autosuggest JavaScript Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component). ## 6. Listen for the select event The code snippet below shows how to use an event listener to detect when a user selects a what3words address from the listed suggestions for their input. For debug purposes, it has been added a console log to show how to retrieve the words of the suggestions: **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // console.log(words); }); ... } ``` ## 7. Convert what3words address to coordinates To convert a what3words address to coordinates, users will need to call the what3words API as shown below. They will need to add this code snippet to the `autosuggest` event listener. **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // what3words api call request what3words.api .convertToCoordinates({ words: words, format: "geojson" }) .then(function (response) { console.log("[convertToCoordinates]", response); }); }); } ``` ## 8. Place a map marker Now that the coordinates of the what3words address are retrieved from the above call to the what3words API, users can place a simple map marker on the map and centre the map on its location. **JavaScript** ```javascript ``` ## 9. Full Example The example below takes the concepts described above and turns some of them into a complete example. Here we have an AutoSuggest component place on a map, where we are listening for the select event. We are then using the what3words JavaScript Wrapper’s convert to coordinates functionality to get the coordinates for that address. With those coordinates we then refocus the map and drop a pin on the location selected. **HTML** ```html Autosuggest Component (Google Maps)
``` --- # Combining the what3words.js AutoSuggest Component with a LeafletJS Map Adding a what3words address input to your website with a LeafletJS Map. Topics: JavaScript, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Other Map Types](https://developer.what3words.com/docs/display-map/other-map-types.md) Source: https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-leafletjs-map Updated: 2026-11-27 ### Step by step The JavaScript wrapper for the what3words API provides components to make using the what3words API even easier. In this tutorial, we will show you how to use the AutoSuggest component in combination with a LeafletJS map. We will add the search field using the component and then respond to its select event to place a pin on the map at the inputted location. LeafletJS is an open source mapping engine. More information on LeafletJS can be found at: [https://leafletjs.com/reference-1.5.0.html](https://leafletjs.com/reference-1.5.0.html) We also have tutorials demonstrating its use with both [Mapbox](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-mapbox-map) and [Google Map](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-google-map). [Autosuggest Component (Leaflet)](https://codesandbox.io/s/autosuggest-component-leaflet-c8guh) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Create an HTML page Define an HTML page to create a map that is the full width and height of the web browser window. Add HTML and CSS to create a page with a map element. The `#map` is the element that displays the map and its CSS resets any browser settings, so it can take the full width and height of the browser. The `` tag is not required in CodeSandbox. If you are using a different editor or running the page on a local server, be sure to add this tag to the top of your HTML page. **HTML** ```html Autosuggest Component (Leaflet)
``` ## 3. Reference the APIs In the `` tag, add references to the CSS file and JS library for the LeafletJS API and the JavaScript library for what3words API. You can also attach the what3words API to the window, which is accessible via `window.what3words`, and set a callback function for it, using  `script` tags like the ones in the following example. Don’t forget to set your what3words API key. **Note:** We prefer to use a fixed version for the Production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **HTML** ```html ... // what3words JS library // leaflet JS library // leaflet CSS library ... ... ``` ## 4. Loading a map using LeafletJS Now you can place the map on the page, centered at a location of your choosing. The `#map` in the `` tag will render the map. **JavaScript** ```javascript function initW3w(what3words) { ... let map = L.map("map", { zoomControl: false }).setView( [51.520847, -0.195521], 16 ); L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { attribution: '© OpenStreetMap contributors', maxNativeZoom: 19, maxZoom: 25 }).addTo(map); ... } ``` To Display map navigation controls on the Mapbox map, use `addControl` to add zoom and rotation controls to the map. **JavaScript** ```javascript const nav = new mapboxgl.NavigationControl(); map.addControl(nav, 'bottom-right'); ``` ## 5. Position the component on the map Determine the position of the component on the map. **CSS** ```css ``` Tie the component to the styling. Ensure you include `
` within the wrapper to display the map. **HTML** ```html
...
``` In a few lines of code, you can have an input box that will call the what3words AutoSuggest API endpoint. The `api_key` parameter contains your application’s API key. Replace `YOUR-API-KEY` with your what3words API key to get started. [Sign up](https://accounts.what3words.com) to obtain your free API key. **HTML** ```html
``` There are a number of ways you can configure the AutoSuggest component to better suit your use case, including clipping to country and custom validation errors. For more on the AutoSuggest component see the [what3words AutoSuggest JavaScript Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component). ## 6. Listen for the select event On the code snippet below, it is shown how to use an event listener to detect when a user selects a what3words address from the listed suggestions for their input. For debug purposes, it has been added a console log to show how to retrieve the words of the suggestions: **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // console.log(words); }); ... } ``` ## 7. Convert what3words address to coordinates To convert a what3words address to coordinates, users will need to call the what3words API as shown below. They will need to add this code snippet within the `autosuggest` event listener. **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // what3words api call request what3words.api .convertToCoordinates({ words }) .then(function (response) { console.log("[convertToCoordinates]", response); }); }); } ``` ## 8. Place a map marker Now we have our coordinates we can place a what3words custom marker for our selected what3words address on our map and focus the map on this location. **JavaScript** ```javascript ``` ## 9. Full example The example below takes the concepts described in the step by step guide and turns some of them into a complete example. Here we have an AutoSuggest component place on a map, where we are listening for the select event. We are then using the what3words JavaScript Wrapper’s convert to coordinates functionality to get the coordinates for that address. With those coordinates we then refocus the map and drop a pin on the location selected. **HTML** ```html Autosuggest Component (Leaflet)
``` --- # Combining the what3words.js AutoSuggest Component with a Mapbox Map Adding a what3words address to your website with a Mapbox Map. Topics: JavaScript, Mapbox, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Other Map Types](https://developer.what3words.com/docs/display-map/other-map-types.md) Source: https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-mapbox-map Updated: 2026-11-27 ### Step by step The easiest way to add what3words to your technology is to use one of the what3words components. The following tutorial will demonstrate how to integrate the what3words JavaScript component with Mapbox API. The AutoSuggest Component allows users to quickly and correctly input a what3words address to a form input or search field by providing suggestions as a user types and validation to ensure the input value is a valid what3words address. The component by default uses the what3words API, or can be configured to use a privately hosted instance of the what3words API. Please refer to this tutorial to get more information on how to use the [what3words JavaScript AutoSuggest Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component). To access the Mapbox API, users will need to sign up for a Mapbox developer account and create an API key. If you are new to Mapbox API, start with the [MapBox GL JS API documentation](https://docs.mapbox.com/mapbox-gl-js/api/). We also have tutorials demonstrating its use with both [LeafletJS](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-leafletjs-map) and [Google Map](https://developer.what3words.com/tutorial/combining-the-what3words-js-autosuggest-component-with-a-google-map). [Autosuggest Component (Mapbox)](https://codesandbox.io/s/autosuggest-component-mapbox-sdh68) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Create an HTML page Define an HTML page to create a map that is the full width and height of the web browser window. Add HTML and CSS to create a page with a map element. The `#map` is the element that displays the map and its CSS resets any browser settings, so it can take the full width and height of the browser. The `` tag is not required in CodeSandbox. If you are using a different editor or running the page on a local server, be sure to add this tag to the top of your HTML page. **HTML** ```html Autosuggest Component (Mapbox)
``` ## 3. Reference the APIs In the `` tag, add references to the CSS file and JS library for the Mapbox API and the JavaScript library for what3words API. The CSS file is required to display the map and make elements like Popups and Markers work. You can also attach the what3words API to the window, which is accessible via `window.what3words`, and set a callback function for it, using  `script` tags like the ones in the following example. Don’t forget to set your what3words API key. **Note:** We prefer to use a fixed version for the Production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **HTML** ```html ... // mapbox js library // what3words js library // mapbox css file ... ... ``` ## 4. Loading a map using Mapbox Now you can place the map on the page, centered at a location of your choosing. The `#map` in the `` tag will render the map. **JavaScript** ```javascript function initW3w(what3words) { ... mapboxgl.accessToken = YOUR_MAPBOX_ACCESS_TOKEN; const map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v9', center: [-0.195499, 51.52086], zoom: 12 }); ... } ``` To Display map navigation controls on the Mapbox map, use `addControl` to add zoom and rotation controls to the map. **JavaScript** ```javascript const nav = new mapboxgl.NavigationControl(); map.addControl(nav, 'bottom-right'); ``` ## 5. Position the component on the map Determine the position of the component on the map. **CSS** ```css html, body, #map { position: absolute; height: 100%; width: 100%; margin: 0; padding: 0; } #autosuggest { position: absolute; top: 10px; left: 10px; z-index: 100; } #wrapper { position: relative; height: 100%; } ``` Tie the component to the styling. Ensure you include `
` within the wrapper to display the map. **HTML** ```html
...
``` In a few lines of code, you can have an input box that will call the what3words AutoSuggest API endpoint. The `api_key` parameter contains your application’s API key. Replace `YOUR-API-KEY` with your what3words API key to get started. [Sign up](https://accounts.what3words.com) to obtain your free API key. **HTML** ```html
``` ## 6. Listen for the select event The code snippet below shows how to use an event listener to detect when a user selects a what3words address from the listed suggestions for their input. For debug purposes, it has been added a console log to show how to retrieve the words of the suggestions: **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // console.log(words); }); ... } ``` ## 7. Convert what3words address to coordinates To convert a what3words address to coordinates, users will need to call the what3words API as shown below. They will need to add this code snippet within the `autosuggest` event listener. **JavaScript** ```javascript function initW3w(what3words) { ... let words; const autosuggest = document.getElementById("autosuggest"); autosuggest.addEventListener("selected_suggestion", (value) => { let words = value.detail.suggestion.words; // what3words api call request what3words.api .convertToCoordinates({ words: words, format: "geojson" }) .then(function (response) { console.log("[convertToCoordinates]", response); }); }); } ``` ## 8. Place a map marker Now that the coordinates of the 3 words address are retrieved from the above call to the what3words API, users can place a simple map marker on the map and centre the map on its location. **JavaScript** ```javascript ``` Add a marker element to the CSS code snippet within the ``. **CSS** ```css .marker { background-image: url("https://what3words.com/map/marker.png"); background-size: cover; width: 64px; height: 64px; cursor: pointer; } ``` ## 9. Full example The example below takes the concepts described in the step by step guide and turns some of them into a complete example. Here we have an AutoSuggest component place on a map, where we are listening for the select event. We are then using the what3words JavaScript Wrapper’s convert to coordinates functionality to get the coordinates for that address. With those coordinates we then refocus the map and drop a pin on the location selected. **HTML** ```html Autosuggest Component (Mapbox)
``` --- # Configuring Geocortex Essentials to use what3words Adding the what3words service to Geocortex Essentials. Topics: Geocortex, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) Source: https://developer.what3words.com/tutorial/configuring-geocortex-essentials-to-use-what3words Updated: 2026-11-27 what3words can be integrated as a geocoding service within [Geocortex Essentials](https://www.geocortex.com/products/geocortex-essentials/). Adding the what3words ArcGIS Locator functions just as any other geocode service within the Geocortex Essentials application allowing you to discover what3words addresses or search for a what3words address. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Open Geocortex Essentials Manager ![Essentials Manager Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/589b1eba0e49c2478aefcd57dc9c4a366b6f18bfd8b2091dd54174651ffa97ca.png) Open your Site in Geocortex Essentials Manager and navigate to the Geocoding tab of GIS Services ## 3. Add a Geocoding Service ![Service Type Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/245e1da8ce60699658c2e27bdd1950cb40de975cb4a7eea1cb84e06230a1938c.png) Select the ArcGIS Geocoding Service type ![Service Name Screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c49715e52974f0a811cafb2fc6be9d823538f90ab2ed698714bffb3ee3ce24d6.png) Enter an appropriate display name for the service ![Token security screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5cfd67c500e433fb1b41d7d533ccf75f5b05492a11deb2e9e256766e93019bdd.png) Enter an appropriate display name for the service Populate the service URL, Username, and Password field. **URL:** `https://arcgis.what3words.com/v2/arcgis/rest/services` **Username:** Email address you used to create a what3words API key **Password:** your what3words API key. ![Geocoding Service selection screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/970b90d2a8920133e7d74b26c6bb30893fef10b32851aa0c6275078c4505aa8a.png) Select the service name from the list with the language required. ![default service screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e9ba5b72563ea455ec1f59b63bac0d32ae9b585717c87d52e0ce563bd940432a.png) You can now configure your new what3words geocode service to be the default geocode service. ![global search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/fb7bdfe61e703df988c59cce4fe0a0ada5bcc6f777ded3dd39ebb77aae5950a2.png) Click “Include in Global Search:” to use within the Global Search ## 4. Using the service ![What3Words right-click reverse geocode result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/402e9bc773cf8c161e64db0fcbb0c90a8d410d2642ac5d96e5af3f6f0717ab66.jpg) Find out the what3words address for a location through the right-click context window. ![Geocortex geocode search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b22c9e8581c2c67ce22719a63de67f35a6dbb74c05c3704e2a9c8e481bb18c80.jpg) Find a what3words address through the search ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). If you have an issue with displaying the what3words geocoding system on GeoCortex Essentials, it could be that the token of the what3words ArcGIS geocoding service has expired since, by default, GeoCortex Essentials assumes the token duration of all your ArcGIS services is 60 minutes, which is the ArcGIS default. However, if the token duration of any of your ArcGIS services is shorter, you must specify the token duration in Essentials. Here is a [tutorial](https://docs.vertigisstudio.com/essentials/latest/admin-help/Default.htm#ge/admin/geocoding-services.htm) in GeoCortex Essential that explains how to specify the token duration. You can also follow these steps to update the token duration of your what3words ArcGIS geocoding service: 1. Open the Essentials `web.config file` 2. In the `appSettings` element, add a new add element. 3. Add a key attribute to `appSettings` and set it to `ArcGisRestMapServiceBase.MaximumTokenDuration`. 4. Add a value attribute to `appSettings` and set it to the maximum token duration in minutes. For example, to set the maximum token duration to 5 minutes: `` **Note:** It was tested that reducing the `MaximumTokenDuration` to 5 minutes can help to retrieve the token faster and avoids any interruptions in your current workflow. --- # C++ The C++ API wrapper provides a synchronous, type-safe way to use the [what3words Public API](https://developer.what3words.com/public-api/docs) from C++17 applications, without managing HTTPS requests or response parsing yourself. Topics: C++, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/cpp Updated: 2026-11-27 This wrapper calls the hosted Public API. It is separate from the offline C++ Core SDK and does not require an Enterprise Suite installation. A full example of how to integrate the what3words C++ wrapper is available in our [C++ Github repository](https://github.com/what3words/w3w-cpp-wrapper) ## 1. Requirements Use a supported C++17 compiler and CMake to add the wrapper to your application. | | | | --- | --- | | C++17 | MSVC 2019+, GCC 9+, Clang 10+, or supported Apple Clang | | CMake | CMake 3.20 or newer | | Git | Required for FetchContent and source builds | | Dependencies | libcurl and nlohmann/json | CMake can fetch missing dependencies for FetchContent and standalone source builds. The repository also provides a `vcpkg.json` manifest. An installable CMake package requires an installed libcurl. The fully system-resolved install recipe below disables dependency fetching, so it also requires nlohmann/json as an installed CMake dependency. ## 2. Installation ### CMake FetchContent Add the wrapper directly to an application with CMake `FetchContent`: **CMake** ```cmake include(FetchContent) FetchContent_Declare( what3words_api GIT_REPOSITORY https://github.com/what3words/w3w-cpp-wrapper GIT_TAG v1.0.0 ) FetchContent_MakeAvailable(what3words_api) target_compile_features(your-target PRIVATE cxx_std_17) target_link_libraries(your-target PRIVATE what3words::api) ``` Use an immutable released version so that later wrapper changes cannot break an existing application build. The wrapper also exports its C++17 requirement, but declaring the application target’s requirement makes the project contract explicit. ### Build the wrapper source Clone the released source before using the standalone build commands: **Shell** ```shellscript git clone https://github.com/what3words/w3w-cpp-wrapper what3words-api-cpp cd what3words-api-cpp ``` Static libraries are built by default. Add `-DBUILD_SHARED_LIBS=ON` for a shared library. On Windows, place the wrapper and libcurl DLLs beside the consuming executable or on `PATH`. #### Windows with vcpkg Configure with the vcpkg toolchain so that the manifest supplies libcurl and nlohmann/json: **PowerShell** ```powershell cmake -S . -B build ` -A x64 ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ` -DW3W_BUILD_TESTS=OFF ` -DW3W_BUILD_EXAMPLES=ON cmake --build build --config Release ``` #### Linux and macOS Use GCC, Clang or Apple Clang with a single-configuration CMake build. On Linux, install the distribution’s TLS development package first if CMake will fetch libcurl. **Shell** ```shellscript cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ -DW3W_BUILD_TESTS=OFF \ -DW3W_BUILD_EXAMPLES=ON cmake --build build ``` ### Install and consume the CMake package Only fetching libcurl disables installation; fetching nlohmann/json alone is compatible with the install rules. The fully system-resolved recipe below is for Linux and macOS. It disables dependency fetching, chooses an installation prefix, then installs the wrapper: **Shell** ```shellscript cmake -S . -B build-install \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/your/prefix \ -DW3W_FETCH_DEPENDENCIES=OFF \ -DW3W_BUILD_TESTS=OFF \ -DW3W_BUILD_EXAMPLES=OFF cmake --build build-install cmake --install build-install ``` On Windows, use the vcpkg toolchain from the earlier build and pass the Release configuration to both build and install: **PowerShell** ```powershell cmake -S . -B build-install ` -A x64 ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ` -DCMAKE_INSTALL_PREFIX="$PWD/stage" ` -DW3W_FETCH_DEPENDENCIES=OFF ` -DW3W_BUILD_TESTS=OFF ` -DW3W_BUILD_EXAMPLES=OFF cmake --build build-install --config Release cmake --install build-install --config Release ``` The consuming build must also be able to resolve CURL. Add the installed wrapper to the application with: **CMake** ```cmake find_package(what3words-api 1.0 CONFIG REQUIRED) target_compile_features(your-target PRIVATE cxx_std_17) target_link_libraries(your-target PRIVATE what3words::api) ``` When using a custom installation prefix, configure the consuming application with `-DCMAKE_PREFIX_PATH=/your/prefix` on Linux/macOS or `-DCMAKE_PREFIX_PATH="$PWD/stage"` on Windows. Alternatively, set `what3words-api_DIR` to the directory containing `what3words-api-config.cmake`. If libcurl is fetched during a standalone build, install rules are disabled because the resulting dependency graph cannot be exported as a relocatable package. `FetchContent` and `add_subdirectory` consumption continue to work normally. ## 3. Setup an API key Create an API key through the [what3words developer portal](https://accounts.what3words.com/). In the examples below, replace `"your API key here"` with your API key. > [!WARNING] > **Keep API keys out of source control.** The inline value keeps the examples concise. Do not commit or distribute source containing a real production key. The wrapper sends the key in the X-Api-Key header and prevents additional headers from replacing it. ## 4. Quick start The following complete program creates a client and converts a what3words address to latitude and longitude: **C++** ```cpp #include #include #include #include #include int main() { try { const what3words::Client client("your API key here"); const auto result = client.convert_to_coordinates("filled.count.soap"); std::cout << std::fixed << std::setprecision(6) << result.coordinates.lat << ", " << result.coordinates.lng << '\n'; return 0; } catch (const what3words::ApiError& error) { std::cerr << error.code() << ": " << error.api_message() << '\n'; } catch (const what3words::Error& error) { std::cerr << error.what() << '\n'; } return 2; } ``` Expected output: > 51.520847, -0.195521 The remaining C++ fragments assume the configured `client` and standard-library headers established by Quick start. `` and `` are included in the complete setup because later timeout and GeoJSON fragments use them. ### Configure timeouts and client identity Defaults are 5 seconds for connection and 10 seconds for a request. Set non-default values before constructing the client. **C++** ```cpp what3words::ClientConfig config; config.api_key = "your API key here"; config.connect_timeout = std::chrono::seconds{3}; config.request_timeout = std::chrono::seconds{15}; config.user_agent = "your-application/1.0"; const what3words::Client client(config); ``` > [!NOTE] > **Thread safety.** The default client can be called concurrently: configuration is immutable and each request uses its own libcurl easy handle. ## 5. API operations ### convert_to_3wa / convert_to_3wa_geojson ### Convert coordinates to a what3words address Find the what3words address for `51.520847, -0.195521`: **C++** ```cpp const auto address = client.convert_to_3wa( {51.520847, -0.195521}, what3words::ConvertTo3waOptions{}.language("en") ); std::cout << "///" << address.words << '\n'; ``` ### convert_to_coordinates / convert_to_coordinates_geojson ### GeoJSON Use the dedicated type-safe GeoJSON methods for conversions and grid sections. GeoJSON point coordinates are ordered as `[longitude, latitude]`: **C++** ```cpp const auto geojson = client.convert_to_coordinates_geojson( "filled.count.soap" ); const auto& point = std::get( geojson.features.front().geometry.coordinates ); std::cout << point[1] << ", " << point[0] << '\n'; // latitude, longitude ``` ### autosuggest / autosuggest_with_coordinates ### AutoSuggest with country clipping Improve results by clipping suggestions to relevant countries using two-letter country codes: **C++** ```cpp const auto options = what3words::AutosuggestOptions{} .clip_to_countries({"GB", "DE"}) .number_of_results(3); const auto response = client.autosuggest("filled.count.so", options); for (const auto& suggestion : response.suggestions) { std::cout << "///" << suggestion.words << '\n'; } ``` ### AutoSuggest with coordinates Use `autosuggest_with_coordinates` when each suggestion also needs coordinates, its three-metre square and its map URL: **C++** ```cpp const auto options = what3words::AutosuggestOptions{} .clip_to_countries({"GB"}) .number_of_results(3); const auto response = client.autosuggest_with_coordinates( "filled.count.so", options ); for (const auto& suggestion : response.suggestions) { std::cout << "///" << suggestion.words << ": " << suggestion.coordinates.lat << ", " << suggestion.coordinates.lng << '\n'; } ``` ### grid_section / grid_section_geojson ### Grid section Retrieve the what3words grid lines for a bounding box that is no more than 4 km from corner to corner: **C++** ```cpp const what3words::BoundingBox bounds{ {52.207988, 0.116126}, // southwest {52.208867, 0.117540} // northeast }; const auto grid = client.grid_section(bounds); for (const auto& line : grid.lines) { std::cout << line.start.lat << "," << line.start.lng << " -> " << line.end.lat << "," << line.end.lng << '\n'; } ``` ### available_languages ### Available languages List each currently supported language using its code, English name and native name: **C++** ```cpp const auto response = client.available_languages(); for (const auto& language : response.languages) { std::cout << language.code << " - " << language.name << " - " << language.native_name << '\n'; } ``` ## 6. RegEx functions These helpers can detect text that looks like a what3words address before making an API request: **C++** ```cpp const bool possible = what3words::is_possible_3wa("///filled.count.soap"); const auto matches = what3words::find_possible_3wa( "Meet at filled.count.soap" ); const bool looks_mistyped = what3words::did_you_mean("filled count soap"); // Makes an AutoSuggest API request to verify the address const bool valid = client.is_valid_3wa("filled.count.soap"); std::cout << std::boolalpha << "Possible format: " << possible << '\n' << "Matches found: " << matches.size() << '\n' << "Looks mistyped: " << looks_mistyped << '\n' << "Valid address: " << valid << '\n'; ``` > [!NOTE] > **Format is not validity.** `is_possible_3wa` runs locally and checks only the text format. Use `is_valid_3wa` to verify that an address exists. See [Detecting if text is in the format of a what3words address using RegEx](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address) for the C++ expressions. ## 7. Error handling The wrapper exposes specific error types for configuration, transport, API, HTTP and response parsing failures. | Error | When it is used | | --- | --- | | InvalidArgumentError | Locally invalid coordinates, options or configuration | | TransportError | DNS, connection, timeout or TLS failure | | ApiError | A structured what3words API error with HTTP status, code and message | | HttpError | A non-success HTTP response without a structured API error | | ParseError | A successful response that does not match the expected contract | **C++** ```cpp try { const auto result = client.convert_to_coordinates("filled.count.soap"); std::cout << "///" << result.words << '\n'; } catch (const what3words::ApiError& error) { std::cerr << error.status_code() << " " << error.code() << ": " << error.api_message() << '\n'; } catch (const what3words::TransportError& error) { std::cerr << "Network error: " << error.what() << '\n'; } catch (const what3words::Error& error) { std::cerr << error.what() << '\n'; } ``` Endpoint availability and quotas depend on the API plan associated with the key. > [!NOTE] > **HTTP 402 responses.** An HTTP 402 response can indicate that a feature is unavailable on the current plan or that a plan quota has been exceeded. A structured response is surfaced as `ApiError`. --- # Creating an Android AutoSuggest edittext field with the what3words AutoSuggest Component Adding a 3 word address edittext field with AutoSuggest to an Android App Topics: Android, Java, Mobile App Section: [Search Box](https://developer.what3words.com/docs/search-box.md) Source: https://developer.what3words.com/tutorial/creating-an-android-autosuggest-edittext-box-with-what3words-autosuggest-component Updated: 2026-11-27 ### Step by step The what3words Android AutoSuggest Component provides an easy way of adding a what3words EditText field to an Android app. The component allows the user to enter a 3 word address, providing AutoSuggest suggestions whilst typing and error correction to ensure accurate entries. The component is straightforward to use and can be configured using a range of properties. The component uses the what3words API or alternatively can be configured to use our [Enterprise Suite API Server](https://developer.what3words.com/enterprise-suite/api-server). Full sample apps for the component can be found in our Github repo [Android Sample Apps](https://github.com/what3words/w3w-android-samples) Find out how else you can utilise the what3words API in your app by taking a look at the [what3words Android API Wrapper.](https://developer.what3words.com/tutorial/android/) **Minimum supported OS version:** 6.0 (API level 23) ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4459aeb6977c08a0333d6648ef90c97b093bfae827cf8408c1d61e73a3ddee47.gif) Getting started with Mani, what3words Head of Android Developer, on [How to create an AutoSuggest Edittext with Kotlin](http://youtu.be/xY-gac5Cur0) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The artifact is available through [Maven Central](https://search.maven.org/artifact/com.what3words/w3w-android-components). **Gradle** ```groovy implementation 'com.what3words:w3w-android-components:3.1.3' ``` ## 3. Usage Take a look at this repository for samples of how to use the component and some of its more advanced features. [Android Component](https://github.com/what3words/w3w-android-components) The following should be included in AndroidManifest.xml: **XML** ```xml ``` Add the following to build.gradle (app level): **Gradle** ```groovy compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ``` The following should be included in activity\_main.xml: **XML** ```xml ``` ### Adding the component Replace `YOUR_API_KEY_HERE` with your what3words API key. For each `suggestion` it is possible to obtain the 3 word address (`words`) and other characteristics such as `country`, `latitude` and `longitude` (if `returnCoordinates` has been specified). **Kotlin** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) suggestionEditText.apiKey("YOUR_API_KEY_HERE") .returnCoordinates(false) .onSuggestionSelected { suggestion -> if (suggestion != null) { Log.i( "MainActivity","words: ${suggestion.words}, country: ${suggestion.country}, distance: ${suggestion.distanceToFocusKm}, near: ${suggestion.nearestPlace}, latitude: ${suggestion.coordinates?.lat}, longitude: ${suggestion.coordinates?.lng}") } else { Log.i("MainActivity", "invalid w3w address") } } .onError { error -> Log.e("MainActivity", "${error.key} - ${error.message}") } } ``` **Java** ```java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); W3WAutoSuggestEditText autoSuggestEditText = findViewById(R.id.suggestionEditText); autoSuggestEditText.apiKey("YOUR_API_KEY_HERE") .returnCoordinates(false) .onSuggestionSelected(null, null, (SuggestionWithCoordinates suggestion) -> { if (suggestion != null) { Log.i("MainActivity", String.format("words: %s, country: %s, near: %s", suggestion.getWords(), suggestion.getCountry(), suggestion.getNearestPlace())); } else { Log.i("MainActivity", "invalid w3w address"); } }) .onError(null, (APIResponse.What3WordsError what3WordsError) -> Log.e("MainActivity", String.format("%s - %s", what3WordsError.getKey(), what3WordsError.getMessage()))); } ``` ### Enterprise Suite API Server If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server like so: **Kotlin** ```kotlin autoSuggestEditText.apiKey("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` **Java** ```java autoSuggestEditText.apiKey("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` ### Enable voice autosuggest ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5d4d0ad8ccd28fcc3623bae82ce33b6053b9e1abb51357f88cf918076cac6be1.w1600.webp) The component also allows for voice input using the what3words Voice API. This feature allows the user to say 3 words and using speech recognition technology displays 3 word address suggestions to the user. Before enabling Voice AutoSuggest you will need to add a Voice API plan in [your account](https://accounts.what3words.com/billing). By default the voice language is set to English but this can be changed using the voiceLanguage property (for list of available languages please check the properties table below). Voice input respects the clipping and focus options applied within the general properties. We recommend applying clipping and focus where possible to display as accurate suggestions as possible. To enable voice you can do with programmatically or directly in the XML. The following should be included in AndroidManifest.xml: **XML** ```xml ... ``` The following should be included in activity\_main.xml: **XML** ```xml ``` or MainActivity.kt / MainActivity.java **Kotlin** ```kotlin suggestionEditText.apiKey("YOUR_API_KEY_HERE") .returnCoordinates(false) .voiceEnabled(true) ... ``` ### Advanced usage: properties There are a range of customisation properties you can use to configure the AutoSuggest Component. | Parameter | Default value | Type | Description | XML | Programatically | | --- | --- | --- | --- | --- | --- | | apiKey | N/A | string | Your what3words API key. (mandatory) | | Yes | | hint | e.g. lock.spout.radar | String | Placeholder text to display in the input in its default empty state. | Yes | Yes | | errorMessage | An error occurred. Please try again later | String | Overwrite the generic error message with a custom value. | Yes | Yes | | invalidAddressMessage | No valid what3words address found | String | Overwrite the validation error message with a custom value. | Yes | Yes | | focus | N/A | Coordinates | This is a location, specified as a latitude/longitude (often where the user making the query is). If specified, the results will be weighted to give preference to those near the \`focus\` | | Yes | | clipToCountry | N/A | String | Clip results to a given country or comma separated list of countries. Example value:"GB,US". | | Yes | | clipToCircle | N/A | Coordinates, Int | Clip results to a circle, specified by Coordinate(lat,lng) and kilometres, where kilometres in the radius of the circle. | | Yes | | clipToBoundingBox | N/A | BoundingBox | Clip results to a bounding box specified using co-ordinates. | | Yes | | clipToPolygon | N/A | List of Coordinates | Clip results to a bounding box specified using co-ordinates. | | Yes | | allowInvalid3wa | false | Boolean | By default the EditText field will clear an inputted value if a valid 3 word address is not entered. Setting allowInvalid3wa to true stops this behaviour and the value is persisted in the EditText. | | Yes | | returnCoordinates | false | Boolean | Calls the what3words API to obtain the coordinates for the selected 3 word address (to then use on a map or pass through to a logistic company, etc) | Yes | Yes | | displayUnit | DisplayUnits.SYSTEM | DisplayUnits | Set end-user display unit, DisplayUnits.SYSTEM (default), DisplayUnits.METRIC, DisplayUnits.IMPERIAL | Yes | Yes | | allowFlexibleDelimiters | false | Boolean | Allow EditText to accept different delimiters than the what3words standard full stop "index.home.raft", i.e "index home raft" or "index,home,raft". | Yes | Yes | Voice properties: | Property | Default value | Type | Description | XML | Programatically | | --- | --- | --- | --- | --- | --- | | voiceEnabled | false | Boolean | Enables voice suggestion to allow the user to say the three word address instead of writing it. | Yes | Yes | | voiceLangauge | en | String | Available voice languages: ar for Arabic, cmn for Mandarin Chinese, de for German, en for Global English (default), es for Spanish, hi for Hindi, ja for Japanese and ko for Korean | Yes | Yes | ## 4. Styling Use our base style as parent and you can set the custom properties available with XML on the table above and the normal EditText styling, i.e: **XML** ```xml ``` ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Creating an AutoSuggest input box with what3words.js (v3.1 – deprecated) Adding a 3 word address input box with AutoSuggest in just two lines of code (deprecated) Topics: JavaScript, Website Source: https://developer.what3words.com/tutorial/creating-an-autosuggest-input-box-with-what3words-js Updated: 2026-11-27 ### Step by step **Please note this version of the component has been deprecated. The new version of the component can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component)** The what3words API JavaScript Wrapper provides components to make the what3words API even easier to use. These components can be added to any site using JavaScript and HTML. In this tutorial, you’ll learn how to use a component from the wrapper. This will allow a user to get a search input for their page, powered by the Autosuggest function of the what3words API. The wrapper is straightforward to use and you can configure it for your needs using a range of properties. Find out how else you can utilise the what3words API using JavaScript by taking a look at the [**what3words JavaScript API Wrapper**](https://docs.what3words.com/wrapper/javascript/) [AutoSuggest Component](https://codesandbox.io/s/autosuggest-component-gm3z2) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation **Please note this version of the component has been deprecated. The new version of the component can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component)** To load the what3words JavaScript API wrapper, use a `script` tag like the one in the following example: **JavaScript** ```javascript ``` The URL in the `script` tag is the location of a JavaScript file that loads everything you need for using the what3words API in JavaScript. The `key` parameter contains your application’s API key. ## 3. Usage In one line, you can have an input box that will call the what3words API AutoSuggest endpoint. Code example: **HTML** ```html ``` ### Available properties There are a range of customisation properties you can use to configure the AutoSuggest component. | Parameter | Type | Description | | --- | --- | --- | | placeholder | string | default text to display. Example value:"e.g lock.spout.radar" | | autosuggest-focus | string | comma separated lat/lng of point to focus on. Example value:"51.521251,-0.203586" | | n-focus-results | number | the number of results within what is returned to apply the focus to. Example value:"2" | | clip-tp-country | string | confine results to a given country or comma separated list of countries. Example value:"GB,US" | | clip-to-bounding-box | string | Confine results to a bounding box specified using co-ordinates. Example value:"51.521,-0.343,52.6,2.3324" | | clip-to-circle | string | Restrict AutoSuggest results to a circle, specified by lat,lng,kilometres, where kilometres in the radius of the circle. For convenience, longitude is allowed to wrap around 180 degrees. For example 181 is equivalent to -179. | | clip-to-polygon | string | Restrict AutoSuggest results to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs. Example value:"51.521,-0.343,52.6,2.3324,54.234,8.343,51.521,-0.343" | | error-message | string | overwrite the validation error message with a custom value. Example value:"you have entered an invalid address" | | return-coordinates | boolean | Calls the what3words API to obtain the coordinates for the selected 3 word address | ### placeholder Set the default text appearing in the input box. We recommend adding e.g. in front of a 3 word address so the user can see the text is an example only. **HTML** ```html ``` ### autosuggest-focus / n-focus-results These two properties work in combination. User `autosuggest-focus` to define a lat/lng around which to apply a focus to your results. `n-focus-results` then determines the number of results returned to which this focus get applied. **HTML** ```html ``` ### clip-to-country Restrict results to a given country or comma separated list of countries **HTML** ```html ``` ### clip-to-bounding-box Restrict results to a bounding box specified using co-ordinates **HTML** ```html ``` ### clip-to-circle Restrict AutoSuggest results to a circle, specified by lat,lng,kilometres, where kilometres in the radius of the circle. For convenience, longitude is allowed to wrap around 180 degrees. For example, 181 is equivalent to -179. **HTML** ```html ``` ### clip-to-polygon Restrict AutoSuggest results to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs. **HTML** ```html ``` ### validation Turn off validation, it is on by default **HTML** ```html ``` ### Enterprise Suite API Server If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server by appending the `baseUrl` parameter to the `script` **HTML** ```html ``` ### debug Turn on debug information to console, it is off by default **HTML** ```html ``` ### error-message Return custom error message for 3 word address validation **HTML** ```html ``` ### Returning coordinates If you would like to return coordinates for a 3 word address to plot on a map then you can request a call is made to the what3words API. Add a listener to the select event to obtain the value and use within your application. **HTML** ```html ``` **JavaScript** ```javascript document.querySelector('what3words-autosuggest') .addEventListener("select", ({target}) => { console.log(target.coordinatesLng) console.log(target.coordinatesLat) }) ``` ### Listening for events Listen for either the `change` or `valid` events This requires debugging to be enabled and we are giving the component an id to reference when listening for the event **HTML** ```html ``` **JavaScript** ```javascript const input = document.getElementById("autosuggest"); input.addEventListener("select", (value) => { console.log("[EVENT:select]", value.detail); }); ``` ### Full example Below, we’ve taken the concepts described and turned some into a complete example. This includes a placeholder, expanding results to five, clipping to Great Britain and the United States, outputting debug to console, using a custom error message for the validation and looking for the valid event and outputting that to the console. **JavaScript** ```javascript w3w JavaScript Autosuggest Tutorial

``` --- # Creating an AutoSuggest text field with Objective-C Adding a 3 word address textfield with an AutoSuggest tableview dropdown Topics: Objective-C, Mobile App Source: https://developer.what3words.com/tutorial/creating-an-autosuggest-text-field-with-objective-c Updated: 2026-11-27 ### Step by step The Objective-C library provides UITexfield component to make using the what3words API even easier. In this tutorial we will go through using a component from the wrapper which allows the developer to add a search input to their app, powered by the what3words API AutoSuggest function. As you will see it is straightforward to use and allows you to configure it for your needs using a range of properties. Full sample apps for the component can be found in our Github repo [iOS Sample Apps](https://github.com/what3words/w3w-swift-samples) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation You can use [CocoaPods](http://cocoapods.org/) to install `w3w-objectivec-wrapper`by adding it to your `Podfile`: ### CocoaPods (iOS 8+, OS X 10.10+) **Objective-C** ```objective-c platform :ios, '10.0' use_frameworks! target 'MyApp' do pod 'W3wSuggestionField', :git => 'https://github.com/what3words/w3w-autosuggest-textfield-objectivec.git' end ``` ## 3. Usage Add the following import statement to the class **Objective-C** ```objective-c #import ``` Select `ViewController.m` and add the following code to the class **Objective-C** ```objective-c @property (weak, nonatomic) IBOutlet W3wTextField *suggestionField; ``` Now, open Main.storyboard and drag a `UITextfield` to the screen from the Object library. In the Identity Inspector change the custom class to `W3wTextField`. The last thing to do is to connect the action to the button. Click the yellow View Controller icon in the View Controller scene. From the Connections Inspector (last tab on the right sidebar), click and drag the open circle next to `suggestionField` to newly created `UITextfield` in the storyboard. Initialize the API by placing the following code into the `-viewDidLoad` method **Objective-C** ```objective-c [self.suggestionField setAPIKey:@""]; ``` To get selected 3 word address from dropdown menu, add the following code to the `ViewController.m` class **Objective-C** ```objective-c [self.suggestionField didSelect:^(NSString *selectedText) { NSLog(@"Three word address: %@", selectedText); }]; ``` ### Available properties There are a range of customisation properties you can use to configure the AutoSuggest component. | Parameter | Type | Description | | --- | --- | --- | | autoFocus | string | comma separated lat/lng of point to focus on. Example value:"51.521251,-0.203586" | | clipToCountry | string | confine results to a given country or comma separated list of countries. Example value:"GB,US" | | clipToBoundingBox | string | Confine results to a bounding box specified using co-ordinates. Example value:"51.521,-0.343,52.6,2.3324" | | clipToCircle | string | Restrict AutoSuggest results to a circle, specified by lat,lng,kilometres, where kilometres in the radius of the circle. For convenience, longitude is allowed to wrap around 180 degrees. For example 181 is equivalent to -179. | | clipToPolygon | string | Restrict AutoSuggest results to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs. Example value:"51.521,-0.343,52.6,2.3324,54.234,8.343,51.521,-0.343" | ## 4. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Creating an AutoSuggest text field with Swift Adding a 3 word address textfield with AutoSuggest functionality to an iOS app. Topics: Swift, Mobile App Section: [Search Box](https://developer.what3words.com/docs/search-box.md) Source: https://developer.what3words.com/tutorial/creating-an-autosuggest-text-field-with-swift Updated: 2026-11-27 ### Step by step The Swift library provides UITexfield component to make using the what3words API even easier. In this tutorial, we will go through using a component from the wrapper which allows the user to get a search input for their app, powered by the what3words API AutoSuggest function. As you will see it is straightforward to use and allows you to configure it for your needs using a range of properties. Note: This tutorial uses Swift. If you’re working in Objective-C, follow the [Objective-C tutorial here](https://developer.what3words.com/tutorial/creating-an-autosuggest-text-field-with-objective-c). The `W3WAutoSuggestTextField` is derived from `UITextField` iOS component. Full sample apps for the component can be found in our Github repo [iOS Sample Apps](https://github.com/what3words/w3w-swift-samples) Getting started with Dave, what3words iOS Developer, showing you how to create an AutoSuggest text field with Swift: [https://youtu.be/leMbLqJOrD0](https://youtu.be/leMbLqJOrD0) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ### Updated Package Structure We’ve made changes to our Swift packages to provide more flexibility. Here’s what you need to know: ***1\. Separate Voice Package (w3w-swift-voice-api):*** If your application only requires what3words voice functionality, you can now import the voice package independently by including `w3w-swift-voice-api` in your project. This reduces unnecessary dependencies if you don’t need the full API wrapper. ***2\. Backwards Compatibility:*** The newest version of the w3w-swift-wrapper remains backwards compatible. If you already use the wrapper, no changes are needed; your existing code will continue to work without modification. To maintain backwards compatibility, the w3w-swift-wrapper now includes the voice package (`w3w-swift-voice-ap`i) automatically. This ensures that developers relying on the old wrapper for voice functionality won’t experience any breaking changes. Add the Swift Package at `https://github.com/what3words/w3w-swift-components` to your project. **Swift** ```swift https://github.com/what3words/w3w-swift-components.git ``` 1. From Xcode’s `File` menu choose `Swift Packages` then `Add Package Dependancy`. 2. The `Choose Package Repository` window appears. Add `https://github.com/what3words/w3w-swift-components.git` in the search box, and click on `Next`. 3.  If you are satisfied with the selected version branch choices, click `Next` again. 4. You should then be shown “Package Product” `W3WSwiftComponents`. Choose `Finish`. ![swift-components](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/73eb8c62ed52aafa126587e3506c734590d423f354f72832f04ac767ea79ec81.png) Xcode should now automatically install `w3w-swift-components`, and `w3w-swift-wrapper`. ## 3. Basic usage In your view controller add the following import statements to the top of the file: **Swift** ```swift import W3WSwiftCore import W3WSwiftApi import W3WSwiftComponents import CoreLocation ``` Add the following to `viewDidLoad()`. You’ll need to add your what3words API key to `let api = What3WordsV4(apiKey: "YourApiKey")` **Swift** ```swift override func viewDidLoad() { super.viewDidLoad() // instantiate the API let api = What3WordsV4(apiKey: "YourApiKey") // make the text field, and give it a place in the view let textField = W3WAutoSuggestTextField(frame: CGRect(x: 16.0, y: (UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 64.0) + 16.0, width: view.frame.size.width - 32.0, height: 32.0)) // assign the API to the text field textField.set(api) // tell autosuggest where the user is to get more relevant resultes use focus textField.set(options: W3WOption.focus(coords)) // assign a code block to execute when the user has selected an address textField.suggestionSelected = { suggestion in print(suggestion.words ?? "") } // the error can be captured using onError textField.onError = { error in print(String(describing: error)) } // place in the view view.addSubview(textField) } ``` ### Run the app You can now run the app and you will see the new field appear. Type a 3 word address and you should see suggestions appear after you start typing the 3rd word. ### Enterprise Suite If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server: **Swift** ```swift suggestionField!.setAPIKey(APIKey: ““, apiUrl: “https://api.yourserver.com”) ``` ### Obtaining suggestions details To be informed when the user chooses a suggestion from the list, assign a closure to `suggestionSelected`. It is called with a struct that conforms to the `W3WSuggestion` protocol. **Swift** ```swift textField.suggestionSelected = { suggestion in print("User chose:", suggestion.words ?? "") } ``` ### Configuring AutoSuggest properties You may set any of the AutoSuggest options for these text fields. If you use voice search, then these options will be automatically applied to that as well. In addition a number of other properties can be applied to configure the component. A full list can be found in the Advanced usage section of the tutorial. You may specify options as an array of `W3WOption`, or using the `W3WOptions` factory: **Swift** ```swift let options = [ W3WOption.clipToCountry(W3WApiCountry(code: "GB")), W3WOption.focus(CLLocationCoordinate2D(latitude: 50.0, longitude: 0.1)) ] ``` **Swift** ```swift let options = W3WOptions().focus(CLLocationCoordinate2D(latitude: 50.0, longitude: 0.1)).clip(to: W3WApiCountry("GB")) ``` **Swift** ```swift textField.set(options: options) ``` ## 4. Voice support The component also allows for voice input using the what3words Voice API. This feature allows the user to say 3 words and using speech recognition technology displays 3 word address suggestions to the user. Before enabling Voice AutoSuggest you will need to add a Voice API plan in your account. By default, the voice language is set to English but this can be changed using the voiceLanguage property (for a list of available languages please check the properties table below). Voice input respects the clipping and focus options applied within the general properties. We recommend applying clipping and focus where possible to display as accurate suggestions as possible. **Swift** ```swift textField.set(voice: true) ``` ## 5. Advanced usage In order to customise the iOS component, there are a number of properties that can be set. These match the wrapper for the main API to configure properties such as country clipping and focus. | Property | Type | Description | | --- | --- | --- | | focus | CLLocationCoordinate2D | This is a location, specified as latitude,longitude (often where the user making the query is). If specified, the results will be weighted to give preference to those near the focus | | clipToCountry / clipToCountries | W3WApiCountry | Restricts AutoSuggest to only return results inside the countries specified by comma-separated list of uppercase ISO 3166-1 alpha-2 country codes | | clipToCircle | center:CLLocationCoordinate2D, radius: Double | Restrict AutoSuggest results to a circle, specified by lat,lng,kilometres, | | clipToBox | southWest: CLLocationCoordinate2D, northEast: CLLocationCoordinate2D | Restrict AutoSuggest results to a bounding box, specified by coordinates. | | clipToPolygon | CLLocationCoordinate2D | Restrict AutoSuggest results to a polygon, specified by a comma-separated list of lat,lng pairs | | language | W3WApiLanguage | For normal text input, specifies a fallback language, which will help guide AutoSuggest if the input is particularly messy. | | voiceLanguage | String | Ask for results from the voice API in a particulalr language. Language must be an ISO 639-1 2 letter code, such as 'en' or 'fr'. | | preferLand | Bool | Unless your application deals mostly with locations in the ocean it's best to leave this default. | `W3WOption` is an enum with each case carrying a parameter representing one possible option. `W3WOptions` is a class that contains an array of `W3WOption`. Here are the case values of `W3WOption`: ### focus(CLLocationCoordinate2D) **Swift** ```swift let coords = CLLocationCoordinate2D(latitude: 50.0, longitude: 0.1) w3wComponent.set(options: W3WOption.focus(coords)) ``` ### clipToCountry(W3WApiCountry) / clipToCountries([String]) **Swift** ```swift w3wComponent.set(options: [W3WOption.clipToCountry(W3WApiCountry("GB")]) ``` **Swift** ```swift w3wComponent.set(options: [W3WOption.clipToCountries(["GB", "CA", "NZ", "AU"])]) ``` ### clipToCircle(center:CLLocationCoordinate2D, radius: Double) **Swift** ```swift let coord = CLLocationCoordinate2D(latitude: 51.520847, longitude: -0.195521) w3wComponent.set(options: [W3WOption.clipToCircle(center: coord, radius: 10.0)]) ``` ### clipToBox(southWest: CLLocationCoordinate2D, northEast: CLLocationCoordinate2D) **Swift** ```swift let southWest = CLLocationCoordinate2D(latitude: 51.51481, longitude: -0.204366) let northEast = CLLocationCoordinate2D(latitude: 51.535589, longitude: -0.168336) w3wComponent.set(options: [W3WOption.clipToBox(southWest: southWest, northEast: northEast)]) ``` ### clipToPolygon([CLLocationCoordinate2D]) **Swift** ```swift let p0 = CLLocationCoordinate2D(latitude: 51.51481, longitude: -0.204366) let p1 = CLLocationCoordinate2D(latitude: 51.56378, longitude: -0.329019) let p2 = CLLocationCoordinate2D(latitude: 51.535589, longitude: -0.168336) let p3 = CLLocationCoordinate2D(latitude: 51.402153, longitude: -0.075661) w3wComponent.set(options: [W3WOption.clipToPolygon([p0, p1, p2, p3, p1])]) ``` ### language(String) **Swift** ```swift w3wComponent.set(options: [W3WOption.language(W3WApiLanguage(locale: "fr")]) ``` ### voiceLanguage(String) **Swift** ```swift w3wComponent.set(options: [W3WOption.voiceLanguage(W3WApiLanguage(locale: "ar"))]) ``` ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Dart Getting started with the what3words Dart API wrapper. Topics: Dart, Mobile App, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/dart Updated: 2026-11-27 The Dart API wrapper (**now null safe**) is useful for Dart or [Flutter](https://developer.what3words.com/tutorial/flutter) developers who wish to seamlessly integrate the [what3words API](https://docs.what3words.com/api/v3/) into their Dart or Flutter applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words Dart wrapper is available in our [Dart Github repository](https://github.com/what3words/w3w-dart-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The artifact is available through [pub.dev](https://pub.dev/packages/what3words). Update your `pubspec.yaml` file with **Dart** ```dart dependencies: what3words: 3.2.0 ``` ## 3. Setup Import the `what3words` library **Dart** ```dart import 'package:what3words/what3words.dart'; ``` ## 4. Initialise Instantiate an instance of What3WordsV3, from which all API requests can be made **Dart** ```dart var api = What3WordsV3('what3words-api-key'); ``` In the case that you run our Enterprise Suite API Server yourself, you may specify the URL to your server like so: **Dart** ```dart var api = What3WordsV3.withEndpoint( 'what3words-api-key', 'https://api.yourserver.com'); ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.508344,0.12549900`): **Dart** ```dart var words = await api .convertTo3wa(Coordinates(51.508344, -0.12549900)) .language('en') .execute(); print('Words: ${words.data()?.toJson()}'); ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Dart** ```dart var coordinates = await api .convertToCoordinates('table.book.chair') .execute(); print('Coordinates ${coordinates.data()?.toJson()}'); ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .nResults(3) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .clipToCountry(['gb', 'be']) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .focus(Coordinates(51.4243877, -0.34745)) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, with Generic Voice input type. **Dart** ```dart var autosuggest = await api .autosuggest('fun with code') .input-type('generic-voice') .language('en') .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Dart** ```dart // Obtain a grid section within the provided bounding box var gridSection = await api .gridSection(Coordinates(51.515900, -0.212517), Coordinates(51.527649, -0.191746)) .execute(); print(gridSection.data()?.toJson()); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Dart** ```dart var languages = await api .availableLanguages() .execute(); print('Languages: ${languages.data()?.toJson()}'); ``` ### Handling errors Success of failure of an API call can be determined through the use of the `isSuccessful()` function. If it’s been determined that an API call was not successful, `code` and `message` values which represent the error, are accessible from through the `getError()` function. **Dart** ```dart var autosuggest = await api .autosuggest('freshen.overlook.clo') .clipToCountry(['fr', 'de']) .execute(); if (autosuggest.isSuccessful()) { ... } else { var error = autosuggest.getError(); if (error == What3WordsError.BAD_CLIP_TO_COUNTRY) { // Invalid country clip is provided print('BadClipToCountry: ${error.message}'); } } ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"]; // Check if the addresses are possible what3words addresses for (String address in addresses) { bool isPossible = api.isPossible3wa(address); print("Is '$address' a possible what3words address? $isPossible"); } } ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List texts = [ "Please leave by my porch at filled.count.soap", "Please leave by my porch at filled.count.soap or deed.tulip.judge", "Please leave by my porch at" ]; // Check each text for possible what3words addresses for (String text in texts) { List possibleAddresses = api.findPossible3wa(text); print("Possible what3words addresses in '$text': $possibleAddresses"); } } ``` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List w3w_addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ]; // Iterate over the list and check if each address is valid for (String w3w_address in w3w_addresses) { var response = await api.isValid3wa(w3w_address); if (response.isSuccessful() && response.isValid == true) { print("$w3w_address is a valid what3words address"); } else if (response.isSuccessful() && response.isValid == false) { print("$w3w_address is an invalid what3words address"); } else { print("isValid3wa error: ${response.error?.code} - ${response.error?.message}"); } } } ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example The example below takes the concepts described above, and turns some of them into a complete example. Here we take a partial 3 word address and pass it into AutoSuggest – clipping the results to consider only addresses in France, setting a focus of Paris, and returning a single result We then take the result and convert the 3 word address to coordinates, and find the nearest place. **Dart** ```dart import 'package:what3words/what3words.dart'; void main() async { // For all requests a what3words API key is needed var api = What3WordsV3('what3words-api-key'); var autosuggest = await api .autosuggest('freshen.overlook.clo') .clipToCountry(['fr']) .focus(Coordinates(48.856618, 2.3522411)) .nResults(1) .execute(); if (autosuggest.isSuccessful()) { var words = autosuggest.suggestions[0].words; print( 'Top 3 word address match: ${words}', ); var convertToCoordinates = await api.convertToCoordinates(words).execute(); if (convertToCoordinates.isSuccessful()) { print( 'WGS84 Coordinates: ${convertToCoordinates.coordinates.lat}, ${convertToCoordinates.coordinates.lng}'); print( 'Nearest Place: ${convertToCoordinates.nearestPlace}', ); } else { var error = autosuggest.getError(); if (error == What3WordsError.INTERNAL_SERVER_ERROR) { // Server Error print('InternalServerError: '); } else if (error == What3WordsError.NETWORK_ERROR) { // Network Error print('NetworkError: ${error.message}'); } } } else { var error = autosuggest.getError(); if (error == What3WordsError.BAD_CLIP_TO_COUNTRY) { // Invalid country clip is provided print('BadClipToCountry: ${error.message}'); } else if (error == What3WordsError.BAD_FOCUS) { // Invalid focus print('BadFocus: ${error.message}'); } else if (error == What3WordsError.BAD_N_RESULTS) { // Invalid number of results print('BadNResults: ${error.message}'); } else if (error == What3WordsError.INTERNAL_SERVER_ERROR) { // Server Error print('InternalServerError: ${error.message}'); } else if (error == What3WordsError.NETWORK_ERROR) { // Network Error print('NetworkError: ${error.message}'); } else { print('error: ${error.message}'); } } } ``` --- # Detecting if text is in the format of a what3words address using RegEx How to check if text is in the format of a what3words address, without having to ask the API. Topics: .NET, Android, Angular, Dart, Flutter, Java, JavaScript, NodeJS, Objective-C, PHP, Python, React, Ruby, Rust, Swift, Vue, Mobile App, Server and Scripting, Website Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) Source: https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address Updated: 2026-11-27 This tutorial aims to guide you through the process of using Regular Expressions (RegEx) to identify and verify what3words addresses in text strings. For a human-friendly guide explaining how the RegEx works, see [here](https://what3words.com/news/blog/understanding-the-what3words-regex-a-human-friendly-guide). ## 1. AI & LLMs (no real-time autosuggest) **JavaScript** ```javascript var regex = /(?:\b(?:https?:\/\/)?(?:www\.)?(?:what3words\.com|w3w\.co)\/((?:(?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)){2}(?:\p{L}\p{M}*)+|(?:\p{L}\p{M}*)+(?:[\u0020\u00A0](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[\u0020\u00A0](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[\u0020\u00A0](?:\p{L}\p{M}*)+){1,3})(?!\/)(?=$|[?#]|[^\p{L}\p{M}]))|(?:(?:^|(??/";:£§º©®\s/.。。・・︒។։။۔።।]))(?:/{0,3})((?:(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){2})|(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3}(?:[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3}){2})))(?![/.。。・・︒។։။۔።।]|[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s])"""); ``` **Rust** ```rust N/A: Rust doesn't support look-ahead and look-behind. ``` **Go** ```go N/A: Go doesn't support look-ahead and look-behind. ``` **C++** ```cpp wstring regex_search_url_vi = LR"rx((?:\b(?:what3words\.com|w3w\.co)/((?:(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+)[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+)[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+))|(?:(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})))(?![/])(?=$|[0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]))|(?:(?:^|[0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s])/{0,3}((?:(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+)[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+)[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+))|(?:(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})[.。。・・︒។։။۔።।](?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+(?:[ \u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3})))(?![/])(?=$|[0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s])))rx"; ``` ## 2. Exact match of what3words **JavaScript** ```javascript var regex = /^\/{0,}(?:[\p{L}\p{M}]+[.。。・・︒។։။۔።।][\p{L}\p{M}]+[.。。・・︒។։။۔።।][\p{L}\p{M}]+|[\p{L}\p{M}]+([\u0020\u00A0][\p{L}\p{M}]+){1,3}[.。。・・︒។։။۔።।][\p{L}\p{M}]+([\u0020\u00A0][\p{L}\p{M}]+){1,3}[.。。・・︒។։။۔።।][\p{L}\p{M}]+([\u0020\u00A0][\p{L}\p{M}]+){1,3})$/gu; ``` **Java** ```java String regex_string = "^/*(?:(?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+|(?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3})$"; ``` **Python** ```python regex_match = r"^/*(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+|[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+){1,3}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+){1,3}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/\";:£§º©®\s]+){1,3})$" ``` **Swift** ```swift regex_string = "^/*(?:[\\p{L}\\p{M}]+[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+|[\\p{L}\\p{M}]+([\u{20}\u{A0}][\\p{L}\\p{M}]+){1,3}[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+([\u{20}\u{A0}][\\p{L}\\p{M}]+){1,3}[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+([\u{20}\u{A0}][\\p{L}\\p{M}]+){1,3})$" ``` **Objective-C** ```objective-c NSString *regex_string = @"^/*(?:[\\p{L}\\p{M}]+[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+|[\\p{L}\\p{M}]+([ \u00A0][\\p{L}\\p{M}]+){1,3}[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+([ \u00A0][\\p{L}\\p{M}]+){1,3}[.。。・・︒។։။۔።।][\\p{L}\\p{M}]+([ \u00A0][\\p{L}\\p{M}]+){1,3})$"; ``` **PHP** ```php $regex_match = "/^\/*((?:\p{L}\p{M}*){1,}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*){1,}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*){1,}|\/*((?:\p{L}\p{M}*){1,}([\u{0020}\u{00A0}](?:\p{L}\p{M}*){1,}){1,3})[.。。・・︒។։။۔።।]((?:\p{L}\p{M}*){1,}([\u{0020}\u{00A0}](?:\p{L}\p{M}*){1,}){1,3})[.。。・・︒។։။۔።।]((?:\p{L}\p{M}*){1,}([\u{0020}\u{00A0}](?:\p{L}\p{M}*){1,}){1,3}))$/u"; ``` **.NET** ```csharp var regexExact = new Regex("^/*(?:(?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+|(?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3})$"); ``` **Ruby** ```ruby regex_match = /^\/*(?:(?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+|(?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3})$/ ``` **Dart** ```dart var regexExact = Regex("^/*(?:(?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+|(?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\\p{L}\\p{M}*)+([\u0020\u00A0](?:\\p{L}\\p{M}*)+){1,3})$"); ``` **Rust** ```rust let regex_match = r#"^\/*(?:(?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+|(?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \u{00A0}](?:\p{L}\p{M}*)+){1,3})$"#; ``` **Go** ```go regexMatch := `^\/*(?:(?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+|(?:\p{L}\p{M}*)+(?:[ \x{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \x{00A0}](?:\p{L}\p{M}*)+){1,3}[.。。・・︒។։။۔።।](?:\p{L}\p{M}*)+(?:[ \x{00A0}](?:\p{L}\p{M}*)+){1,3})$` ``` **C++** ```cpp wstring regex_match = L"(^/*(?:[^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}|[^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}([\u0020\u00A0][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]+){1,3}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}([\u0020\u00A0][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]+){1,3}[.。。・・︒។։။۔።।][^0-9`~!@#$%^&*()+\\-_=\\]\\[{\\}\\\\|'<,.>?/\";:£§º©®\\s]{1,}([\u0020\u00A0][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]+){1,3})$)"; ``` ## 3. Matching what3words address format ### Overview Our API wrapper RegEx function “`isPossible3wa`” (“is\_possible\_3wa” for Python & Rust API wrapper) can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. ### Benefits - **Quick Validation**: Rapidly determine if a string resembles a what3words address. - **Error Prevention**: Helps avoid errors by flagging potential what3words addresses for further validation. **JavaScript** ```javascript import { AutosuggestClient } from "@what3words/api"; // Initialise the What3Words API with your API key const API_KEY = 'YOUR_API_KEY'; const client = AutosuggestClient.init(API_KEY); // Example what3words addresses const addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"]; // Function to check if the address is a possible what3words address const checkPossible3wa = (address) => { const isPossible = client.isPossible3wa(address); console.log(`Is '${address}' a possible what3words address? ${isPossible}`); }; // Check each address addresses.forEach(checkPossible3wa); ``` **Java** ```java public class What3WordsExample { public static void main(String[] args) { // Example what3words addresses String[] addresses = {"filled.count.soap", "not a 3wa", "not.3wa address"}; // Check if the addresses are possible what3words addresses for (String address : addresses) { boolean isPossible = What3WordsV3.isPossible3wa(address); System.out.println("Is '" + address + "' a possible what3words address? " + isPossible); } } } ``` **Python** ```python import what3words def main(): # Initialize the What3Words API with your API key api_key = 'YOUR_API_KEY' w3w = what3words.Geocoder(api_key) # Example what3words addresses addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] # Check if the addresses are possible what3words addresses for address in addresses: is_possible = w3w.is_possible_3wa(address) print(f"Is '{address}' a possible what3words address? {is_possible}") if __name__ == "__main__": main() ``` **Swift** ```swift import W3WSwiftApi import CoreLocation func main() { // Initialize the What3Words API with your API key let api = What3WordsV4(apiKey: "YOUR_API_KEY") // Example what3words addresses let addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] // Check if the addresses are possible what3words addresses for address in addresses { let isPossible = api.isPossible3wa(text: address) print("Is '\(address)' a possible what3words address? \(isPossible)") } } main() ``` **PHP** ```php isPossible3wa($address); echo "Is '{$address}' a possible what3words address? " . ($isPossible ? "true" : "false") . "\n"; } } main(); ?> ``` **.NET** ```csharp using System; using what3words.dotnet.wrapper; namespace What3WordsExample { class Program { static void Main(string[] args) { // Initialize the What3Words API with your API key var api = new What3WordsV3("YOUR_API_KEY"); // Example what3words addresses string[] addresses = { "filled.count.soap", "not a 3wa", "not.3wa address" }; // Check if the addresses are possible what3words addresses foreach (var address in addresses) { bool isPossible = api.IsPossible3wa(address); Console.WriteLine($"Is '{address}' a possible what3words address? {isPossible}"); } } } } ``` **Ruby** ```ruby require 'what3words' def main # Initialize the What3Words API with your API key api_key = 'YOUR_API_KEY' w3w = What3Words::API.new(:key => api_key) # Example what3words addresses addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] # Check if the addresses are possible what3words addresses addresses.each do |address| is_possible = w3w.isPossible3wa(address) puts "Is '#{address}' a possible what3words address? #{is_possible}" end end if __FILE__ == $0 main end ``` **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"]; // Check if the addresses are possible what3words addresses for (String address in addresses) { bool isPossible = api.isPossible3wa(address); print("Is '$address' a possible what3words address? $isPossible"); } } ``` **Rust** ```rust use what3words_api::What3words; fn main() { // Initialize the what3words API with your API key let api_key = "YOUR_API_KEY_HERE"; let w3w = What3words::new(api_key); // Example what3words addresses let addresses = [ "filled.count.soap", "not a 3wa", "not.3wa address", ]; // Check if the addresses are possible what3words addresses for address in &addresses { let is_possible = w3w.is_possible_3wa(address); println!("Is '{}' a possible what3words address? {}", address, is_possible); } } ``` **Go** ```go package main import ( "fmt" w3w "github.com/what3words/w3w-go-wrapper" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Example what3words addresses addresses := []string{"filled.count.soap", "not a 3wa", "not.3wa address"} // Check if the addresses are possible what3words addresses for _, address := range addresses { isPossible := service.IsPossible3wa(address) fmt.Printf("Is '%s' a possible what3words address? %t\n", address, isPossible) } } ``` ### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”) returns `false` ### Steps 1. **Initialise** the API with your What3Words API key. \[**Note**: *Not applicable for Java wrapper*\] 2. **Check** if each address is a possible what3words address using `isPossible3wa`. 3. **Print** the result for each address. ### Dependencies Ensure you have the necessary dependencies installed for the what3words API Wrapper that you have chosen. For more information, refer to our [what3words API Wrappers](https://developer.what3words.com/public-api). ## 4. Verifying what3words addresses ### Overview Our API wrapper RegEx function “`isValid3wa`” (“`is_valid_3wa`” for our Python & Rust API wrapper) can be used to determine if a string is a valid what3words address by checking it against the what3words regex filter and verifying it with the what3words API. ### Benefits - **Reliable Validation**: Ensure the accuracy of what3words addresses by confirming their existence. - **Integration with What3Words API**: Seamlessly integrate address verification with the what3words API. **JavaScript** ```javascript import { AutosuggestClient } from "@what3words/api"; const API_KEY = 'YOUR_API_KEY'; const client = AutosuggestClient.init(API_KEY); // Example addresses const addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ]; // Function to check if the address is valid const checkIsValid3wa = async (address) => { try { const isValid = await client.isValid3wa(address); console.log(`Is '${address}' a valid what3words address? ${isValid}`); } catch (error) { console.error(`Error validating address '${address}':`, error); } }; // Check each address for validity addresses.forEach(checkIsValid3wa); ``` **Java** ```java public class What3WordsExample { public static void main(String[] args) { // Initialize the What3Words API with your API key What3WordsV3 api = new What3WordsV3("YOUR_API_KEY"); // Example addresses String[] addresses = { "filled.count.soap", "filled.count.", "coding.is.cool" }; // Check if the addresses are valid what3words addresses for (String address : addresses) { boolean response = api.isValid3wa(address); if (response.isSuccessful() && response.getIsValid()) { System.out.println(address + " is a valid what3words address"); } else if (response.isSuccessful() && !response.getIsValid()) { System.out.println(address + " is an invalid what3words address"); } else { System.out.println("isValid3wa error: " + response.getError().getKey() + " " + response.getError().getMessage()); } } } } ``` **Python** ```python import what3words def main(): # Initialize the what3words API with your API key api_key = 'YOUR_API_KEY' w3w = what3words.Geocoder(api_key) # Example addresses addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] # Check if the addresses are valid what3words addresses for address in addresses: is_valid = w3w.is_valid_3wa(address) print(f"Is '{address}' a valid what3words address? {is_valid}") if __name__ == "__main__": main() ``` **Swift** ```swift import W3WSwiftApi import CoreLocation func main() { // Initialize the what3words API with your API key let apiKey = "YOUR_API_KEY" let api = What3WordsV4(apiKey: apiKey) // Example addresses let addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] // Check if the addresses are valid what3words addresses for address in addresses { api.isValid3wa(words: address) { result in if result == true { print("'\(address)' is a valid what3words address") } else { print("'\(address)' is NOT a valid what3words address") } } } } main() ``` **PHP** ```php isValid3wa($address); echo "Is '$address' a valid what3words address? " . ($isValid ? 'True' : 'False') . "\n"; } } main(); ``` **.NET** ```csharp using System; using what3words.dotnet.wrapper; namespace What3WordsExample class Program { static void Main(string[] args) { // Initialize the what3words API with your API key var api = new What3WordsV3("YOUR_API_KEY"); // Example addresses string[] addresses = { "filled.count.soap", "filled.count.", "coding.is.cool" }; // Check if the addresses are valid what3words addresses foreach (var address in addresses) { bool isValid = api.IsValid3wa(address); Console.WriteLine($"Is '{address}' a valid what3words address? {isValid}"); } } } ``` **Ruby** ```ruby require 'what3words' def main # Initialize the what3words API with your API key api_key = 'YOUR_API_KEY' w3w = What3Words::API.new(:key => api_key) # Example addresses addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] # Check if the addresses are valid what3words addresses addresses.each do |address| is_valid = w3w.isValid3wa(address) puts "Is '#{address}' a valid what3words address? #{is_valid}" end end if __FILE__ == $0 main end ``` **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List w3w_addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ]; // Iterate over the list and check if each address is valid for (String w3w_address in w3w_addresses) { var response = await api.isValid3wa(w3w_address); if (response.isSuccessful() && response.isValid == true) { print("$w3w_address is a valid what3words address"); } else if (response.isSuccessful() && response.isValid == false) { print("$w3w_address is an invalid what3words address"); } else { print("isValid3wa error: ${response.error?.code} - ${response.error?.message}"); } } } ``` **Rust** ```rust use what3words_api::What3words; fn main() { // Initialize the what3words API with your API key let api_key = "YOUR_API_KEY_HERE"; let w3w = What3words::new(api_key); // Example addresses let addresses = vec![ "filled.count.soap", "filled.count.", "coding.is.cool", ]; // Check if each address is a valid what3words address for address in addresses { let is_valid = w3w.is_valid_3wa(address); println!("Is '{}' a valid what3words address? {}", address, is_valid); } } ``` **Go** ```go package main import ( "context" "fmt" w3w "github.com/what3words/w3w-go-wrapper" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Example addresses addresses := []string{ "filled.count.soap", "filled.count.", "coding.is.cool", } // Check if the addresses are valid what3words addresses for _, address := range addresses { isValid, err := service.IsValid3wa(context.Background(), address) if err != nil { fmt.Printf("Error validating address '%s': %v\n", address, err) } else { fmt.Printf("Is '%s' a valid what3words address? %t\n", address, isValid) } } } ``` ### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` ### Steps 1. **Initialise** the API with your What3Words API key. 2. **Define** example addresses to validate. 3. **Use** the `isValid3wa` function to check if each address is valid. 4. **Print** the validation results for each address. ### Dependencies Ensure you have the necessary dependencies installed for the what3words API Wrapper that you have chosen. For more information, refer to our [what3words API Wrappers](https://developer.what3words.com/public-api). ## 5. Contact Support ### Have any questions? We’re here to support you! If you have any questions while using our what3words Regex expressions, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Discover and search for 3 word addresses in ArcMap Adding the geocoding toolbar to ArcMap and using with what3words Locator. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/discover-and-search-for-3-word-addresses-in-arcmap Updated: 2026-11-27 This tutorial will take you through how to search for a 3 word address within ArcMap and how to find out the 3 word address for a location. Further information on the features of the locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Prerequisite: Set up the what3words ArcGIS Locator within ArcGIS Desktop. ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the what3words Locator to ArcGIS Online Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Adding Geocoding Toolbar to ArcMap ![ArcMap search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c782bd418a510992d0cec7d6b214327130c77a8f2ba1250a1e758c22da41f382.png) Enable the Geocoding Toolbar by right-clicking on the ribbon at the top of the ArcMap interface and clicking “Geocoding”. ## 4. Select Locator ![ArcMap search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/eaaab2df2308e2e53079177efbd1ffc1e858710dd853e289a2a2fb6d7a0dcef0.png) Select the Locator dropdown from the Geocoding toolbar and select “Manage Address Locators”. ![ArcGIS search add address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/11808bddd2132a45aa171928aae95739abe2682d96577aa59bdefb4c53484fdf.png) Click “Add” to select the what3words locator. ![ArcGIS search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/82c1372a53cd7f5b0520df7aff4c8eb0c9f5d399eca93ba6caf674fd141cad29.png) Under ArcGIS Servers select the locator and then select the language you would like to use. ## 5. Select Locator ![ArcGIS](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d987a68f95769e902f7ac5360fc2e18c79c03502f2a570dae483e5a0070f4f06.png) The what3words locator should now appear in the dropdown. ## 6. Discover 3 word addresses ![ArcMap search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/eaaab2df2308e2e53079177efbd1ffc1e858710dd853e289a2a2fb6d7a0dcef0.png) In order to discover the 3 word address for a location on the map click the “Address Inspector”. ![Arcmap search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8d6b1464dcb9d47660a856f5004dc353b2bd5449e1ad34b2411136139711e7ef.png) Left-click on the map to display the 3 word address and the latitude and longitude. ## 7. Search for a 3 word address ![ArcMap search](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b1c03a4418395bac4120e53b37907bfc4dfea4ababdb4f298f47929049b1bc33.png) Search for a 3 word address by typing an address in the Geocoding Toolbox. --- # Displaying the what3words grid on a Bing Maps Adding a Bing Maps to your website with the what3words grid. Topics: JavaScript, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Other Map Types](https://developer.what3words.com/docs/display-map/other-map-types.md) Source: https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-bing-maps Updated: 2026-11-27 ### Step by step The [what3words API](https://docs.what3words.com/api/v3/#grid) supports the ability to obtain a section of the 3m x 3m what3words grid in GeoJSON format, making it very simple to display on a map. This tutorial will show you how to integrate the what3words grid onto Bing Maps. We also have tutorials demonstrating its use with [Google Maps](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-google-map), [Mapbox](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-mapbox-map), and [LeafletJS](https://docs.what3words.com/tutorials/grid-leaflet.php). Before you begin developing your application, you need to create a developer account on the [Bing Maps Account Center](https://www.bingmapsportal.com/). A Bing Maps Developer Account allows you to create a Bing Maps Key to use in your map application. Getting a key is described in [Getting a Bing Maps Key](https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key). [Grid Section Map Overlay (Bing Maps)](https://codesandbox.io/s/displaying-the-what3words-grid-on-a-bing-maps-tpproi) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To load the JavaScript wrapper for the what3words API, use a `script` tag like the one in the following example. Replace `YOUR-API-KEY` with your what3words API key to get started. **Note:** We prefer to use a fixed version of the production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **JavaScript** ```javascript ``` The URL contained in the script tag is the location of a JavaScript file that loads everything you need for using the JavaScript wrapper for the what3words API. The `key` parameter contains your application’s API key. You will also need to add a reference to the map control script of the Bing Maps API. You specify the `key` parameter that contains your [Bing Maps API key](https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key) as part of the map script URL. The map control can be loaded asynchronously by specifying a callback function in the script URL and by adding “async defer” to the script tag as follows: **JavaScript** ```javascript ``` ## 3. Map style In the `body` of the page, add a `DIV` element to the page to contain the map. The size of the map is defined by the height and width of the DIV element. The position of the map is set by using the “position”, “top”, and “left” properties. You can set these values either inline or by defining the values in a style class and then referencing that class. In this example, we’ll set the map to display full screen, as follows: **JavaScript** ```javascript
``` ## 4. Map initialisation Next, within a new `script` tag, you need to create a function that can be called when your application loads. **JavaScript** ```javascript ``` If loading the map synchronously, you can trigger the `initMap` function by adding it to the `onload` event of the body tag. If you wish to load the map asynchronously please follow this [tutorial](https://docs.microsoft.com/en-us/bingmaps/v8-web-control/creating-and-hosting-map-controls/creating-a-basic-map-control). **JavaScript** ```javascript var map = new Microsoft.Maps.Map('#myMap'); ``` ## 5. Grid overlay The what3words grid can be drawn on top of a Bing Map by calling the what3words Grid API to obtain the grid squares within the currently visible bounding box of the map. Because only a segment of the grid section can be requested, we need to obtain a new grid section each time the map is panned or zoomed. **JavaScript** ```javascript ``` ### Full example The example below takes the step by step guide and puts them into a complete, working example. **JavaScript** ```javascript Displaying the what3words grid on a Bing Maps
``` --- # Displaying the what3words grid on a Google Map Adding a Google Map to your website with the what3words grid. Topics: JavaScript, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Display the what3words grid](https://developer.what3words.com/docs/display-map/display-the-what3words-grid.md) Source: https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-google-map Updated: 2026-11-27 ### Step by step The [what3words API](https://docs.what3words.com/api/v3/#grid) supports the ability to obtain a section of the 3m x 3m what3words grid in GeoJSON format, making it very simple to display on a map. This tutorial will show you how to integrate the what3words grid onto Google Maps. We also have tutorials demonstrating its use with both [Mapbox](https://docs.what3words.com/tutorials/grid-mapbox) and [LeafletJS](https://docs.what3words.com/tutorials/grid-leaflet.php). You will also need to sign up for a Google Maps developer account and be able to view other Google Maps tutorials at [https://developers.google.com/maps/documentation/javascript/tutorial](https://developers.google.com/maps/documentation/javascript/tutorial) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To load the JavaScript wrapper for the what3words API, use a `script` tag like the one in the following example. Replace `YOUR-API-KEY` with your what3words API key to get started. **Note:** We prefer to use a fixed version of the production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **JavaScript** ```javascript ``` The URL contained in the script tag is the location of a JavaScript file that loads everything you need for using the JavaScript wrapper for the what3words API. The `key` parameter contains your application’s API key. You will also need to load the Google Maps API, for example: **JavaScript** ```javascript ``` The bootstrap loader prepares the Maps JavaScript API for loading (no libraries are loaded until `importLibrary()` is called). The `key` parameter contains your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key). ## 3. Map style Within the `head` tag, we need to set style properties for the Google Map. In this example, we’ll set the map to display full screen. **JavaScript** ```javascript ``` ## 4. Map initialisation Within the `body` tag, we need to create a new div element to contain the map component. **JavaScript** ```javascript
``` This section shows you how to load the Maps JavaScript API into your web page and how to construct a new Google Maps object, and adds properties to the map including the center and zoom level. See the documentation for [other property options](https://developers.google.com/maps/documentation/javascript/reference#MapOptions). The `Map` library is loaded when the `initMap()` function is called. **JavaScript** ```javascript // Initialize and add the map let map; async function initMap() { const position = { lat: 51.52086, lng: -0.195499 }; // Request needed libraries. const { Map } = await google.maps.importLibrary("maps"); // The map, centered at Uluru map = new Map(document.getElementById("map"), { zoom: 19, center: position, mapId: "DEMO_MAP_ID" }); } initMap() ``` ## 5. Grid overlay The what3words grid can be displayed on top of a Google Map by passing GeoJSON data to the maps [Data](https://developers.google.com/maps/documentation/javascript/reference/data#Data.addGeoJson) object. Because only a segment of the grid section can be requested, we need to obtain a new grid section each time the map is panned or zoomed. **JavaScript** ```javascript // Initialize and add the map let map; async function initMap() { ... let gridData; // Add the what3words grid to the Google Map data layer once the desired zoom level is meet map.addListener("bounds_changed", function () { const zoom = map.getZoom(); const loadFeatures = zoom > 17; if (loadFeatures) { // Zoom level is high enough var ne = map.getBounds().getNorthEast(); var sw = map.getBounds().getSouthWest(); // Call the what3words Grid API to obtain the grid squares within the current visble bounding box what3words.api .gridSection({ boundingBox: { southwest: { lat: sw.lat(), lng: sw.lng() }, northeast: { lat: ne.lat(), lng: ne.lng() } }, format: "geojson" }) .then(function (data) { if (gridData !== undefined) { for (var i = 0; i < gridData.length; i++) { map.data.remove(gridData[i]); } } gridData = map.data.addGeoJson(data); }) .catch(console.error); } // Set the grid display style map.data.setStyle({ visible: loadFeatures, strokeColor: "#777", strokeWeight: 0.5 }); }); } initMap(); ``` ### Full example The example below takes the step by step guide and puts them into a complete, working example. **HTML** ```html Grid Section Map Overlay (Google Maps)
``` **CSS** ```css /* * style.css * Always set the map height explicitly to define the size of the div element * that contains the map. */ #map { height: 100%; } /* * Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; } ``` **JavaScript** ```javascript // index.js // Initialize and add the map let map; async function initMap() { const position = { lat: 51.52086, lng: -0.195499 }; // Request needed libraries. const { Map } = await google.maps.importLibrary("maps"); // The map, centered at Uluru map = new Map(document.getElementById("map"), { zoom: 19, center: position, mapId: "DEMO_MAP_ID" }); let gridData; // Add the what3words grid to the Google Map data layer once the desired zoom level is meet map.addListener("bounds_changed", function () { const zoom = map.getZoom(); const loadFeatures = zoom > 17; if (loadFeatures) { // Zoom level is high enough var ne = map.getBounds().getNorthEast(); var sw = map.getBounds().getSouthWest(); // Call the what3words Grid API to obtain the grid squares within the current visble bounding box what3words.api .gridSection({ boundingBox: { southwest: { lat: sw.lat(), lng: sw.lng() }, northeast: { lat: ne.lat(), lng: ne.lng() } }, format: "geojson" }) .then(function (data) { if (gridData !== undefined) { for (var i = 0; i < gridData.length; i++) { map.data.remove(gridData[i]); } } gridData = map.data.addGeoJson(data); }) .catch(console.error); } // Set the grid display style map.data.setStyle({ visible: loadFeatures, strokeColor: "#777", strokeWeight: 0.5 }); }); } initMap(); ``` --- # Displaying the what3words grid on a LeafletJS Map Adding a LeafletJS Map to your website with the what3words grid. Topics: JavaScript, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Display the what3words grid](https://developer.what3words.com/docs/display-map/display-the-what3words-grid.md) Source: https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-leafletjs-map Updated: 2026-11-27 ### Step by step The [what3words API](https://developer.what3words.com/public-api/docs/#grid-section) supports the ability to obtain a section of the 3m x 3m what3words grid in GeoJSON format, making it very simple to display on a map. This tutorial will show you how to integrate the what3words grid with LeafletJS. We also have tutorials demonstrating its use with both [Mapbox](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-mapbox-map) and [Google Maps](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-google-map). LeafletJS is an open source JavaScript mapping engine. More information can be found at [https://leafletjs.com/reference-1.5.0.html.](https://leafletjs.com/reference-1.5.0.html.) [Grid Section Map Overlay (Leaflet)](https://codesandbox.io/s/grid-section-map-overlay-leaflet-zz0ik) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To load the JavaScript wrapper for the what3words API, use a `script` tag like the one in the following example. Replace `YOUR-API-KEY` with your what3words API key to get started. **Note:** We prefer to use a fixed version of the production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **JavaScript** ```javascript ``` The URL contained in the script tag is the location of a JavaScript file that loads everything you need for using the JavaScript wrapper for the what3words API. The `key` parameter contains your application’s API key. You will also need to load the LeafletJS API, for example: **JavaScript** ```javascript ``` ## 3. Map style Within the `head` tag, we need to set style properties for LeafletJS. In this example, we’ll set the map to display full screen. **JavaScript** ```javascript ``` ## 4. Map initialisation Within the `body` tag, we need to create a new div element to contain the map component, as well as initialise it using the LeafletJS API. **JavaScript** ```javascript
``` ## 5. Grid overlay The what3words grid can be displayed on top of a LeafletJS Map adding a [GeoJSON layer](https://leafletjs.com/examples/geojson/) to the map. Because only a segment of grid section can be requested, we need to obtain a new grid section each time the map is panned or zoomed. **JavaScript** ```javascript ``` ### Full example The example below takes the step by step guide and puts them into a complete, working example. **JavaScript** ```javascript Grid Section Map Overlay (Leaflet)
``` --- # Displaying the what3words grid on a Mapbox Map Adding a Mapbox Map to your website with the what3words grid Topics: JavaScript, Mapbox, Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Display the what3words grid](https://developer.what3words.com/docs/display-map/display-the-what3words-grid.md) Source: https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-mapbox-map Updated: 2026-11-27 ### Step by step The [what3words API](https://developer.what3words.com/public-api/docs/#grid-section) supports the ability to obtain a section of the 3m x 3m what3words grid in GeoJSON format, making it very simple to display on a map. This tutorial will show you how to integrate the what3words grid with Mapbox. We also have tutorials demonstrating its use with both [Google Maps](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-google-map) and [Leaflet](https://developer.what3words.com/tutorial/displaying-the-what3words-grid-on-a-leafletjs-map). You will also need to sign up for a Mapbox developer account and be able to view other Mapbox tutorials at [https://docs.mapbox.com/mapbox-gl-js/api/](https://docs.mapbox.com/mapbox-gl-js/api/) [Grid Section Map Overlay (Mapbox)](https://codesandbox.io/s/grid-section-map-overlay-mapbox-zpdx0) (interactive example) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To load the JavaScript wrapper for the what3words API, use a `script` tag like the one in the following example. Replace `YOUR-API-KEY` with your what3words API key to get started. **Note:** We prefer to use a fixed version of the production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here.](https://developer.what3words.com/tutorial/javascript-autosuggest-component#versioning) **JavaScript** ```javascript ``` The URL contained in the `script` tag is the location of a JavaScript file that loads everything you need for using the JavaScript wrapper for the what3words API. The `key` parameter contains your application’s API key. You will also need to load the Mapbox API, for example: **JavaScript** ```javascript ``` ## 3. Map style Within the `head` tag, we need to set style properties for the Mapbox Map. In this example, we’ll set the map to display full screen. **JavaScript** ```javascript ``` ## 4. Map initialisation Within the `body` tag, we need to create a new `div` element to contain the map component, as well as initialise it using the Mapbox JavaScript API. **JavaScript** ```javascript
``` ## 5. Grid overlay The what3words grid can be displayed as a Mapbox layer by creating a GeoJSON data source, and [attaching it to a new layer](https://docs.mapbox.com/mapbox-gl-js/example/geojson-line/). Because only a segment of grid section can be requested, we need to obtain a new grid section each time the map is panned or zoomed. **JavaScript** ```javascript ``` ### Full example The example below takes the step by step guide and puts them into a complete, working example. **JavaScript** ```javascript Grid Section Map Overlay (Mapbox)
``` --- # .NET Getting started with the what3words .NET API wrapper. Topics: .NET, Server and Scripting, Website Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/dotnet Updated: 2026-11-27 The .NET API wrapper is useful for .NET developers who wish to seamlessly integrate the [what3words API](https://docs.what3words.com/api/v3/) into their applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words .NET wrapper is available in our [.NET Github repository](https://github.com/what3words/w3w-dotnet-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The artifact is available through NuGet Package [what3words.dotnet.wrapper](https://www.nuget.org/packages/what3words.dotnet.wrapper/). **.NET** ```csharp dotnet add package what3words.dotnet.wrapper ``` ## 3. Setup Use the `What3WordsV3` **C#** ```csharp using What3WordsV3; ``` **F#** ```fsharp open What3WordsV3 ``` **VB .NET** ```vb Imports What3WordsV3 ``` ## 4. Initialise Instantiate an instance of What3WordsV3, from which all API requests can be made **C#** ```csharp var wrapper = new What3WordsV3("YOUR_API_KEY_HERE"); ``` **F#** ```fsharp let wrapper = What3WordsV3("YOUR_API_KEY_HERE") ``` **VB .NET** ```vb Dim wrapper As New What3WordsV3("YOUR_API_KEY_HERE") ``` If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server like so: **C#** ```csharp var wrapper = new What3Words("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` **F#** ```fsharp let wrapper = What3Words("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` **VB .NET** ```vb Dim wrapper As New What3Words("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.222011, 0.152311`): **C#** ```csharp var result = await wrapper .ConvertTo3WA(new Coordinates(51.222011, 0.152311)) .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .ConvertTo3WA(Coordinates(51.222011, 0.152311)) .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .ConvertTo3WA(New Coordinates(51.222011, 0.152311)) _ .RequestAsync() ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **C#** ```csharp var result = await wrapper .ConvertToCoordinates("filled.count.soap") .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .ConvertToCoordinates("filled.count.soap") .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .ConvertToCoordinates("filled.count.soap") _ .RequestAsync() ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **C#** ```csharp var result = await wrapper .Autosuggest("index.home.r") .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .Autosuggest("index.home.r") .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .Autosuggest("index.home.r") _ .RequestAsync() ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **C#** ```csharp var result = await wrapper .Autosuggest("index.home.r", new AutosuggestOptions().ClipToCircle("GB,BE")) .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .Autosuggest("index.home.r", AutosuggestOptions().ClipToCircle("GB,BE")) .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .Autosuggest("index.home.r", New AutosuggestOptions().ClipToCircle("GB,BE")) _ .RequestAsync() ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **C#** ```csharp var result = await wrapper .Autosuggest("index.home.r", new AutosuggestOptions().SetFocus(51.4243877, -0.34745)) .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .Autosuggest("index.home.r", AutosuggestOptions().SetFocus(51.4243877, -0.34745)) .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .Autosuggest("index.home.r", New AutosuggestOptions().SetFocus(51.4243877, -0.34745)) _ .RequestAsync() ``` **Code example** AutoSuggest, with Generic Voice input type. **C#** ```csharp var result = await wrapper .Autosuggest("fun with code", new AutosuggestOptions().InputType("generic-voice")) .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .Autosuggest("fun with code", AutosuggestOptions().InputType("generic-voice")) .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .Autosuggest("fun with code", New AutosuggestOptions().InputType("generic-voice")) _ .RequestAsync() ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for (`51.222609, 0.152898`) in the south-west, and (`51.222011, 0.152311` in the north-east: **C#** ```csharp var result = await wrapper .GridSection(new Coordinates(51.222011, 0.152311), new Coordinates(51.222609, 0.152898)) .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .GridSection(Coordinates(51.222011, 0.152311), Coordinates(51.222609, 0.152898)) .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .GridSection(New Coordinates(51.222011, 0.152311), New Coordinates(51.222609, 0.152898)) _ .RequestAsync() ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **C#** ```csharp var result = await wrapper .AvailableLanguages() .RequestAsync(); ``` **F#** ```fsharp let! result = wrapper .AvailableLanguages() .RequestAsync() ``` **VB .NET** ```vb Dim result = Await wrapper _ .AvailableLanguages() _ .RequestAsync() ``` ### Handling errors Success or failure of an API call can be determined through the use of the `IsSuccessful` propriety. If it’s been determined that an API call was not successful, `Error` type and `Message` values which represent the error, are accessible from through the `Error` propriety. **C#** ```csharp var autosuggestResult = await api.Autosuggest( "freshen.overlook.clo", new AutosuggestOptions().SetClipToCountry(new List { "fr", "de" }) ).RequestAsync(); if (autosuggestResult.IsSuccessful) { ... } else { if (autosuggestResult.Error.Error == What3WordsError.BadClipToCountry) { // Invalid country clip is provided Console.WriteLine($"BadClipToCountry: {autosuggestResult.Error.Message}"); } } ``` **F#** ```fsharp let! autosuggestResult = api.Autosuggest( "freshen.overlook.clo", AutosuggestOptions().SetClipToCountry(new List [ "fr"; "de" ]) ).RequestAsync() if autosuggestResult.IsSuccessful then ... else if autosuggestResult.Error.Error = What3WordsError.BadClipToCountry then // Invalid country clip is provided printfn "BadClipToCountry: %s" autosuggestResult.Error.Message ``` **VB .NET** ```vb Dim autosuggestResult = Await api.Autosuggest( "freshen.overlook.clo", New AutosuggestOptions().SetClipToCountry(New List(Of String) From { "fr", "de" }) ).RequestAsync() If autosuggestResult.IsSuccessful Then ... Else If autosuggestResult.Error.Error = What3WordsError.BadClipToCountry Then ' Invalid country clip is provided Console.WriteLine($"BadClipToCountry: {autosuggestResult.Error.Message}") End If End If ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **C#** ```csharp using System; using what3words.dotnet.wrapper; namespace What3WordsExample { class Program { static void Main(string[] args) { // Initialize the What3Words API with your API key var api = new What3WordsV3("YOUR_API_KEY"); // Example what3words addresses string[] addresses = { "filled.count.soap", "not a 3wa", "not.3wa address" }; // Check if the addresses are possible what3words addresses foreach (var address in addresses) { bool isPossible = api.IsPossible3wa(address); Console.WriteLine($"Is '{address}' a possible what3words address? {isPossible}"); } } } } ``` **F#** ```fsharp open System open what3words.dotnet.wrapper [] let main argv = // Initialize the What3Words API with your API key let api = What3WordsV3("YOUR_API_KEY") // Example what3words addresses let addresses = [| "filled.count.soap"; "not a 3wa"; "not.3wa address" |] // Check if the addresses are possible what3words addresses for address in addresses do let isPossible = api.IsPossible3wa(address) printfn "Is '%s' a possible what3words address? %b" address isPossible 0 ``` **VB .NET** ```vb Imports System Imports what3words.dotnet.wrapper Namespace What3WordsExample Module Program Sub Main(args As String()) ' Initialize the What3Words API with your API key Dim api = New What3WordsV3("YOUR_API_KEY") ' Example what3words addresses Dim addresses As String() = { "filled.count.soap", "not a 3wa", "not.3wa address" } ' Check if the addresses are possible what3words addresses For Each address In addresses Dim isPossible As Boolean = api.IsPossible3wa(address) Console.WriteLine($"Is '{address}' a possible what3words address? {isPossible}") Next End Sub End Module End Namespace ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **C#** ```csharp using System; using what3words.dotnet.wrapper; namespace What3WordsExample class Program { static void Main(string[] args) { // Initialize the what3words API with your API key var api = new What3WordsV3("YOUR_API_KEY"); // Example addresses string[] addresses = { "filled.count.soap", "filled.count.", "coding.is.cool" }; // Check if the addresses are valid what3words addresses foreach (var address in addresses) { bool isValid = api.IsValid3wa(address); Console.WriteLine($"Is '{address}' a valid what3words address? {isValid}"); } } } ``` **F#** ```fsharp open System open what3words.dotnet.wrapper [] let main argv = // Initialize the what3words API with your API key let api = What3WordsV3("YOUR_API_KEY") // Example addresses let addresses = [| "filled.count.soap" "filled.count." "coding.is.cool" |] // Check if the addresses are valid what3words addresses for address in addresses do let isValid = api.IsValid3wa(address) printfn "Is '%s' a valid what3words address? %b" address isValid 0 ``` **VB .NET** ```vb Imports System Imports what3words.dotnet.wrapper Namespace What3WordsExample Module Program Sub Main(args As String()) ' Initialize the what3words API with your API key Dim api = New What3WordsV3("YOUR_API_KEY") ' Example addresses Dim addresses As String() = { "filled.count.soap", "filled.count.", "coding.is.cool" } ' Check if the addresses are valid what3words addresses For Each address In addresses Dim isValid As Boolean = api.IsValid3wa(address) Console.WriteLine($"Is '{address}' a valid what3words address? {isValid}") Next End Sub End Module End Namespace ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Flutter Getting started with the what3words Flutter API wrapper. Topics: Dart, Flutter, Mobile App, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/flutter Updated: 2026-11-27 The Flutter API wrapper is useful for [Dart](https://developer.what3words.com/tutorial/dart) or Flutter developers who wish to seamlessly integrate the [what3words API](https://docs.what3words.com/api/v3/) into their Dart or Flutter applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words Flutter wrapper is available in our [Flutter Github repository](https://github.com/what3words/w3w-dart-wrapper/tree/master/example/flutter_what3words) Also, a live sample of a Flutter application with Google Maps as a basemap is available in this **[FlutLab project](https://flutlab.io/editor/cebfba35-f9bd-4662-bc9d-bb7aa41bdd62)**. ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The artifact is available through [pub.dev](https://pub.dev/packages/what3words). Update your `pubspec.yaml` file with **Dart** ```dart dependencies: what3words: 3.1.0 ``` ## 3. Setup Import the `what3words` library **Dart** ```dart import 'package:what3words/what3words.dart'; ``` ## 4. Initialise Instantiate an instance of What3WordsV3, from which all API requests can be made. **Dart** ```dart var api = What3WordsV3('what3words-api-key'); ``` In the case that you run our Enterprise Suite API Server yourself, you may specify the URL to your server like so: **Dart** ```dart var api = What3WordsV3.withEndpoint( 'what3words-api-key', 'https://api.yourserver.com'); ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.508344,0.12549900`): **Dart** ```dart var words = await api .convertTo3wa(Coordinates(51.508344, -0.12549900)) .language('en') .execute(); print('Words: ${words.data()?.toJson()}'); ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Dart** ```dart var coordinates = await api .convertToCoordinates('table.book.chair') .execute(); print('Coordinates ${coordinates.data()?.toJson()}'); ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .nResults(3) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .clipToCountry(['gb', 'be']) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Dart** ```dart var autosuggest = await api .autosuggest('fun.with.code') .focus(Coordinates(51.4243877, -0.34745)) .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` **Code example** AutoSuggest, with Generic Voice input type. **Dart** ```dart var autosuggest = await api .autosuggest('fun with code') .input-type('generic-voice') .language('en') .execute(); print('Autosuggest: ${autosuggest.data()?.toJson()}'); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Dart** ```dart // Obtain a grid section within the provided bounding box var gridSection = await api .gridSection(Coordinates(51.515900, -0.212517), Coordinates(51.527649, -0.191746)) .execute(); print(gridSection.data()?.toJson()); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Dart** ```dart var languages = await api .availableLanguages() .execute(); print('Languages: ${languages.data()?.toJson()}'); ``` ### Handling errors Success of failure of an API call can be determined through the use of the `isSuccessful()` function. If it’s been determined that an API call was not successful, `code` and `message` values which represent the error, are accessible from through the `getError()` function. **Dart** ```dart var autosuggest = await api .autosuggest('freshen.overlook.clo') .clipToCountry(['fr', 'de']) .execute(); if (autosuggest.isSuccessful()) { ... } else { var error = autosuggest.getError(); if (error == What3WordsError.BAD_CLIP_TO_COUNTRY) { // Invalid country clip is provided print('BadClipToCountry: ${error.message}'); } } ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"]; // Check if the addresses are possible what3words addresses for (String address in addresses) { bool isPossible = api.isPossible3wa(address); print("Is '$address' a possible what3words address? $isPossible"); } } ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Dart** ```dart void main() async { // Replace 'what3words-api-key' with your actual API key var api = What3WordsV3('what3words-api-key'); List w3w_addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ]; // Iterate over the list and check if each address is valid for (String w3w_address in w3w_addresses) { var response = await api.isValid3wa(w3w_address); if (response.isSuccessful() && response.isValid == true) { print("$w3w_address is a valid what3words address"); } else if (response.isSuccessful() && response.isValid == false) { print("$w3w_address is an invalid what3words address"); } else { print("isValid3wa error: ${response.error?.code} - ${response.error?.message}"); } } } ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example The example below is a simple Flutter application demonstrating a basic GUI application featuring a text box which accepts a what3words address, and a ‘Convert To Coordinates’ button which geocodes the what3words address provided, returning the WGS84 Coordinates back to screen. **Dart** ```dart import 'package:flutter/material.dart'; import 'package:what3words/what3words.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { final appTitle = 'what3words'; return MaterialApp( title: appTitle, home: Scaffold( appBar: AppBar( title: Text(appTitle), ), body: LocationForm(), ), ); } } class LocationForm extends StatefulWidget { @override LocationFormState createState() { return LocationFormState(); } } class LocationFormState extends State { String twaHolder = ''; var api = What3WordsV3('what3words-api-key'); final _formKey = GlobalKey(); @override Widget build(BuildContext context) { var twaController = TextEditingController(); var twaInput = TextFormField( controller: twaController, decoration: InputDecoration( hintText: "e.g. lock.spout.radar" ), ); var convertToCoordsButton = ElevatedButton( child: Text("Convert To Coordinates"), onPressed: () async { var location = await api.convertToCoordinates(twaController.text).execute(); setState(() { if (location.isSuccessful()) { twaHolder = '${location.coordinates.lat}, ${location.coordinates.lng}'; } else { twaHolder = '${location.getError().code}: ${location.getError().message}'; } }); }, ); return Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ twaInput, convertToCoordsButton, Text('$twaHolder', style: TextStyle(fontSize: 21)) ], ), ); } } ``` --- # Golang Getting started with the what3words Go API wrapper. Topics: Go, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/go Updated: 2026-11-27 The Go wrapper is useful for Go developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their Go applications, without the hassle of having to manage the low level API calls themselves. A full example of Go application is available in our **[GitHub](https://github.com/what3words/w3w-go-wrapper)** repository. ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation First, install the Go wrapper by running: **Go** ```go go get github.com/what3words/w3w-go-wrapper ``` ## 3. Setup ### Import the Package Start by importing the what3words package in your Go code: **Go** ```go import ( "github.com/what3words/w3w-go-wrapper/pkg/apis/v3" what3words "github.com/what3words/w3w-go-wrapper" ) ``` ### Initialise the Geocoder service Create a new geocoder instance using your what3words API key. By default, the wrapper will point to the public version of the what3words API. Public API: **Go** ```go apiKey := "" svc := what3words.NewService(apiKey) ``` However, if required, the wrapper can be configured to point to a custom endpoint, for example a locally running version of the API. In this case an optional `WithCustomBaseURL` parameter can be passed to the `what3words.NewService` constructor. API Server: **Go** ```go svc := what3words.NewService(apiKey, WithCustomBaseURL("http://localhost:8080")) ``` ## 4. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.520847,-0.195521`): **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.ConvertTo3wa(context.Background(), v3.Coordinates{ Lat: 51.520847, Lng: -0.195521, }, nil) if err != nil { panic(err) } fmt.Println(resp.Json.Words) } ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.ConvertToCoordinates(context.Background(), "filled.count.soap", nil) if err != nil { panic(err) } // By default response JSON is used fmt.Println(resp.Json.Coordinates) // Getting a geojson response geoResp, err := svc.V3().ConvertToCoordinatesGeoJson(context.Background(), "filled.count.soap", nil) if err != nil { panic(err) } // If format GeoJson is not set in options, GeoJson attribute of the response will be set to nil fmt.Println(geoResp.GeoJson.Features[0].Geometry.Coordinates) } ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.AutoSuggest(context.Background(), "filled.count.so") if err != nil { panic(err) } fmt.Println(resp) } ``` **Code example** AutoSuggest, clipping the results returned to France and Germany: **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.AutoSuggest(context.Background(), "filled.count.so",&v3.AutoSuggestOpts{ ClipToCountry: []string{"FR", "DE"}, }) if err != nil { panic(err) } fmt.Println(resp) } ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.AutoSuggest(context.Background(), "filled.count.so",&v3.AutoSuggestOpts{ Focus: &core.Coordinates{ Lat: 51.4243877, Lng: -0.34745, }, }) if err != nil { panic(err) } fmt.Println(resp) } ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.GridSection(context.Background(), v3.BoundingBox{ SouthWest: v3.Coordinates{ Lat: 52.207988, Lng: 0.116126, }, NorthEast: v3.Coordinates{ Lat: 52.208867, Lng: 0.117540, }, }, nil) if err != nil { panic(err) } fmt.Println(resp.Json.Lines) } ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Go** ```go func main() { apiKey := "" svc := w3w.NewService(apiKey) resp, err := svc.V3.AvailableLanguages(context.Background()) if err != nil { panic(err) } fmt.Println(resp) } ``` ### Handling errors In Go, error handling is a fundamental aspect of programming, and the what3words Go wrapper adheres to this convention by returning errors as the second value from its functions. This approach allows developers to handle errors gracefully and implement custom logic based on the error type or message. Here’s how you can handle errors when using the what3words Go wrapper: **Go** ```go package main import ( "context" "fmt" "log" w3w "github.com/what3words/w3w-go-wrapper" "github.com/what3words/w3w-go-wrapper/pkg/apis/v3" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Attempt to convert an invalid 3-word address to coordinates address := "garbage.input" resp, err := service.V3.ConvertToCoordinates(context.Background(), address, nil) if err != nil { // Handle the error fmt.Printf("Error converting '%s' to coordinates: %v\n", address, err) return } // If no error, proceed to use the response fmt.Printf("Coordinates for '%s': %+v\n", address, resp.Json.Coordinates) } ``` ### Custom Error Handling: The what3words Go wrapper provides specific error types that can be checked using Go’s `errors.As` function. This allows for more granular error handling based on the error type. **Go** ```go package main import ( "context" "errors" "fmt" "log" w3w "github.com/what3words/w3w-go-wrapper" "github.com/what3words/w3w-go-wrapper/pkg/apis/v3" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Attempt to convert an invalid 3-word address to coordinates address := "garbage.input" resp, err := service.V3.ConvertToCoordinates(context.Background(), address, nil) if err != nil { // Check if the error is of type BadWords var badWordsErr *v3.BadWords if errors.As(err, &badWordsErr) { fmt.Printf("Invalid 3-word address '%s': %s\n", address, badWordsErr.Error()) } else { // Handle other types of errors fmt.Printf("Error converting '%s' to coordinates: %v\n", address, err) } return } // If no error, proceed to use the response fmt.Printf("Coordinates for '%s': %+v\n", address, resp.Json.Coordinates) } ``` ## 5. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `IsPossible3wa` – Match what3words address format; - `IsValid3wa` – Verify a what3words address with the API; ### IsPossible3wa Our API wrapper RegEx function “`IsPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `IsValid3wa` to verify validity. **Go** ```go package main import ( "fmt" w3w "github.com/what3words/w3w-go-wrapper" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Example what3words addresses addresses := []string{"filled.count.soap", "not a 3wa", "not.3wa address"} // Check if the addresses are possible what3words addresses for _, address := range addresses { isPossible := service.IsPossible3wa(address) fmt.Printf("Is '%s' a possible what3words address? %t\n", address, isPossible) } } ``` #### Expected Output - IsPossible3wa(“filled.count.soap”) returns `true` - IsPossible3wa(“not a 3wa”) returns `false` - IsPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`IsValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Go** ```go package main import ( "context" "fmt" w3w "github.com/what3words/w3w-go-wrapper" ) func main() { // Initialize the What3Words API with your API key apiKey := "" service := w3w.NewService(apiKey) // Example addresses addresses := []string{ "filled.count.soap", "filled.count.", "coding.is.cool", } // Check if the addresses are valid what3words addresses for _, address := range addresses { isValid, err := service.IsValid3wa(context.Background(), address) if err != nil { fmt.Printf("Error validating address '%s': %v\n", address, err) } else { fmt.Printf("Is '%s' a valid what3words address? %t\n", address, isValid) } } } ``` #### Expected Outputs - IsValid3wa(“filled.count.soap”) returns `True` - IsValid3wa(“filled.count.”) returns `False` - IsValid3wa(“coding.is.cool”) returns `False` Also, make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Hiding your API Key Hide your API key by proxying API calls through a proxy application running on your server. Topics: Android, Java, JavaScript, Objective-C, PHP, Python, Swift, Server and Scripting, Website Section: [Guidelines & Support](https://developer.what3words.com/docs/guidelines-support.md) Source: https://developer.what3words.com/tutorial/hiding-your-api-key Updated: 2026-11-27 ### Step by step One of the most common uses of the what3words API is within browser-based applications. For example, you might be using the [what3words AutoSuggest Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) to allow easy capture of 3 word addresses on your website. In cases like these, where a client-side JavaScript application is making calls to the public what3words API, there is a danger that your API key will be both visible inside your JavaScript application, and over the network. To mitigate against this, you can hide your API key by proxying API calls through a proxy application running on your server. ## 1. Setup The example provided on the code tab is written in PHP. While no PHP dependencies are required, it is assumed that you have a working environment to host PHP from. You will need a what3words API key, which should be assigned to the `$base_url` variable. If you don’t already have an API key, you can obtain one by [registering](https://accounts.what3words.com/login) for an account. ## 2. Usage Assuming you have the above PHP script running on your webserver, in a file called w3w\_proxy.php, you should be able to call it with any valid what3words API HTTP GET request. For example, to make a convert-to-coordinates call, you could make the following HTTP request: **Endpoint** ``` https:///w3w_proxy.php/convert-to-coordinates?words=index.home.raft ``` ## 3. CORS It is important that efforts are taken to make sure other websites are not able to make use of your proxy. By default, web browsers permit scripts contained in a first web page to access data from a second source, but only if both sources have the same origin. Therefore, by default, only web pages served from the same domain as your proxy will be able to make successful AJAX through the proxy. If however, you are hosting your proxy on a different domain to your website, you will need to add the Access-Control-Allow-Origin header (with the value of your websites domain) to your proxies response headers. This allows the browser to access your resource (the proxy), even though the request is coming from a different domain. The following code snippet demonstrates how this can be achieved: **PHP** ```php $allowed_origin = 'example.com'; header('Access-Control-Allow-Origin:' . $allowed_origin); ``` ## 4. API Key Restriction Settings If you need to include your API key in plain text within an HTML tag, it’s critical to restrict its usage to specific applications, domains, or IPs to minimize the risk of misuse. Follow these steps to apply restrictions to your API key: **Step 1: Access API Key Restriction Settings** After creating your API key: 1. Navigate to the API Key Restriction section of your API management interface. 2. Choose the appropriate restriction method from the following options: - HTTP referrers (websites) - IP addresses (web servers, cron jobs, etc.) - iOS apps - Android apps **Step 2: Configure Restrictions for Your API Key** 1. **HTTP Referrers (Websites)** Restrict API key usage to specific domains: 1. Add these to allow access to your site: \*.yoursiteaddress.com*/\* ,* *yoursiteaddress.com/\** 2. For specific restrictions: - Specific domain: www.yoursiteaddress.com/checkout - All paths in a subdomain: subdomain.yoursiteaddress.com/\* - Non-standard port: www.yoursiteaddress.com:8000/\* **2\. IP Address Restrictions** Restrict API usage to certain IPs or subnets: - Single IP: 192.168.0.1 - IPv6: 2001:db8::1 - Subnet: 192.168.0.0/22 **3\. iOS Apps** - Use the Swift/Objective-C API wrapper. - Add your app’s **Bundle ID** (found in project settings). **4\. Android Apps** - Use the Android API wrapper. - Add your app’s **Package Name** and **SHA-1 fingerprint**. To find the SHA-1: keytool -list -v -keystore mystore.keystore Use the Package Name from AndroidManifest.xml. **Step 3: Save and Test** Once you’ve set the desired restrictions: 1. Save the changes. 2. Test your API key within your application or website to ensure it functions as expected under the applied restrictions. **Why Restrict API Keys?** Adding restrictions ensures that your API key can only be used by the intended application, domain, or server. Even if someone gains unauthorised access to your key, they won’t be able to use it outside the defined restrictions, adding a layer of security to your integration. ### Full example The example provided here is written in PHP. While no PHP dependencies are required, it is assumed that you have a working environment to host PHP from. You will need a what3words API key, which should be assigned to the $base\_url variable. If you don’t already have an API key, you can obtain one by [registering](https://accounts.what3words.com/register) for an account. **PHP** ```php $value) { $params = $params . $key . '=' . urlencode($value) . '&'; } // The what3words API key to use $key = 'MY-API-KEY'; // Build up the URL to proxy $url = $base_url . $method . '?' . $params . 'key=' . $key; $curl = curl_init(); $headers = []; curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => 'UTF-8', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', )); // Read the headers back from the response curl_setopt($curl, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$headers) { $len = strlen($header); $header = explode(':', $header, 2); if (count($header) < 2) // ignore invalid headers return $len; $name = strtolower(trim($header[0])); if (!array_key_exists($name, $headers)) $headers[$name] = [trim($header[1])]; else $headers[$name][] = trim($header[1]); return $len; } ); // Call the what3words API with the proxied request $response = curl_exec($curl); // Mimic the content type header from the actual API response $content_type = $headers['content-type'][0]; header('Content-Type:' . $content_type); /** * Return appropriate CORS headers if the proxy is hosted on a different * domain to the website initiating the AJAX request */ $allowed_origin = 'example.com'; header('Access-Control-Allow-Origin:' . $allowed_origin); echo $response; ?> ``` --- # How to add the what3words Java API for GE Smallworld Adding the what3words Java API for GE Smallworld. Topics: GE Smallworld, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-java-api-for-ge-smallworld Updated: 2026-11-27 ### Step by step This guide describes how to use what3words Java API for GE Smallworld. GE has a long and successful track record in utilities. It has similar capabilities to most GIS software. Because it specialises in network infrastructure, you get value-added tools specifically for networking. GE Smallworld is completely written in Magik. Magik is an object-oriented programming language and can be stand-alone applications on their own. The what3words Java API module uses the Magik-Java Interoperability, a supported mechanism to call code written in Java™ from GE Smallworld. This provides an efficient way of exposing Java to Magik, allowing access to existing Java code and third-party libraries written in Java. Your project could be separated into two parts, the Java module part which is used to implement the what3words class, and the Magik part where the plugin is implemented. The Java class is available [here](https://github.com/Aramideh/What3Words/blob/main/Module/Java/Java%20Project/src/com/aramideh/sadeq/what3words/sw_what3words.java). **This module has been tested on Smallworld 5.2.8 ** **Resources:** Implementation of what3words Java API for GE Smallworld is available in this [GitHub repository](https://github.com/what3words/ge_smallworld_w3w_plugin) and as a [video tutorial](https://youtu.be/8QuhYhqytcI). ## 1. Prerequisite You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. What can you do with what3words Java API for GE Smallworld - Users can select different languages on the toolbar; - Users can search what3words address on the toolbar; - Users can use the AutoSuggestion functionality on the search bar to find the right what3words address; - Users can convert a what3words address typed on the search bar to a point feature on the map (convert to coordinate); - Users can tap on the map to get any what3words address (convert to what3words address); - Users can display the what3words address on the selection status bar pane at the bottom of the map; - Users can use the backward or forward buttons on the what3word toolbar to search for a what3words selection; - Users can display all the what3words addresses that have been searched using the what3words history viewer plugin; - Users can display the what3words grid on the map by enabling the grid icon. ## 3. Installation To install this plugin, make sure you follow these steps: 1\. Copy the what3words folder to a directory such as `%SMALLWORLD_GIS%/../` 2\. Add this folder to the `LAYERED_PRODUCTS` file in `%SMALLWORLD_GIS%\..\smallworld_registry` directory what3words: `path = %SMALLWORLD_GIS%\..\what3words\` `version = 5.2.8` 3\. Add this code to the `config.xml` of the Application: **XML** ```xml ``` 4\. Copy the what3words API key from your what3words account and paste it into the `api_key` property 5\. Add this code to the `gui.xml` of the Application: **XML** ```xml
``` ![ge-smallworld-gui](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d9eeba5b8772f3e2b66b97e2d2fba58fde6901b626146e7ae4337c001b6f2911.png) 6\. Add `what3words Search History Viewer Plugin` to the `work_area` `` for the what3words Cambridge application, the changes are as shown on this screenshot. ![ge-smallworld-toolbar](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a56a4f1938b10bde261def9954286768265a0c5f6d2d0debc030f8b77b7da3d8.png) The what3words toolbar would be displayed on the GE Smallworld platform. ## 4. Select different languages on the toolbar ![GE Support languages](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/553b1fd7dfc923db82fe31b4656c69d1e99772c1701552190f890934af26ea35.png) The what3words application is available in multiple languages. Users can choose their language from the dropdown menu, as it is shown here. ## 5. Search what3words on the search bar ![GE Search w3w on search bar](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a821497cd59a0dfb0b2d694a51034cd3f68568ff3952959f28350a92a174ceaa.png) Users can search what3words address on the search bar. On the toolbar, the backward and forward buttons allow users to easily navigate the what3words addresses that have been searched on the search bar. ## 6. Autosuggestion of 3 word addresses ![GE Autosuggest dropdown](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1c10cfbb26cceb3221363ad8ece51cf1365bd259ac2fb107d82790144e5eeac5.png) When users type a 3 word address on the search bar that may be incorrectly entered, the what3words autosuggestion functionality will return a list of potential correct 3 word addresses. The user will need to enter the first two words plus at least the first character of the third word to get the list of suggestions, e.g. `filled.count.s` . This method provides corrections for mistyped words (including plural vs singular), and words being in the wrong order. When a user is happy with the selection of the what3words address, it can click the green play button next to it to display it on the map. ## 7. Convert a 3 word address to coordinates ![ge-smallworld-coordinates](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b4cb79f69a560c45d82897a697547fa67b6dee73f8433cff87de8b4d79fc456b.png) Users can convert a what3words address, e.g. `filled.count.soap`, to a position, expressed as coordinates of latitude and longitude. It will be displayed as a pop-up message on the map with the what3words address. You will need to update the properties mentioned above in the  `config.xml` of the Application. Then restart the Application to see the changes applied to the plugin. **Note:** The what3words address is visible on the selection status bar pane located at the bottom of the map. ## 8. Convert coordinates to a 3 word address ![ge-smallworld-convert-to-3wa](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4054a90232d84ad2c72c6fc2703ac6ddb7005aa2079235b1813119d4653011f5.png) Users can tap anywhere on the map to retrieve a what3words address. It will be displayed as a popup message on the map. Any coordinates on the map (expressed as latitude and longitude) get converted on the fly to a what3words address. ## 9. Display what3words History Viewer Plugin ![ge-smallworld-history-viewer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4e8eaa754101d5525299ac4de119f224ff0d0482fc9dbd6e95ddb0b7967b6cfe.png) You can also enable the what3words History Viewer plugin that will allow you to display all the what3words addresses that you have been searching on the map. But this plugin can do much more such as: - Storing all the what3words addresses directly searched or inspected on the map; - Displaying all the queried what3words addresses in the list; - Highlighting what3words addresses from the list; - Create a trail of the what3words addresses; - Go to the location of the what3words addresses; - Copy what3words addresses; - Copy coordinates of the what3words addresses. ## 10. Display what3words Grid ![ge-smallworld-grid](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/dd14f8aa87678ab0a59e79f2db62312df17f02ddf1c40851322a42118af75ad5.png) To display the 3m x 3m what3words Grid on the map, you need to enable the Grid icon on the toolbar as shown on this screenshot. Also to be noticed that whenever you change your coordinate system the grid will be also reprojected using the new coordinate system. ## 11. Troubleshooting If you encounter errors or issues related to convert-to-coordinate requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # How to add the what3words Locator to ArcGIS for Office – Excel and PowerPoint Adding the what3words Locator to ArcGIS for Office - Excel and PowerPoint Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-arcgis-for-office-excel-and-powerpoint Updated: 2026-11-27 This guide describes how to use what3words ArcGIS Locator in the ArcGIS for Office application adding a geographic component to the data analysis capabilities of Microsoft Office. ArcGIS for Office is a free add-on that works with your existing ArcGIS subscription. You can transform your Excel data, graphs and charts into interactive maps to see data from a different perspective. Then, use Microsoft PowerPoint to share your map, embedding it in your PowerPoint presentations. By adding a dynamic map you take your slides to the next level. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Prerequisites 1. To use what3words ArcGIS locator in ArcGIS for Office application, you need to have an ArcGIS subscription to allow you to use the geocoding functionality. Please make sure you have installed what3words ArcGIS locator on your ArcGIS Online account and share across your organization, follow the instruction [here](https://developer.what3words.com/tutorial/using-the-what3words-locator-across-the-arcgis-platform); 2. To Install the ArcGIS for Office on a Microsoft Office site, please follow these [instructions](https://doc.arcgis.com/en/office/install-and-configure/install-on-a-single-computer.htm); 3. When the installation is completed, please make sure to [configure ArcGIS for Office.](https://doc.arcgis.com/en/office/install-and-configure/configure-esri-maps-for-office.htm) ## 3. What can you do with ArcGIS Locator in ArcGIS for Office? - You can display the locator on the search bar; - You can search what3words address; - You can use the autosuggestion functionality on the search bar to find the right what3words address; - You can convert a what3words address typed on the search bar to a point feature on the map (convert to coordinate); - You can plot a list of what3words addresses from an Excel spreadsheet into the ArcGIS map by using what3words as geolocator. ## 4. Usage in Office Excel ![Work on excel addin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7335ab0dbc183da7f4b9ed066de573128050013d0040574890284b6e2d4f903d.png) Prepare your Excel spreadsheet that you will be adding to the ArcGIS map. You could also use what3words [Excel Add-in](https://developer.what3words.com/tutorial/using-the-what3words-for-excel-add-on) to convert a list of coordinates to what3words addresses, please follow the instructions [here](https://developer.what3words.com/tutorial/using-the-what3words-for-excel-add-on). ![ArcGIS Excel signin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0675c12fc01402aba33061f424ebf2182b2b496d8166e5a63be15de644e4fb29.png) After installing and configuring ArcGIS for Office, an ArcGIS tab will appear on the Excel Ribbon, click on it to display the ArcGIS tools. **Note:** If you don’t see the ArcGIS tab, [download ArcGIS for Office](https://www.esri.com/en-us/arcgis/products/arcgis-maps-for-office/download). If you’ve already installed ArcGIS for Office, see [What’s new](https://doc.arcgis.com/en/office/install-and-configure/whats-new.htm) in ArcGIS for Office or [Frequently Asked Questions](https://doc.arcgis.com/en/office/design-and-use/m4o-faq.htm) for a possible solution. Before you can use the tools, you must first sign in to an ArcGIS organizational account (or an ArcGIS Enterprise organizational account). ![ArcGIS Excel signin_form](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/99ec6415b1c78102b8ebe8de5365f85d66e6b042ffabf6095b009c463ae5ff79.png) On the Excel ribbon, on the ArcGIS Maps tab, click **Add Map**. The Map 1 window appears. In the Map 1 window, click Sign In and sign in to your ArcGIS organizational account. ![ArcGIS Excel add_excel_data](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8fbd24c4fba2ad6bf33e88624dfbc05093edbfc207919cdf9708e81e76b3d23f.png) The Map 1 window is going to display a blank map and an empty layer list, as you haven’t added any layers yet. At the bottom of the layers panel, users can choose to add data t the map in 2 ways: 1. **Add from Excel** 2. **Add from ArcGIS** ![ArcGIS Office - use_batch_geolocation](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c3005c2dbbe24acf56c5d2d1e8f252cce955c33c8275e5f13126dfe51002d3a0.png) You can choose to add the Excel spreadsheet data that they have previously prepared, as shown in this example. Click **Add from Excel** and a panel will appear.  ArcGIS for Office provides two ways of adding data from Excel: from a table or a cell range. In our example, we will add the data from a range of cells in the spreadsheet. Checked the first row contains headers to preserve these as attribute field names, which will help you style the map later. Next, you will specify the mapping options and confirm the location information for the what3words field. Since you are logged in to ArcGIS Online and you have shared the what3words locator across the ArcGIS Platform, you will be given the choice to use what3words as the geolocator, country as the world, and the what3words field as the location field, which is only a single column. Then click **Add to Map**. ![ArcGIS Office - add_arcgis_data_to_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ca77e3816fed6a1596534c1603fe263f920510608f06633010359d3e8213bb91.png) Or you can add your layers from ArcGIS Online or your ArcGIS Enterprise. ![ArcGIS Office - arcgis_data_added_with_w3w_labels](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5064f298ed1716876276a066b13833af14b4d98256362a2f82c9547d58d4d17d.png) If you are connected to your ArcGIS Online, as shown in this example, and you choose a web map, it would look like this: ![ArcGIS Office - locator_on_search_bar](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e3639b2bd28319e818c700dd14d1fb5e4dbb81b034e73efd0b20926c2188cbe9.png) You can use their what3words locator on their search input bar. ![ArcGIS Office - search_w3w_on_search_bar](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/190b90b26480d3ebb1dc3061b4041572fafaafc4165af8d259bb887c4a7d6034.png) You can use the locator in the same way you will use it on the ArcGIS online, by typing a what3words address, a list of suggested what3word addresses will come up. ![ArcGIS Office - convert_3wa_to_coordinates_on_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0878c022ca909f62ebf30746ce8d896e01b4f4fdbfa6a3ffc06d3032cf37a342.png) Click on the what3words address that you were searching for, and a point will appear on the map with a pop-up with the search result. ![ArcGIS Office - share_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7c081258fdd35a2f95a4971fdbfccd151675f2d63fa5a3401cf1fa0b3a805909.png) Now that you have a map with your data, you can share this map on ArcGIS Online to present your results. ## 5. Usage in Office PowerPoint ![ArcGIS PPTX - signin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7fae1812928f8c1db5023967709ccedad54e9a226761a110e04fba5f3f613753.png) You could also add this dynamic map to your PowerPoint presentation. To add it, you need to make sure you are logged in. ![ArcGIS PPTX - add map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9ae6eb37357bfc2f0bbe9876d3bd0c273664c82e331f8a19061615a02a60a198.png) **Browse maps:** Then browse your maps, you can use the drop-down menu at the top of the panel to choose where to browse—for example, in **My Content** or in **ArcGIS Living Atlas**—and type keywords into the search box to narrow the results. Click the check mark next to a search result to select and add it. Once you have found and added a map, click **Next**. ![ArcGIS PPTX - choose_layers_and_legend_keys](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2cf37ca330f1726bb26d4e26d6d31f12c94c4aa23839f9043a19b2644972854d.png) **Choose layers and legend keys:** Now, choose which layers and legend keys appear in your dynamic map. You can use the Show/hide layer button to control whether a layer appears on the map. You can add the layer’s symbology as a legend key, by clicking the plus button next to the layer name. When you’re happy with your layers and legend, click **Next**. ![ArcGIS PPTX - choose_layout_for_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f86b8472ba5b04d3972356c0ce1e0391af890bb786c80fd3bb09f98c713fe21f.png) **Choose layout:** Decide how you want your map to appear on the slide. It can be inset, taking up only a portion of the slide, or it can fill the whole slide.  After selecting your layout, click **Next**. ![ArcGIS PPTX - preview_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/944cb66d2e3a7300ce14d9eac72d9c209a69b7082995b47e54141cd7bc6044d4.png) **Review and insert map:** This final step in the workflow is a preview of what your slide will look like. Adjust the placement of the legend and zoom the map to your preferred extent. Click **Insert map** to create your dynamic map slide. ![ArcGIS PPTX - final_map_and_edit](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3f725365e6ac9b3020d70d4177f7accaf46933d37e1911dae3925ec702446845.png) Now, your map has been embedded in your PowerPoint presentation. Press the Edit button on the ArcGIS ribbon to edit the map if you need to amend it. ![ArcGIS PPTX - presentation_mode_locked](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/eac59f547e71d2c66e109b81161b90f90941d26c4094cdc27f9495763193be3c.png) When you enter Slide Show mode, the map appears as a static image in the layout that you selected earlier. Click the lock icon at the top of the map to transition to live mode and interact with the map. ![ArcGIS PPTX - unlock_map_while_presenting](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ae282b7d9195482ef21b65a88be600466c13c707a255281948e3ca50243b675b.png) You can pan, zoom, view pop-ups, and even view the map in full-screen if you press the full-screen button at the top of the map next to the lock. To lock it again, you will need to click on the unlock button. --- # How to add the what3words Locator to ArcGIS for SharePoint Adding the what3words Locator to ArcGIS for SharePoint. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-arcgis-for-sharepoint Updated: 2026-11-27 This guide describes how to use what3words ArcGIS Locator in the ArcGIS for Office application adding a geographic component to the data analysis capabilities of Microsoft Office. ArcGIS for Office is a free add-on that works with your existing ArcGIS subscription. You can transform your Excel data, graphs and charts into interactive maps to see data from a different perspective. Then, use Microsoft PowerPoint to share your map, embedding it in your PowerPoint presentations. By adding a dynamic map you take your slides to the next level. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Prerequisites 1. To use what3words ArcGIS locator in ArcGIS for Office application, you need to have an ArcGIS subscription to allow you to use the geocoding functionality. Please make sure you have installed the what3words ArcGIS locator on your ArcGIS Online account and share it across your organization, follow the instructions [here](https://developer.what3words.com/tutorial/using-the-what3words-locator-across-the-arcgis-platform); 2. To Install the ArcGIS for Office on a Microsoft Office site, please follow these [instructions](https://doc.arcgis.com/en/office/install-and-configure/install-on-a-single-computer.htm); 3. When the installation is completed, please make sure to [configure ArcGIS for Office.](https://doc.arcgis.com/en/office/install-and-configure/configure-esri-maps-for-office.htm) ## 3. What can you do with ArcGIS Locator in ArcGIS for SharePoint? - You can display the locator on the search bar; - You can search what3words address; - You can use the autosuggestion functionality on the search bar to find the right what3words address; - You can convert a what3words address typed on the search bar to a point feature on the map (convert to coordinate); - You can geosearch the what3words field from a layer; - You can use the what3words field to geotag a SharePoint document. ## 4. Create a map on a SharePoint page ![ArcGIS for SharePoint - edit page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/934cb1a83173f7318db52b86d7101fb2e70bec3c1e91b4a3f8945b57a454f248.png) Choose a page on which you want to insert an ArcGIS for the SharePoint web part. Click on the **Edit** button on the top right side of the page. ![ArcGIS for SharePoint - Add new web part](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3768920848d7d320021441ba018919ce63d378a92585c794ffca57a30c23c6fa.png) Click the location on the page where you want to insert the ArcGIS for the SharePoint web part. ![ArcGIS for SharePoint - add-arcgis-to-sharepoint](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d1fcd45b76b1011854c8aadd644241a4c68a14e71b26419ce6a80a0c26f8a9d7.png) Search for the ArcGIS Maps integration and select it. ![ArcGIS for SharePoint -sign-in-to-arcgis-online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cb0979124963521ddb530eb2fd76e7cb9b96a8b7e2833b6ce03f22215eaa9294.png) The ArcGIS for SharePoint web part appears on the page, prompting you to sign in to ArcGIS or continue in the standard experience. **Note:** If an error message pops up saying that the app is not configured, your SharePoint administrator needs to set the credentials to enable the app for use. ![ArcGIS for SharePoint-signed-in-load-layers](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b0ece3b4a6d82376ebb0608b2567da089d2fed92a6151aeda90cd4c7aa7a0e39.png) Sign in to an ArcGIS Online or ArcGIS Enterprise account to have the privileges to create, analyse, and share content. The map loads using the default basemap and map settings. To save the SharePoint page, click on **Save as draft**. ## 5. Add data from SharePoint ![ArcGIS for SharePoint-add_georeferenced_sharepoint_doc_with_coord](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c65850c9c7f89b17d12c51b98048ddc6d3fc2d4da3f46977b2ff1e2351059799.png) With ArcGIS for SharePoint, you can add spatially enabled lists containing addresses or place names, or lists containing coordinate data, to a map. Once added, they become layers in the map. **Note**: Currently, the what3words address field is not recognised as a spatial field. Turn the **Edit** mode on the site. Then, from the map tools, select the Layers icon. A panel will appear with 2 choices: Add from SharePoint(**+SharePoint**) or add from ArcGIS(**+ArcGIS**). Pick **+SharePoint** to display the available lists in the current SharePoint site. Lists that are not spatially enabled appear inactive at the bottom and cannot be added. ![ArcGIS for SharePoint-plot_sharepoint_files_with_coords_on_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b782ce154dfcd8d701455a3917f9255c15ac3d0dd244c3cf71dca12ebaa7a14b.png) Once you have the list you want to add, click the **Add** button next to the list title (+).  A layer containing the data is added to the map, and the map view zooms to display the full extent of the layer. The layer is listed in the layer list. Click the **Back** button when you have finished adding layers from SharePoint to return to the layer list. ## 6. Add data from ArcGIS ![ArcGIS for SharePoint-add_arcgis_content_from_arcgis_online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/be561f890f67b4a640a12821b55f94b2658b9c8e415fad3d0fc3a9b4a91ddb85.png) Turn the **Edit** mode on the site. Then, from the map tools, select the Layers icon. A panel will appear with the 2 choices above-mentioned, this time pick Add from ArcGIS(**+ArcGIS**). Search for a layer or a web map to add to the map from the drop-down menu, or type one or more keywords in the Search text box and press Enter. Once you are happy with the service you want to use, click its Add button (+), next to their name. A layer or web map containing the data is added to the map, and the map view zooms to display the full extent of the layer. The layer is listed in the layer list. Click the **Back** button when you have finished adding layers from ArcGIS Online to return to the layer list. ## 7. Use the what3words locator on Sharepoint site map ![ArcGIS for SharePoint-display_locators_on_search_bar](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c592c809b5bca290e105f6995a56770aa7d24a0b86fdd5fefe05cc20994a4457.png) Go to the search icon on the left-hand side of the map. The what3words locator will appear along with the default ArcGIS World Geocoding Service. Follow these [instructions](https://developer.what3words.com/tutorial/using-the-what3words-locator-across-the-arcgis-platform) if you haven’t shared the what3words locator across the ArcGIS Platform. ![ArcGIS for SharePoint-w3w_search_and_autosuggestion](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f3ad18db6b946504f4de63b5ceace957f09bcde1c6c579305ab333244ef28a3d.png) You can type any what3words locator on the Search input bar. An Autosuggested list of what3words addresses will appear after start typing the first letter of the third word. ![ArcGIS for SharePoint-convert_to_coordinates](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/112014e2a4b5fda1161c12db1b9ffd084d71d76e13e105787188a942fc6aabdf.png) Click on the what3words address that you were searching for, and a point will appear on the map with a pop-up with the search result. ## 8. Geotag and geosearch ![ArcGIS for SharePoint -geotag_w3w_field_on_a_layer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c35b8418888cec57a621901a74ea08660607bd4fa60443becfec007d0dadf37e.png) ArcGIS for SharePoint offers a new feature that enables users to geotag SharePoint documents by using attributes from referenced layers. You can perform a **geosearch** to quickly find documents not only in your SharePoint site collection but also across your organisation based on a location on the map or attributes assigned to the documents as geotags. By adding a SharePoint document with a set of coordinates and a related what3words field, you could select the what3words attributes as shown in this example. ![ArcGIS for SharePoint-geosearch_w3w_field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d15ab515030187a9e87c10712511ca1fbb4745bc44a5a712f9a91c5dc5150b96.png) Then you could make sure you can **geosearch** on the what3words attribute by checking the **Show search results from** the SharePoint document with the what3words attribute. ![ArcGIS for SharePoint-type_w3w_in_geosearch](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/59a8133353cda4a024c94241b20c485506862e8616df7f79b0dd6c983fe5c637.png) Now you will be able to display this SharePoint document on the search input box. If you select this document, you will be able to **georesearch** specifically your what3words attributes that are on the document. --- # How to add the what3words Locator to ArcGIS Online and Field Maps Adding the what3words Locator to ArcGIS Online and setting up a survey for Field Maps. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-arcgis-online-and-field-maps Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS Locator to ArcGIS Online followed by the steps to create a map for ArcGIS Field Maps. Further information on the features of the Locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the locator in ArcGIS Online takes a few minutes. Once set up it will be available across the ArcGIS Online suite. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the what3words Locator to ArcGIS Online Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Creating a survey with a Map on Desktop ![ArcGIS Field Maps - open the app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5c231bcd7ffaec7f430be480f9e18be30b869bafdaa6c95f2ca576038772a617.png) To use what3words in ArcGIS Field Maps, please go to ArcGIS Online or ArcGIS Enterprise and click on the app icon on the navbar as shown in the image. A list of ArcGIS apps will appear and you should see the ArcGIS Field Maps icon within the list. If it doesn’t appear you may need to check you have a licence available. Click on this icon to go to the ArcGIS Field Maps Desktop application. ![ArcGIS Field Maps - make maps available online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/01c330380d289572642f148cd3941611b669af758a0355949f053c3a2c7afd86.png) The requirements to use what3words in ArcGIS Field Maps are: - Data must be available on ArcGIS Online or ArcGIS Enterprise; - Data must include a basemap; - Data used in a map enabled for editing must include at least one editable layer; - (Optional) Layers must be enabled for offline use; - what3words ArcGIS Locator must be shared among the organisation on ArcGIS Online. Here is an example where a map has been successfully made available online and users should be able to display it on the ArcGIS Field Maps desktop application. It also appears on the mobile application. Then click on the available Map. ![ArcGIS Field Maps - create form](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/130c671821b2342d62720a16e4e1643e7e000b61fecf8688c375edec409de051.png) On the ArcGIS Field Maps Desktop App to collect information in specific fields, users need to add these fields to a form. To locate this form, go to **Contents > Layers,** then click on the layer. In the middle of the webpage, start configuring the form by adding or dragging the required fields for data collection. The fields are displayed on the right-hand side of the screen. One of the fields specified in this example is the what3words address that users will need to paste in the address. Then click the **Save** button in the top right corner. ![ArcGIS Field Maps - form with w3w field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/499641b93e3c82684c51ea6e08bfc30f43286afe25b7fefb227f9b24cc8803a3.png) A form should now appear. ![ArcGIS Field Maps - w3w field on the form](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/82ec3cce70762f20a10e2a3b90b7d4a3cb739de25f66a55c5b5e88db147d3ff2.png) The what3words address field on the form should be a String field. Additionally, users should make sure that the “Allow editing” checkbox is checked to be able to edit the field as necessary. ## 4. Display a survey on Mobile Open the Field Maps mobile application, log in using your ArcGIS Online login and open the map with the editable layers uploaded on it. Currently, the what3words ArcGIS Locator features that are available on the ArcGIS Field Maps mobile application are: - Convert to coordinates; - AutoSuggest; - Convert to 3 word address; ![ArcGIS Field Maps - convert to coordintates](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5abee6b581b58aff746bedc5c97bfd608f74a1a8bcdd8678ed736c760a1b7942.jpg) **Convert to coordinates** Tap on the search icon on the right side of the navbar at the top of the mobile application. Type a valid what3words address in the search bar. Tap on the what3words address to drop a pin on the map to obtain the coordinates. ![ArcGIS Field Maps - w3w autosuggest](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e0e65233449963034d91ff51d259f68f0e52c2d1dd4cbbbc2615d6dc74a9c7af.jpg) **AutoSuggest** When typing a what3words address on the search bar right after the first character of the third word, e.g. filled.count.s, a list of suggested words appears below the search bar. ![ArcGIS Field Maps - tab on screen](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/377a672defb848998a7194f7a99496914f0bb4a9cdeb1303bd84706c6509fffe.jpg) **Convert to 3 word address** Alternatively, users can press and hold the map to get the 3 word address for a point on the map. At this point, to collect this location, users can press the **Collect Here** tab, below the what3words address. Currently, what3words address isn’t recorded automatically when users collect data with the Field Maps mobile app. The only location recorded is the coordinates. ![ArcGIS Field Maps - press and copy w3w address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/179cec9dfba5d1558c1b04c369188afef934c532cfd9c2fe082c3e1db81b1402.jpg) To overcome this issue, users can add an extra field to the layer that would be uploaded to the ArcGIS Online Map and used for data collection. This extra field must be a **String** field type and is used to paste the what3words address that appears on the Field Maps mobile app. To copy the what3words address on the application, press on the address. A pop-up “**Copy**” will be displayed on top of the address, tab on it to copy the address. ![ArcGIS Field Maps - paste w3w address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/6f35304ba72b4373d17bdcaab9f7763c1da4354c704188de22edefb00600c05b.jpg) Then select **Collect Here**, and the predefined form, that has been created previously on the Field Maps Desktop application, will be displayed below the point just collected. As mentioned previously, users need to add an extra string field to their form to be able to paste the what3words address and then plot this layer on the ArcGIS Maps using the what3words address as a location. Paste the what3words address previously copied and then press **Submit** in the top right corner of the navbar. > [!NOTE] > **Note:** > Currently, what3words ArcGIS Locator does not work offline on the Field Maps mobile app. A workaround would be to still use the application offline, after making the map and layers available offline, and then add the what3words address later when back online. ## 5. Troubleshooting If after installing correctly the what3words locator across your ArcGIS platform, you cannot display 3 word addresses in the ArcGIS Field Maps mobile app, it could be that the what3words locator hasn’t been put at the top of your Geocoding services. Currently, in the ArcGIS Field Maps mobile app if you have installed more than one locator you can display only the one that it is listed at the top of the **Organisation > Utility services > Geocoding** section. As it is shown on this screenshot the ArcGIS World Geocoding Service is at the top, above the what3words locator, so I would only display the address returned by the ArcGIS World Geocoding Service. To resolve this issue, please drag-and-drop the what3words locator at the top of the Geocoding service list to display 3 word addresses on the ArcGIS Field Maps mobile application. ![ReOrdering Geocoder in ArcGIS](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9b160be41e9b9cb4eb981cf952200a21238e101c2d1240178a954d2cc5c65281.w1600.webp) --- # How to add the what3words Locator to Experience Builder for ArcGIS Adding the what3words Locator to a custom ArcGIS Experience Builder widget. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-experience-builder-for-arcgis Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS Locator to a custom widget built using [ArcGIS Experience Builder](https://developers.arcgis.com/experience-builder//). This widget will help you to perform reverse geocoding (convert a point to a what3words address) on your ArcGIS Online or Portal for ArcGIS via the [what3words ArcGIS locator](https://developer.what3words.com/tools/gis-extensions/arcgis) and the what3words API key. By using the what3words API key, you can display the what3words Grid. Further information on the features of the Locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the locator in ArcGIS Online takes a few minutes. Once set up, it will be available across the ArcGIS Online suite. **Resources:** The what3words ArcGIS Experience Builder widget is available in our [GitHub repository](https://github.com/what3words/w3w-arcgis-experience-builder-widget) ## 1. Get API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Prerequisites - An installed and configured instance of [ArcGIS Experience Builder (Developer Edition)](https://developers.arcgis.com/experience-builder/guide/install-guide/); - A URL of your what3words ArcGIS Locator that has been added to your ArcGIS Online or your Portal for ArcGIS by following this [instruction](https://developer.what3words.com/tools/gis-extensions/arcgis) on the what3words developer site; - A copy of this widget `what3words`. ## 3. Installation & Configuration ![exp-builder-arcgis](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2a698758241babc2d73232316be29242d0151c2b6c17d3b4fd44fba688939175.png) - Deploy the widget by copying the `what3words` folder and its contents into your ArcGIS Experience Builder installation’s `client/your-extensions/widgets/` folder and restart your watcher; - Run both [ArcGIS Experience Builder server](https://developers.arcgis.com/experience-builder/guide/install-guide/#server-install) and [ArcGIS Experience Builder client](https://developers.arcgis.com/experience-builder/guide/install-guide/#client-install) in 2 separate terminals; - Create your [Experience Application](https://developers.arcgis.com/experience-builder/guide/); - Create your experience application with a base map. You can now add the what3words widget to the map, on the side, or whichever you prefer. You can search the `what3words` widget by typing its name on the search bar at the top of the list of widgets or looking for the widget on the list. ![ScreenShot-03-drag-and-drop-w3w](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/56eab9dbfe887a76d54fd11b36c616ea5d1e04ea42924aef2d1474a82319792c.png) Once you have found it you can drag and drop the widget onto your application whichever you prefer, next to map, on top of it or at the bottom of it. On the widget, you can display the what3words address, the coordinates in WGS84, the copy and mapsite buttons, and the map annotation of the address. On the Content panel of the widget on the right-hand side, you have 3 sections: 1\. Select a map that you want your widget to work on; 2\. Select your Mode Selection by using the: `what3words API key` or `what3words Locator URL` If you choose the API key, you need to enter your what3words API key. Click `Save` and then choose your `what3words language`. If you choose the locator URL, you can `Select Utility`. Search among your locators on your ArcGIS Online account and pick the one you want to use. 3\. Display some widget options: - The Latitude & Longitude coordinates options allow you to display the WGS84 coordinates of the related what3words address; - The Copy button allows you to copy the what3words to your clipboard; - The Mapsite button allows you to open the what3words address to the mapsite [www.what3words.com](http://www.what3words.com); - The Map Annotation allows you to display the label of the what3words address next to the marker; - The Nearest Place Text is only available if you choose the API mode and display the nearest places for that what3words address. ![ScreenShot-06-settings-page-for-api-mode](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ab1e8ffb3fda10ee6607df8b11d233d7466f2985177fa971b1a03258f7ba3136.png) ### API mode When users select the API mode, a checkbox `Display Grid` is shown on the what3words widget. If checked, users can display the grid while panning around the map. The what3words grid is added to the map as a layer and visible within the Group of Layers if this feature is enabled on the basemap. The grid will be displayed only at zoom levels where the what3words squares are appropriately visible within the grid. ![ScreenShot-04-set-locator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d30189c4e9398a18bc5def2bf40624c140996db98c70c867cad958bc40860e63.png) ### Locator URL mode Configure the widget with your `what3words Locator URL`. By using the what3words locator, you can retrieve the correct what3words address in any coordinate systems used on your web map. Example of a what3words Locator: `https://utility.arcgis.com/usrsvcs/servers//rest/services/what3words_EN_English/GeocodeServer`. ![ScreenShot-06-locator-arcgis-online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b1b09cc85b86b7a4987b7ce97c6454cb7c02f9a022182911196b7b96a7e490e3.png) To find the what3words Locator URL, go to your ArcGIS Online or Portal for ArcGIS, and click on the `Content > My Organization` tab. Search for your locator, you could filter by `Item type > Tools > Locators` as shown on this screenshot. ![ScreenShot-07-arcgis-online-locator-url](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/80b18e963b0e2e0d75857c9f480232ff790ce4091c668ccb2e82b4aaa825b657.png) Then click on your Locator, scroll down to the bottom of the page, and on the right-hand side, you will find the URL of your Locator. You need to ***copy and paste this URL to the configuration page of the what3words widget***, as shown in this screenshot. ![ScreenShot-01-show-final-widget](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d89b90f2bdfd2b56bc9d754be54a9c05325d57e37d37f40d4b37088d3028bf58.png) The widget is now ready to run inside your Experience Builder app. Click on the map to retrieve the what3words address at the clicked location. For example, the point selected on the map returned this what3words address: `///filled.count.soap`. ## 4. Troubleshooting If after installing correctly the what3words locator across your ArcGIS platform, you cannot display your what3words locator on your Experience app, it could be that your what3words locator hasn’t been put at the top of your `Geocoding services`. To resolve this issue, please drag and drop the what3words locator at the top of the Geocoding service list, as it is shown in this screenshot. You can find this list under your `Organisation > Utility services > Geocoding section`. ![ScreenShot-05-troubleshooting-w3w-locator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/6cc2c986371b71a8bd67cf0506cdc990ea925b13029bdd386760c3060c5b5eea.w1600.webp) --- # How to add the what3words Locator to Portal for ArcGIS Enterprise Adding the what3words Locator to Portal for ArcGIS Enterprise. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-portal-for-arcgis-enterprise Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS locator to Portal for ArcGIS Enterprise. Further information on the features of the locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the Locator in Portal for ArcGIS Enterprise takes a few minutes. Once set up it will be available across Portal for ArcGIS Enterprise and any product that connects to it such as ArcGIS Pro and Survey123. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Prerequisite Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Troubleshooting ### Error 402 payment required If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### I get an error when I add the locator to the old version of the Portal since the instructions are slightly different. To add the locator as an item from the web to an old version of the ArcGIS Online Portal, users must select “ArcGIS Server web service” as a type. Add the latest version of the what3words ArcGIS locator URL, e.g. [https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_EN\_English/GeocodeServer](https://arcgis.what3words.com/v2/arcgis/rest/services/what3words_EN_English/GeocodeServer). Also, select the “**Store credentials with service item. Do no prompt for authentication**“. ![ArcGIS - old version of ArcGIS OnlinePortal](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3fbfdb51c6de7c6bcbbf7ab078b0af3ee18dd2cc796066e242d5af69b2cee8df.w1600.webp) ### I get an error when adding the Locator as a Utility Service for my Organization The what3words Locator must be shared with your Organization to add as a utility service. To share, you will need to go to the Locator Content Item and click “Share” (see step 3). Additionally, we’ve seen a bug in some versions of Portal where a Locator must first be shared publically, then added as a Utility Service and then set back to Organization only (Setting to Organization before adding as a utility service results in an invalid service warning so this workaround is required). ![ArcGIS Online - Share Locator with Organization](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ba396790c83c927c83983ada9e291074beda8446f7542189d8745fcb03a7472e.w1600.webp) ### I've added the Locator but no 3 word address are found when searching If no 3 word addresses are found when searching in the ArcGIS search box then this could mean that the password supplied for the what3words Locator is incorrect. The password should be your what3words API key when adding the Locator as a Content item (see screenshot). ![ArcGIS Online - Add credentials](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/aeaa5caaef1464e24e2fc07fdd3e3506449c7c8f10100e0cb4784d82f796858f.w1600.webp) ### Each time I search for a 3 word address I am prompted for credentials If you have created a Web App and find that each time you search for a 3 word address you are being prompted that you need to add a username and password then you will need to ensure that you select the checkbox to *store credentials with service item and do not prompt for authentication* when adding the content item (see screenshot). The item previously added will need to be removed and readded with this option enabled to prevent the credential dialogue from appearing. ![ArcGIS Online - Add w3w locator url](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1c9a9f984e39ff89bd4bda41ba9af61240643eff2034d63385e417ca5e178212.w1600.webp) ### I get a time out error when adding the Locator to Content This most likely means that your server firewall is blocking requests to our Locator. Ensure that our Locator is added as a trusted server and allowable origin: `Organization -> Security -> Trusted Server and Allowable origin`. Ensure you click save to store changes. If you put the what3words Locator URL in a web browser and see a timeout then this may mean that the server’s firewall is blocking requests and your IT department may need to add an exception to your firewall. --- # How to add the what3words Locator to Web AppBuilder for ArcGIS Adding the what3words Locator to a custom Web AppBuilder widget for ArcGIS. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-add-the-what3words-locator-to-web-appbuilder-for-arcgis Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS Locator to a custom widget built using Web AppBuilder for ArcGIS. This widget will help you to perform reverse geocoding (convert a point to a what3words address) on your ArcGIS Online or Portal for ArcGIS. Further information on the features of the Locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the locator in ArcGIS Online takes a few minutes. Once set up, it will be available across the ArcGIS Online suite. **Resources:** The what3words Web AppBuilder widget for ArcGIS is available in our [GitHub repository](https://github.com/what3words/w3w-arcgis-webappbuilder-widget) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Prerequisites - An installed and configured instance of [Web AppBuilder for ArcGIS (Developer Edition)](https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm); - A URL of your what3words Locator that has been added to your ArcGIS Online or your Portal for ArcGIS by following this [instruction](https://developer.what3words.com/tools/gis-extensions/arcgis) on the what3words developer site; - A copy of this widget is available in our **[GitHub repository](https://github.com/what3words/w3w-arcgis-webappbuilder-widget)**. ## 3. Installation & Configuration ![Screenshot-00-create-new-app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/fca627b608da6cc4b653284834133573e97343c04a09f9bd55e3dfd377fb920e.png) 1. To deploy the what3words widget, you need to copy the`what3words` folder and its contents into your Web AppBuilder installation `client/stemapp/widgets/` folder.  Our what3words widget is available in our [GitHub repository;](https://github.com/what3words/w3w-arcgis-webappbuilder-widget) 2. Then start the Web AppBuilder server on your terminal. Please follow this [instruction](https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm) if you are new to it; 3. Now you are ready to create your [own Web Application](https://developers.arcgis.com/web-appbuilder/guide/build-your-first-app.htm); ![ScreenShot-01-add-what3words-widget](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b663e01648ba7a4e204e6dd772dd62e801fa8f63d475058e9429ea25c4502002.png) After you have created your web application, you can now add the what3words widget to it by clicking on any of the empty widgets on the left-hand side. ![ScreenShot-02-select-widget](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e17e7f7ee268e54482e77a6384fea4167c5dbecc1e6993a21c313b8447650aaf.png) A list of widgets will pop up. You can search the `what3words` widget by typing its name on the search bar at the top or looking for the widget on the list. Once you have found it, please click on it. If the widget has been selected correctly, a tick will be shown on top of the icon of the widget. ![ScreenShot-03-config-with-locator-url](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/73d086e12b65adb89aa5d3d9ca862041a31b2af7846b01fc045c76d825bdf16b.png) Configure the widget with your `what3words Locator URL`. By using the what3words locator, you would be able to retrieve the correct what3words address in any coordinate systems used on your web map. Example of a what3words Locator: `https://utility.arcgis.com/usrsvcs/servers//rest/services/what3words_EN_English/GeocodeServer` ![ScreenShot-06-locator-arcgis-online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b1b09cc85b86b7a4987b7ce97c6454cb7c02f9a022182911196b7b96a7e490e3.png) To find the what3words Locator URL, go to your ArcGIS Online or Portal for ArcGIS, and click on the `Content > My Organization` tab. Search for your locator, you could filter by `Item type > Tools > Locators` as shown on this screenshot. ![ScreenShot-07-arcgis-online-locator-url](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/80b18e963b0e2e0d75857c9f480232ff790ce4091c668ccb2e82b4aaa825b657.png) Then click on your Locator, scroll down to the bottom of the page, and on the right-hand side, you will find the URL of your Locator. You need to ***copy and paste this URL to the configuration page of the what3words widget***, as shown in this screenshot. ![ScreenShot-04-what3words-widget-activate](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1d2ab5f96e863b689b9ff1ea3e1303cc31b9aa0b45a9a1b6acb0c9931150c979.png) The widget is now ready to run inside your web app. Click on the `///` button to activate the widget. A message will appear on the map: `Click any location on the map to see its whats3words address`. ![ScreenShot-05-reverse-geocode](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e33727d051d19a7361f162394e966b8df69601697e8deb3719dca88cbc36475a.png) Clicking on the map will allow you to discover what3words addresses at the clicked location. For example, the point selected on the map returned this what3words address: `///filled.count.soap`. --- # How to add the what3words to Procore Adding the what3words integration to Procore. Topics: Procore, GIS Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [Others](https://developer.what3words.com/docs/search-box/others.md) Source: https://developer.what3words.com/tutorial/how-to-add-what3words-to-procore Updated: 2026-11-27 Access the what3words online map directly in Procore to help your team easily communicate, identify and report precise locations of various assets, and coordinate operations using just 3 words. ## 1. Requirements To use this integration, users will need to log in/sign up to: - [Procore account](https://login.procore.com/?cookies_enabled=true) ## 2. What can you do with what3words iframe app on Procore? - Search, copy and share 3 word addresses - Find the 3 word address of a specific location - Get the corresponding 3 word address from GPS coordinates and vice versa - Get directions to any 3 word address - Import and export lists to CSV - Restrict the search to only show what3words address suggestions in one or more territories ## 3. Install and set up what3words app into Procore ![procore - Install app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/47a5f72faf3c10d332feaea0d9cd994f3c8a2c2844571663b973ccaadfbce7bd.png) Visit the **Procore Marketplace Listings page** at [https://marketplace.procore.com/apps/what3words](https://marketplace.procore.com/apps/what3words) to install the what3words Procore application. Alternatively, you can log in/sign up to your [Procore account](https://login.procore.com/). Click on `Install App > Install App from Marketplace`, search for the what3words app listed in the Marketplace, then click on the `Install` button. ![procore - success message](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/44cd9f03ea3d9e699d2f3fca0258dc8f7493ced132a9c8b3c21d91e04fecf3fa.png) If the installation of the what3words Procore application was successful, you should see this message with the link to the post installation tutorial, as shown on this image. You can click on the link, and you should be redirected to this tutorial. ![procore - config_unpopulated](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/24a484a513737a5e3bd8cebdd2b0575210182445e79448efde404e2c9be9d551.png) To continue with the installation of the app, close this message and the configuration page of the application will pop up. ![procore - config_populated](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/21fc0c032a641d4fecfbc6acf8cb96cbe981f95d543f7b3cbf7d4f27d7ee83c5.png) Populate the configuration file of the what3words application by: - selecting your `Projects` - entering a `Title` e.g. `what3words` Then press `Create`. Now you will be able to use the what3words application in your selected project. ![procore - select_app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/46ed0376a4ad93062313f4dda1ed8946945121a32216976a38b583f07dc3f980.png) Please switch to the project selected in the configuration file of the what3words application. Then enable the what3words app by clicking on the `Apps` dropdown menu and then select your what3words application. ![procore - mapsite_initial](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7b9adce5f86416a570b5a6630388e151e59812852a66235de33f7d1e86d8d9cb.png) Then the what3words map site will appear on your selected Procore Project. ![procore - save_locations](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/015f59c54b3872fc3c00e64056b3d1835f37ed4f9ab87da7ae8315acab07930f.png) In Procore, you could copy the 3 word address and paste it to your `Daily logs` as a `Location`. Search the address that you want to use as a location, e.g. `///filled.count.soap`. Copy this 3 word address and paste it as one of your `Locations`. Switch your `Project Tools` to  `Admin`, then click on `Locations`, you can find it on the right-hand sidebar. ![procore - daily_log_populated](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8baa724514d7ffff6c1d7feb002bf6908e633fbf130b27f92fdcd6ed5f3e1b19.png) Next, you can switch your Projects tools to `Daily Log`, add the 3 word address as a location to your daily record of significant occurrences, incidents, and progress made on a jobsite or manpower, as shown in this example. Then click `Create` to save the record on your `Daily Log`. --- # How to plot a file of 3 word addresses in ArcGIS Online Drag and drop a CSV file of 3 word address onto a map. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-plot-a-file-of-3-word-addresses-in-arcgis-online Updated: 2026-11-27 This tutorial will take you through the steps required to add a CSV file containing 3 word addresses and other attributes to ArcGIS Online using **Map Viewer Classic** so that the 3 word addresses are plotted as a point layer on the map. First, a CSV file is created. Next, this is added as a layer and styled ready for further analysis or for publishing to other users. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the what3words Locator to ArcGIS Online Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Create File ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5798f082ffff0268c27db820be087f0e380ca84328e8dd61e1625d889f6b222c.png) Create a CSV file with a column of 3 word addresses and fields of other data that can be displayed alongside the 3 word address. This can be done in Excel or a text editor. Here is an example file. ## 4. Drag on the Map ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/04ddb08209e4aa03960a73e0d85bdd321ab7a52067cf90465cea33baa751ec6c.png) Drag and drop the file from its folder in Windows Explorer/Finder onto the map in ArcGIS Online. ![ArcGIS CSV plot using what 3 words](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9b93f5a3551d03e274b2e74569e6df5b8552dd0dae0601d8858b070daa479d98.png) Select to locate features by “Addresses or Places”. Select using the what3words locator. In the field list, you will then need to select the field containing the 3 word addresses and select the what3words locator against this field. Click “ADD LAYER”. ## 5. Configure layer ![ArcGIS CSV plot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/aedcdaf6b6924a5ff47257fe11da8a7563208bb9ca5761b6a7f845063f875c40.png) This then creates a new point layer on the map with one point for each 3 word address. All other fields of data in the CSV file are carried through to the layer. The next step is to configure attributes to show on popups and the symbols to use for each 3 word address point. In the example below, we use a population field to create scaled circles. Select “DONE” to apply the symbology: ![ArcGIS CSV plot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4a337f88e8598545367d0379cef9d4b1ab7ce5dab89af17a350599d556206b3f.png) After applying the style to the layer the layer appears in the Contents pane on the left-hand side and can then be used within spatial analysis or published for other users to access or within Web Mapping Applications. --- # How to add the what3words Locator to ArcGIS Desktop Adding the what3words Locator to ArcMap, ArcCatalog, ArcToolbox within the ArcGIS Desktop. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-desktop Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS locator to ArcGIS Desktop. Further information on the features of the Locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the Locator in ArcGIS Desktop takes a few seconds. Once set up it will be available across the ArcGIS Desktop suite. **Requires ArcGIS 10.6 or newer.** Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words Locator in ArcGIS Desktop in [this video](https://youtu.be/Q-5JYh3RpK4) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Adding to ArcCatalog ![ArcGIS using what 3 words](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bdfcf394f8a5e8398f322bdbd5e5f34aea1e8cd119add4df97053fbf44684605.png) Open ArcCatalog and in the Catalog Tree expand “GIS Servers” and select “Add ArcGIS Server.” ![ArcGIS using what 3 words](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bb0a830ac7bff8c3fbfbfd9bca84d74f9f185e70c55d8b23355d2922ed2f26f4.png) In the popup “Use GIS services” ![ArcGIS setup](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a6b028c72861bb2e0988f8a6ac5200f29ff8e33ff2035ab860b80d5f11d050c2.png) On the next screen enter the following details: **URL:** Enter the URL for the what3words Locator. In ArcGIS Desktop adding the following URL will add all Languages to ArcGIS Desktop: `https://arcgis.what3words.com/v2/arcgis/rest/services`. **Username:** Your email address **Password:** Your what3words API key Select “Save Username/Password” ## 3. Using within ArcGIS Once added, the Locator can be used within the rest of the ArcGIS suite to search for 3 word addresses, discover the 3 word address for a location and batch geocode locations within the ArcGIS Toolbox. Within ArcGIS Desktop when converting to 3 word address (reverse geocoding) the Locator in the language for the 3 word addresses to be displayed should be selected. Check out our other tutorials for how to use ArcGIS Online and for further use with ArcGIS Desktop ## 4. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # How to add the what3words Locator to ArcGIS Online Adding the what3words Locator to ArcGIS Online. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS locator to ArcGIS Online. Further information on the features of the locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the Locator in ArcGIS Online takes a few minutes. Once set up it will be available across ArcGIS Online and any product that connects to ArcGIS Online such as ArcGIS Pro and Survey123. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Adding as Content ![ArcGIS Online - login](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e82860677cd5355d539b0ebbbe6ab590f995f73e8e82acf6f6c0b4d33aaac5ee.png) First login to your ArcGIS Online portal using your ArcGIS Online login. ![ArcGIS Online - New Item](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7cafe14a233f319f13260baa3031af0b025719e4506ade7785d94fae22a0b477.png) Go to the “**Content**” tab and click on “**New Item**”. ![ArcGIS Online - select URL option](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2bc62dfa48ed920bad8a0cb1981def8974ff943c1e489e45772e982ba1a950d5.png) Select from the list the “URL” option. ### List of the what3words languages supported by the Locator https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_AF\_Afrikaans/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_AR\_Arabic/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_BG\_Bulgarian/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_BN\_Bengali/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_CS\_Czech/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_CY\_Cymraeg/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_DA\_Dansk/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_DE\_Deutsch/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_EL\_Greek/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_EN\_English/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_ES\_Espanol/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_FI\_Suomi/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_FR\_Francais/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_GU\_Gujarati/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_HE\_Hebrew/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_HI\_Hindi/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_HU\_Magyar/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_ID\_Bahasa/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_IT\_Italiano/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_JA\_Japanese/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_KN\_Kannada/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_KO\_Korean/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_ML\_Malayalam/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_MN\_Mongolian/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_MR\_Marathi/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_MS\_Bahasa\_Malayia/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_NE\_Nepali/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_NL\_Netherlands/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_NO\_Norsk/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_PA\_Panjabi/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_PL\_Polski/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_PT\_Portugues/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_RO\_Romanian/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_RU\_Russian/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_SV\_Svenska/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_SW\_Kiswahili/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_TA\_Tamil/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_TE\_Telugu/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_TH\_Thai/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_TR\_Turkish/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_UR\_Urdu/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_VI\_Vietnamese/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_XH\_IsiXhosa/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_ZH\_Chinese/GeocodeServer https://arcgis.what3words.com/v2/arcgis/rest/services/what3words\_ZU\_IsiZulu/GeocodeServer Copied ![ArcGIS Online - Add w3w locator url](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ecdb68e31d0b15d50bc82dad2f8b165123cc22a067786f6c69c47f0f0d9879ee.png) Enter as **URL** the following URL for the what3words locator. There is a different URL for each language or one containing all languages. The English URL is `https://arcgis.what3words.com/v2/arcgis/rest/services/what3words_EN_English/GeocodeServer`. Next, Select “ArcGIS Server web service” as the **Type**. **Select store credentials with service items and do not prompt for authentication.** Then click **Next**. ![ArcGIS Online - Add credentials](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ee3349180728a4b477dd168cfc31cf627ccf8f5c84abdd08e682d5d56626e4c4.png) **Username:** Your email address **Password:** Your what3words API Key Then click **Next.** Change the Title and Tags for the geocoding service if required. ## 3. Making available to your team ![ArcGIS Online - Share Locator with Organization](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f0c77ac4152ff7fb06cb1a2db16efce9a5fd0fec6796f3090fc5a3d9b643b718.png) You will need to ensure that the content item is shared with all the users who need to access the Locator. For example, you may need to click “**Share**” and select the whole “**Organization**“. ![ArcGIS Online - Locator added to Geocoding utility](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/18d14b680933a39b23bfdf9c00498048949753ed2944dd23474ac9888f8b581c.png) You will need to be an ArcGIS Administrator to add to your whole organization. 1\. Go to the “Organization” tab; 2\. Click the “Settings” tab; 3\. Select “Utility Services” from the left-hand menu; 4\. Under the “Geocoding” section, select “Add Locator”. ![ArcGIS Online - Add Locator from existing urls](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/917cf59845a239d94c2c22b991640fe4a0fbdf31dfb4ec4d8c57cbb317473e81.png) After clicking “Add Locator”, select “From Existing Locator”. For “Locator Item” select the new Locator from the dropdown. You can change the Locator name and placeholder text if required. Alternatively, select “From URL” and specify the URL of the Locator Content item added in the previous step (to get this URL click on the Locator in Content and on the Overview tab copy the URL in the bottom right). ![ArcGIS Online - Locator on utility](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e1ffc320ed0143d0b9c68b3d6f03dc9397a00167e8429f06eda6ffdf973d08b8.png) The new Locator will now appear in the list of Locators. ![ArcGIS Online - Map viewer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d6b2403abe327734e3004607dba7f45312621714f75959aaec48cad79bda730d.png) To verify the Locator is now working, go to the ArcGIS Online Map Viewer Classic by selecting the “Map” tab and from the search dropdown **what3words** should appear in the list. ![ArcGIS Online - Locator on New Map Viewer](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cb1d70b57836294ee596274a19690ecad1c95d9d0ee61e4e661b765e088290de.png) In case users open the “Map” in the new ArcGIS Online Map Viewer, to display the what3words locator, click on the search icon on the right-hand sidebar, the search bar will appear at the top and from the search dropdown **what3words** should appear in the list. ## 4. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). Make sure that the Locator is shared with your whole organization. See step 3 above – go to the Locator Content Item and click “Share”. When you are searching for a 3 word address if no addresses are found then please ensure you are using your what3words API key. --- # How to add the what3words Locator to ArcGIS Online and Survey123 Adding the what3words Locator to ArcGIS Online and setting up a survey for Survey123. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online-and-survey123 Updated: 2026-11-27 This tutorial will take you through the steps required to add the what3words ArcGIS locator to ArcGIS Online followed by the steps to create a survey and open it in Survey123. Further information on the features of the locator can be found [here](https://developer.what3words.com/tools/gis-extensions/arcgis). Setting up the locator in ArcGIS Online takes a few minutes. Once set up it will be available across the ArcGIS Online suite. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. You will need a what3words API key to complete this tutorial. Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Creating a survey with Address and Map fields ![Survey123 - address field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/42506e815619c78700e32db4baae5e0cdfba6a78ae18bc5bcf3277d2c1738add.png) To use what3words in Survey123 go to [https://survey123.arcgis.com](https://survey123.arcgis.com) and create a new survey Add a new `Address field question` type. It helps users complete an address as they type. ![Survey123 - Edit locator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/051f490b3b7d44d43991dfe3b214e73fbca90706a35652be56d94599df038e75.png) You can now configure your address question with the what3words locator.  Give the question a label, e.g. `what3words Address`. To choose your organisation locator, click on `Edit` as it is shown on the image. **Note:** the what3words locator must be shared within the organisation to be seen here. ![Survey123 - choose locator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/520b094cfaae2fd7b4a8bf18eba322675515745164861f14580453e316710d0d.png) You can choose your what3words locator or a combination of different locators shared within your organisation. After you have checked your what3words locator, click `OK` to go back to the form. ![Survey123 - Config of address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/566fd4c6a83630f9f4f9b9f5422e2ceca2957b6ff5792fc3c53cda5564289de9.png) You can configure your `address question` type by choosing: - a hint `e.g. filled.count.soap`, - a default value `filled.count.soap`, - what data to submit, address text and point geometry, or only address text. - a locator or multiple ones; - the number of results per locator (**note:** we recommend having only 3 results) - a type of validation - to cache the answer **Note:** Only one map or address question can submit geometry to the survey. If some multiple questions or maps want to store the geometry, an alert message will pop up to allow you to choose only one question. When you are happy with your configuration of the address question, click on `Save`. ![Survey123 - add map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7ab8887f394a0bf6dd6ea824759215f3e86c4350896cb37b07587a9dc31a7cab.png) You can add a new `Map field` type and give a label to it. Now the Map field allows you to choose the locators shared within the organisation. Choose what3words locator or a combination of the locators available to you. ![Survey123 - map expression](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7fdbc57764ff735b12e975d92b93cdef0dceb6d07f6574d6e6ddd2dde31c31ed.png) With the Map field, you can also use an expression to calculate the answer. On the calculation section, you can click on `Edit`. Select a source `Question`, select the type of question in our case `what3words Address` and decide to extract data on `Match location`. ![Survey123 - save map field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5812c554bfb141433e0ab03d65187ea16615e1b92d1e82c0a8ea886e9c07d583.png) When you are happy with the rest of your configuration for this Map field, click on the `Save` button. ![Survey123- publish survey](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b55a19949333ef81c05cfac5268de6d2af97bb07e332fe1d60975d852b2418a0.png) When you are happy with your fields, you can click the `Publish` button and make this survey available to all your collaborators to use on the field. ## 4. Display the survery on Mobile Open the Survey123 mobile app, log in using your ArcGIS Online login and open your survey. ![Survey123 - search 3 word address on mobile app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e3914027ce19a8eaa2ace9dbf2e83c472973e21bbdd1974f288e32fcbedad0c4.jpg) Select the `Address question`, and it will then be possible to search for a 3 word address in the input field. ![Survey123 - match location with the address field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/289b009ae1d6ea5ffba6c4c00e748b66ff615c079bd4483d449abfa1ae45ecb7.jpg) Once a 3 word address has been selected, a map marker will be added to the Map field and the geometry point will be captured since we have added the expression: `Extract match location from what3words address`, the `what3words address` is our address question. ![Survey123 - collect point](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/adda791908e8e52949f2dfd36a94aaec84a1878d50cdb77a58cc48d0521ca2a9.jpg) Once you are happy with your results, you can click on the `Tick button` on the bottom right of your survey and publish the results of the live survey. You can see that you will be adding to the survey the what3words address and the coordinates of the point. ![Survey123 - search 3 word address on mobile](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1de0e54b6b7be78c8858be405bb5653f71afcf845f6a8245ffa00fb358812e76.jpg) You can also select the Map question, and it will then be possible to search for a 3 word address in the search field. ![Survey123 - press and hold on map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c5d3e3913bed5d92ddc76dce6cd43607a997234fcacf301d5ba46266e0591610.jpg) You can also press and hold the map to get the 3 word address when you have selected only one locator. ![Survey123 - completed survey online](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9c5f247859702901d8af0577e27168190858036a71861ee2b90096d62a948f79.png) To view the data that you have collected, go back to your live survey on the Survey123 desktop app, go to the `Data` tab and click on your records, and you will see the what3words address and its geometry point with the map. ## 5. Adding a calculated field to save the 3 word address Survey123 provides another way to save the 3 word address. It is possible to create a calculated question which will save the 3 word address by reverse geocoding the point to obtain the address. This can be done using `Survey123 connector for ArcGIS`. ### Add a Singleline Text input field ![create survey123 with singleline text](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e511b2e7138e5683153591d7c275ceff6325c9d3447d69b3d223ef4cff1872d7.png) When creating your Survey you will need simply to add - a `Map` field to extract the `geopoint` - a `Singleline Text` input field to save the 3 word address calculated from the geopoint.v ### Install Survey123 connector for ArcGIS ![Survey123 connect](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/5d7c62ef453cbcc614b4b3e3025358dff391afbaa4375fc3681a7cfe25be7730.png) If you don’t have `ArcGIS Survey123 Connect`already installed on your computer then download it [HERE](https://www.esri.com/en-us/arcgis/products/arcgis-survey123/resources?rmedium=esri_com_redirects01&rsource=https://www.esri.com/en-us/arcgis/products/survey123/resources) and install it. Once you have installed it, log in `ArcGIS Survey123 Connect` using your ArcGIS Online account. To view all of your surveys you need to click on the `Sync` button (as shown in the screenshot). Then click on the Survey that you have just created. ### Open the survey using the XLSForm ![view survey on the Survey123 Connector](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b407a845962aff0e2d49a0883a0aa619caaf52fb9f2b0d7c2238ec12182c7be5.png) Once the Survey is open on the Survey123 connector, you will be able to open your Survey as an XLS file (in your preferred spreadsheet tool such as Excel) by clicking on the `XLSForm` button. From within the XLS, you can configure things like field selectors and add custom logic such as calculated fields. Click `XLSForm` now open your survey on your preferred spreadsheet tool. ![XLSForm calculated field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/a128a17b11268ff2ec44420bc21d9b9edf4d4d336d503a2a00d097e63e22d186.png) From within the `XLSForm` you will see the `Map` field and the `Singleline text` input field that you have just added. To add a calculation to the Singleline text input field, scroll over to the `calculation` column of the spreadsheet. Against the `Singleline text` input field, which in our case is the what3words address input field, add the following: - If the what3words Locator **IS** your default geocoder then you can simply add `pulldata("@geopoint",${_map},"reversegeocode.address.Match_addr")` where `_map` is the name of your Map question described on the XLS form as a geopoint. - If the what3words Locator **IS** **NOT** your default geocoder then add `pulldata("@geopoint",${_map},"reversegeocode.address.Match_addr","replace with proxy URL of Locator")` where the `${_map}` is the field name of the Map question and `"replace with proxy URL of Locator"` are the proxy URLs of the what3words Locator that you added and stored credentials against in your ArcGIS Online Content. There’s more information about this step and obtaining the proxy URL [HERE](https://doc.arcgis.com/en/survey123/create/main/geopoints.htm). Then save your `XLSForm`. ### Update the survey from XLSForm ![Update the XLSForm](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1d1504634e7e8291d212e87882453cf5f57a6ef205e4f8077cf894e551b94b01.png) Once the `XLSForm` had been saved in your preferred Spreadsheet tool go back to `Survey123 Connector` and click the Update button (as shown in the screenshot). Now you should see that the updated file is being imported and validated. Once the import is complete, the survey will have been updated and you will need to publish the changes to see them in the app. ### Using in the Survey123 app ![Survey123 with calculated column](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c531c06ca3bc68373a0aae8d4f93f13567fb9c7030d28103666d9d803017cb13.png) Open the Survey123 app and make sure you are still logged on to your ArcGIS Online account. You will now see the new calculated field in the survey. Once you have specified the location in the Map question you will see that the field has been populated with the 3 word address. --- # Import and Plot what3words Addresses on the Map Site using a CSV File This tutorial explains how to import and organise what3words addresses using a CSV file on the Map Site, resolve common errors, and sync locations to the mobile app. Topics: Website Section: [Display Map](https://developer.what3words.com/docs/display-map.md) > [Other Map Types](https://developer.what3words.com/docs/display-map/other-map-types.md) Source: https://developer.what3words.com/tutorial/import-and-plot-what3words-addresses-on-the-map-site-using-a-csv-file Updated: 2026-11-27 This guide explains how to use the **Import CSV** and **Export CSV** features on the what3words Map Site to upload, plot, and manage what3words addresses. Once plotted, these addresses can also be accessed and viewed on the what3words mobile app. For a visual guide, you can refer to the following video: [Watch this walkthrough on YouTube](https://www.youtube.com/watch?v=yJPjocn86s0) ## 1. Preparing Your CSV File Before importing your data, ensure your CSV file is formatted correctly with the required headers. **Required Column Headers:** - `List`: Organise your locations into categories (e.g., “Personal” or “Work”). - `3 word address`: Valid what3words addresses (e.g., filled.count.soap or ///filled.count.soap). - `Label`: Add a descriptive name or note for each location (e.g., “Home Address”). **Example CSV Structure:** **CSV** ```csv List,3 word address,Label Work,filled.count.soap,Office Location Personal,index.home.raft,Home Address Other,scar.jazzy.offers,Park Entrance ``` This CSV file creates three lists (Work, Personal, Other) with one labelled location each, plots them on the map, and syncs them to the mobile app. Save your file in `.csv` format using a text editor or spreadsheet tool like Excel or Google Sheets. An example of this template can also be downloaded here is [Download Template](https://drive.google.com/file/d/1wMZyZQ8tputv5barH3tR6-NXHQPv_MHf/view?usp=drive_link) **Note:** You can also get this template by visiting the mapsite and following step 2. ## 2. Importing your CSV File to the Map 1. Open the [what3words Map Site;](https://what3words.com) 2. Log in to your what3words account. This step is essential to sync your data with the mobile app; 3. Click the Menu (three horizontal lines in the top-right corner); 4. Click “Saved Locations”; 5. Click the tree dots icon in the top-right corner of My Lists; 6. Select “Import lists from CSV”; 7. In the pop-up window: – Click “Upload CSV” button to upload your formatted file; – Or Click “Download template” to get the CSV template from the mapsite; 8. Your what3words addresses will now appear as markers on the map. ## 3. Viewing Locations on the Mobile App After importing your data: 1. Open the what3words mobile app on your device; 2. Log in with the same account used on the Map Site; 3. Navigate to the map view: Your imported what3words addresses will appear as synced markers; 4. Tap on a marker to view details, including the Label and List information you added. ## 4. Exporting Your Data If you’ve updated or modified your plotted data on the Map Site, you can export it for further use: 1. Go back to the Menu on the Map Site; 2. Go to Saved Locations > 3 dots icon in the top-right corner of My Lists; 3. Select “Export Lists to CSV”; 4. Download the generated CSV file containing these columns `List`, `3 word address` and `Label`; 5. Save this file for sharing or future use. ## 5. Troubleshooting Below is a table summarising the common errors users might encounter when importing a CSV file to save locations and how to address them: | Error Code | Message | Meaning | Resolution | | --- | --- | --- | --- | | 601, 702, 823 | “An error occurred, please contact support@what3words.com.” | A generic error occurred that is not mapped to a specific issue. | Contact what3words support at support@what3words.com for assistance. | | 824 | “CSV import would exceed maximum saved location limit.” | The number of saved locations would exceed the account limit. The Limit is 1000 saved locations. | Reduce the number of locations in the CSV file and try again. | | 825 | “Row ${rowNumber} contains an invalid 3 word address. 3 word address provided ${w3wAddress}.” | A 3-word address in the specified row of the CSV file is invalid. | Verify and correct the invalid 3-word address in the CSV file. | | 826 | “Row ${rowNumber} contains a duplicate 3 word address. Duplicate address ${w3wAddress}.” | The 3-word address in the specified row already exists as a saved location. | Remove the duplicate address from the CSV file or update the existing saved location if needed. | | 827 | “Row ${rowNumber} contains an invalid number of fields.” | A row in the CSV file has an incorrect number of fields or columns. | Ensure all rows in the CSV file have the correct number of columns as per the template. | **Table Notes** Dynamic Data in Messages: - `${rowNumber}` is dynamically populated with the row number in the CSV file where the error occurred. - `${w3wAddress}` is dynamically populated with the specific invalid or duplicate 3-word address. Default Errors: If the error code is not explicitly handled, it falls back to a generic message instructing the user to contact support. ### How to Handle Errors During CSV Import 1. **Check the Error Message** – After attempting to import your CSV file, review the error message displayed. It will indicate the specific issue, such as a problem with a particular row or a general import limitation. 2. **Understand the Error **– Use the table above to identify the error’s meaning and how it can be resolved. 3. **Correct the CSV File **– Open your CSV file in a text editor or spreadsheet software; – Remove or reorganise entries to stay within account limits; – Navigate to the row indicated in the error message (if applicable); – Make the necessary changes: Fix invalid or duplicate 3-word addresses; Ensure all rows have the correct number of fields. 4. **Re-upload the File **– Save your corrected CSV file in .csv format. – Retry the import process. 5. **Contact Support if Needed** – If you encounter errors that persist or are unclear, contact what3words support at [support@what3words.com](mailto:support@what3words.com) for further assistance. ## 6. FAQs ### Do I need an account to use Import/Export features? Yes, you must log in to your what3words account to sync data between the Map Site and the mobile app. ### Can I view imported data offline in the mobile app? You’ll need an internet connection to sync the imported data. Once synced, locations are cached for offline access. ### What if my CSV file has errors? The system will display an error message, please check the errors in the table mentioned above. Ensure your file: - Includes a valid 3 word address column; - Is saved in .csv format; - It has a limit of 1000 saved locations; - It has the current number of columns: List, 3 word address, Label; - It doesn’t contain duplicated what3words addresses. ### Can I organise locations into lists using the CSV file? Yes, use the List column to group locations by category (e.g., Work, Personal). ### Can I import a CSV file with more than 1,000 rows? No, the maximum allowed rows per account is 1,000. ### Will the imported locations sync with my mobile app? Yes, as long as you’re logged into the same what3words account on both the Map Site and the mobile app. ### Will the csv import if I have different headers column? It won’t import the what3words address on the what3words online map site if you don’t follow the .CSV template structure. The column headers should be: `List`, `3 word address`, `Label`. --- # Installing the Adobe Commerce (formerly Magento 1) extension Adding and configuring the what3words Adobe Commerce (formerly Magento 1) extension. Topics: Adobe Commerce (formerly Magento), E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-magento-1-extension Updated: 2026-11-27 ### Step by step THE MAGENTO 1 MODULE HAS BEEN DEPRECATED WITH THE END OF SUPPORT OF MAGENTO FOR V1. ## 1. Get an API Key [Sign up](https://accounts.what3words.com/create-api-key) to get your free API key. ## 2. Installation The Magento 1 Extension can be installed using Packagist or alternatively installed manually by downloading from Github and adding to your server via FTP or by performing a manual extension installation. We recommend using Composer and Packagist to install the Extension to ensure that all dependencies are installed along with the Extension. - To add the what3words Magento 1 Extension to a store using packagist, first connect to your server and start the command line interface. - From the CLI run the command \`composer require what3words/module-what3words-v1\` to install the files and dependencies required by the extension. - Next, run \`php bin/magento setup:upgrade\` to compile the site to ensure it includes the new extension We then recommend running php bin/magento cache:clean and php bin/magento cache:flush to ensure the site’s cache is cleared. ## 3. Enable module Select the store settings and a new category “what3words” will be available. Within the configuration page add the API Key. A new field will then be available on the site’s checkout page --- # Installing the Adobe Commerce (formerly Magento 2) extension Adding and configuring the what3words Adobe Commerce (formerly Magento 2) extension. Topics: Adobe Commerce (formerly Magento), E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-magento-2-extension Updated: 2026-11-27 ### Step by step The what3words Adobe Commerce (formerly Magento 2) extension allows you to add a 3 word address field to a checkout page. Store users can then add a 3 word address to orders and are provided 3 word address suggestions as they type. The user can also save 3 word addresses to their account for future use. **Magento 2 Minimum Supported Version:** 2.3, 2.4, 2.4.4, 2.4.5, 2.4.6 ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The Adobe Commerce (formerly Magento 2) extension can be installed in 2 ways: 1. Follow this [installation guide](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/extensions.html); 2. Use `Composer` and `Packagist` to ensure that all dependencies are installed along with the extension. To add the extension to a store using `composer` and `packagist`, first, connect to your server and start the command line interface. From the CLI run the composer command to install the files and dependencies required by the extension, it will pull the latest release of this plugin from this [what3words GitHub page](https://github.com/what3words/magento2-w3w-plugin/releases) **PHP** ```php composer config repositories.what3words git https://github.com/what3words/magento2-w3w-plugin.git composer require what3words/module-what3words ``` Next, to compile the site to ensure it includes the new extension run the following commands (as with any other Magento module): **PHP** ```php php bin/magento deploy:mode:set --skip-compilation production php bin/magento setup:di:compile php bin/magento setup:static-content:deploy # here set the themes to be compiled and the language php bin/magento maintenance:enable php bin/magento setup:upgrade --keep-generated php bin/magento maintenance:disable ``` We also recommend running `php bin/magento cache:clean` and `php bin/magento cache:flush` to ensure the site cache is cleared. ## 3. Enable module ![magento2 settings page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/824c333afe5c340494c7a7c4277df15dc540bdd8ecaf6b21b518bf16664c549d.png) Select the store settings and a new category `what3words` will be available. Within the configuration page add the API Key. We also recommend using a `placeholder` text with an example of the what3words address to demonstrate to users the correct format they should follow to enter their own what3words. For example, `eg. ///filled.count.soap`. Find out how can you customise your extension in the [**Additional Settings**](https://developer.what3words.com/tutorial/installing-the-magento-2-extension#additional-settings) section below. ![magento2-w3w-field-checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bc75435e01b527a0592f0d59d2b0b112ae9c6f69bb1b7cece370af95712a5bbe.png) A new field will then be available on the site’s checkout page. ## 4. Add to Address template ![magento2-config-addr-template](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b9b48676678849c2d915165574937051171f258e1ba899c2c12582051de8433.png) For the what3words address to appear on invoices, delivery labels, and packaging slips you will need to add the following attributes to the Customer Address Templates: `w3w` → the chosen 3 words address returned by the address validation and saved in the database; `w3w_nearest` → the value of the nearest place of the chosen 3 words address saved in the database. This value will be available only if the option *Save nearest place* is set to yes in the settings page of the what3words plugin. `w3w_coordinates`  → the coordinates of the chosen 3 word address saved in the database.  This value will be available only if the option *Save coordinates* is set to yes in the settings page of the what3words plugin. To get to the Customer Address Templates of your Store: `“Stores”  > “Configuration”> “Customers” > “Customer Configuration” > “Address  Templates”` Add the following to each of the templates: **PHP** ```php Text: {{if w3w}}{{var w3w}}{{/if}} {{if w3w_nearest}}{{var w3w_nearest}}{{/if}} {{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}} Text One Line: {{var w3w}}, {{var w3w_nearest}}, {{var w3w_coordinates}}, HTML: {{if w3w}}{{var w3w}}{{/if}}
{{if w3w_nearest}}{{var w3w_nearest}}{{/if}}
{{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}}
PDF: {{if w3w}}{{var w3w}}{{/if}}| {{if w3w_nearest}}{{var w3w_nearest}}{{/if}}| {{if w3w_coordinates}}{{var w3w_coordinates}}{{/if}}| ``` ## 5. Obtain what3words via Stores API In Magento, the what3words address attributes are stored in the customers’ shipping addresses of the Magento Customers and Orders REST APIs. 1\. The API request to make to the Magento Customers REST API should be: `GET {{magento_base_url}}/rest/V1/customers/{{customer_id}}` The API response should be: **JavaScript** ```javascript "addresses": [ { "id": 3, "customer_id": 4, ... "custom_attributes": [ { "attribute_code": "w3w", "value": "filled.count.soap" }, { "attribute_code": "w3w_coordinates", "value": "-0.195521 ,51.520847" }, { "attribute_code": "w3w_nearest", "value": "Bayswater, London" } ] }, ... ] ``` 2\. The API request to make to the Magento Orders REST API should be: `GET {{magento_base_url}}/rest/V1/orders?searchCriteria[currentPage]=0` The API response should be: **JavaScript** ```javascript "extension_attributes": { "shipping_assignments": [ {"shipping": { "address": { "address_type": "shipping", ... "extension_attributes": { "w3w": "///filled.count.soap" } }, ... ``` ## 6. Localising strings The what3words extension allows you to modify default strings in your custom theme to load and use [translation dictionaries](https://developer.adobe.com/commerce/frontend-core/guide/translations/dictionary#terms). Learn more about locales, modifying strings, and how the application searches and applies translations in this [tutorial page](https://developer.adobe.com/commerce/frontend-core/guide/translations/dictionary). In case you are using a PWA (progressive app) in Magento. The way to translate the strings of our plugin is mentioned in this [developer guide](https://developer.adobe.com/commerce/pwa-studio/guides/general-concepts/internationalization/). ## 7. Upgrade module To update or upgrade the what3words module: 1. Download the updated file from [Marketplace](https://marketplace.magento.com/what3words-module-what3words.html) or another extension developer. Take note of the module name and version. 2. Export the contents to your application root directory. 3. Since the Composer package exists for this module, run one of the following. Update per module name: **PHP** ```php composer update what3words/module-what3words ``` Update per version: **PHP** ```php composer update what3words/module-what3words ^x.x.x ``` Run the following commands to upgrade, deploy, and clean the cache. **PHP** ```php bin/magento setup:upgrade --keep-generated bin/magento setup:static-content:deploy bin/magento cache:clean ``` ## 8. Uninstall In case you wish to uninstall the what3words Magento plugin that has been installed by composer, you can use the following command: **PHP** ```php php bin/magento module:uninstall What3Words_What3Words --remove-data ``` ## 9. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 10. Additional settings ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. The coordinates will added to your order and visible in your Sales page on Magento. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Save nearest place If you need to capture the nearest place information for a three word address to help with delivery information, for example, you should check the *Save nearest place* checkbox. The nearest place info will added to your order and visible in your Sales page on Magento. ### Custom Label You can override the default label for the address field by selecting this option and specifying the placeholder text. We recommend you use the default label value, as it provides your customers with an example of how to use the what3words Address Field. ### Custom Placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field. ### Tooltip In order to provide guidance to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > *what3words addresses help our delivery partners find you first time. Find yours at [what3words.com](https://delivery.w3w.co/).* ### Custom Tooltip message You can override the default Tooltip explainer text that you can see when you click on the question mark icon next to the what3words field. ### Custom Error message You can override the default Error message when you enter an invalid what3words address in the input field. ### Support of RTL language You can set the HTML direction of your site using a right-to-left language on the configuration page. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field.** For most checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### AutoSuggest Focus In addition to country clipping, it is also possible to add focus to your what3words address suggestions by selecting the Autosuggest Focus feature. The AutoSuggest Focus feature uses the users’ location as focus for AutoSuggest to provide better suggestions if the store has the users’ location permission. ## 11. Support **Have any questions?** We’re here to support you! If you have any questions while using what3words, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com) --- # Adding the what3words extension to MapInfo Pro Adding and configuring the what3words extension to MapInfo Pro. Topics: MapInfo Pro, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) Source: https://developer.what3words.com/tutorial/installing-the-mapinfo-plugin Updated: 2026-11-27 The MapInfo extension brings the functionality of the what3words API to the MapInfo platform. You can use the plugin to convert from coordinates to 3 word addresses, and from 3 word addresses to coordinates by adding running a SQL query as well as searching for 3 word addresses or inspecting the map to view the 3 word address for a location. To use the what3words extension with MapInfo Pro, you’ll need to be on the **Basic plan or above**. Visit our [pricing page](https://accounts.what3words.com/select-plan) for more information. Getting started with Dazi, GIS Technical Account Manager at what3words, showing you how to add the what3words MapInfo extension in MapInfo Pro: [https://youtu.be/i16ADPTe5ig](https://youtu.be/i16ADPTe5ig) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Download the extension Download the MapInfo extension from **[here](https://what3words-mapinfo-plugin.s3.eu-west-2.amazonaws.com/what3words_v1_3.zip)**. We have currently released a new version: v1.3.0 (February 2022) with fixed issues: - Zoom distance is now set to 100 meters; - Notification will now warn you if you haven’t entered the API key. ## 3. Adding extension to MapInfo ![Open Tools button](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f9487186914835034744e59e1baf574f12ccb7a5dd050ab584c3048b7b1d359f.png) *Screenshot of tools button* Open MapInfo Pro and select the “HOME” ribbon and click on the “Tool Extensions” button to load the what3words extension. ![Register tools button](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cd102f31077cbdc0a824ab193612b8122b8d9905d63c9c40b2503b6de0fac71d.png) *Select dropdown to register tool* The Tools window should now appear. Click “Options” dropdown and select “Register Tool”. ![Select the MBX file](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/85fb868ddff560630144d26ff2c27324a204eb4b9c521d74617ac15cb8342078.png) *Select the MBX file* From the window that appears, select the `.MBX` file for the extension and give the extension a name. Click OK. ![See the extension listed](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/74ec91e1f023ab34f8259182be12b9c0afc4a95bc677f3a15f64361317825f6d.png) *The extension should now appear* The tool should now appear under registered tools. Hover your mouse over the tool and you will see the option to Load the tool and you can select whether to Autoload the extension when MapInfo opens. Click Load and the extension should now be available. ![Select autoload and load tool](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/971977452c21146a5cec341c081228115decedeb037342e97893f64f7fc2f9dc.png) *Select autoload and load tool* Once loaded a new ribbon item should appear “`WHAT3WORDS`” with the tools. Click `Settings` on the WHAT3WORDS ribbon to add an API Key. ## 4. Using the extension The plugin provides: - A map tool for interrogating the map to discover a 3 word address. - Search to find a 3 word addresses. - SQL functions to convert to and from coordinates. ![Display 3 word address button](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b651af5fc7b62f31f1a45dfd11eefb2455b442f84aeab7224f426922f39deee.png) *Display 3 word address button* Clicking “`Display a 3 word address`” provides a tool to click on the map and display a 3 word address for a location. ![Search for a 3 word address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2be7cdf04bbcced360278dfb2ee0877d859595a888bf8e09d9865b83f8a66213.png) *Search for a 3 word address* Clicking “`Search for address`” opens a window and allows you to search for a 3 word address. To run a 3 word address conversion you can run an SQL query. For example: ``` Select WGS84ToWhat3words(CentroidX(obj), CentroidY(obj)) From flpoints Into Selection ``` ## 5. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ![MapInfo - upload error](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0cc91e5d608d57893f27e0f8152a19373f361138c24b4ba657b4bd9126a6fef4.png) Users can experience this error after downloading the MapInfo Extension from the internet, extracting the content from the zip file and uploading it to MapInfo. This error is expected when some applications, notably .NET’s license compiler, will refuse to load an assembly from the internet zone. ![MapInfo - Fix Issue](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c73cb0dc79b0fab80b98ab75c6eb795dba4fb503069edfb0a193f561fdbe2937.png) The easiest way to resolve this issue is to follow these instructions: - go to your what3words zip file - right-click on the zip file and open the properties of the zip file - Check the ***Unblock*** checkbox next to the message “*This file came from another computer and might be blocked to help protect this computer*” as it shown on the image below - Click **Apply** and **OK** buttons - Re-extract the contents of the zip file again and overwrite the existing file Now you should be able to install the what3words extension on MapInfo without any issues. **N.B.** ***Make sure you uninstall any what3words extensions on MapInfo before reinstall it.*** --- # Installing the what3words AeroCommerce extension Adding and configuring the what3words AeroCommerce extension Topics: AeroCommerce, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-aerocommerce-extension Updated: 2026-11-27 ### Step by step The what3words AeroCommerce extension enables you to add a what3words address field to your website’s checkout page. With just 3 words, customers can indicate exactly where they want their goods delivered and couriers can navigate directly to the requested location. A precise delivery address means faster, more reliable deliveries and a better customer experience. **Note:** This plugin has been developed by AeroCommerce, if you encounter any problems or have any feedback at all, please [get in touch](https://www.aerocommerce.com/resources/contact) with Aerocommerce or visit [Aero Support](https://support.aerocommerce.com/) page. ## 1. Get an API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Requirements You will need to have: - [AeroCommerce developer account](https://www.aerocommerce.com/)  - AeroCommerce StoreFront ## 3. Installation ![Install w3w package](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4c18889ceb86fbd0b52b39da12c6d5c4e65d69f8898df0c01a5891db4a29b500.png) After creating a developer account, login to install the `aerocargo/what3words` package, which can be found at this [LINK](https://agora.aerocommerce.com/packages/aerocargo/what3words). Follow these instructions to correctly install it on your AeroCommerce site. ## 4. Enable module ![Configuration of installed packages](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/050fcb72887c0b05f1df18cd12da1e9eb5f24c0ddf910d4aa778f44324391024.png) Once installed, it will be displayed under the **Configuration > Installed Package Versions** section. ![Installed package](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/fec247244bf2dc3993bb0ba40e3370025c107f49fb090c22686650a38081e8c4.png) The **aerocargo/what3words** package will be displayed in the Installed Packages list. ![Settings what3words field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b1b15d1ecbdb2a46ac2d98fb0b8cce1c5725e3e8a2f2776f462f50ed218662d4.png) A what3words field will be added to the Settings page. Click on the Settings icon to manage settings. ![Add what3words field to address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/928bcf282f0466c161d630fd303a604ecdb9438deb7813ee612750b2337a15d0.png) Click on the what3words field in the **Settings** page to add your what3words API key. **Note:** If you are new to what3words, please create a what3words account and get your API key [HERE](https://what3words.com/select-plan?currency=GBP). Select the **Add To Address** box to add the what3words field to your shipping and billing address, then press **Save**. ![New order in admin section](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7219ef0ef4d93495e53121631057d49fd46f03759f86be96ad8e64006ee0dd04.png) After enabling the what3words field to be visible, go to **Order Management > Orders**  then select +**New Order**. ![What3words field - order account](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e4003ba6257cc0ebc466216f38bc0c4d65813f75f49dda232be2cc258a09080d.png) The what3words field will be displayed under the Billing and Shipping information. To make sure you can display the what3words address within the Shipping address please select “Ship to a different address” in the Shipping Information section as shown on the image. **Note**: the what3words address is an **optional field**, it will not prevent customers from filling their shipping or billing information in case they don’t have a 3 word address. ## 5. Display what3words field on Checkout page ![Checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7a10e038f031bfa18db58b09d4f7abf7c6fc986d516e3b61b0244602533ad55c.png) After creating a **StoreFront**, the what3words field will be visible to all customers on the checkout page, under the Shipping and Billing address. ![Checkout page with autsuggested field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4dd3dee6b1cdc40525a341c45c981368134a01c277b5500a87df2b0b0ade29de.png) The what3words address field is ready. Once customers input a 3 word address, a list of auto-suggested results will popup as a dropdown menu. To finalise and add the correct address, customers simply have to select the correct suggestion from the dropdown. ![What3words field on shipping address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/226d0eff52d1dd85d4f998bb5bbe7785f4ac34108b905fcecde5f16f14a10e73.png) After selecting the correct 3 word address, customers will see it on the shipping information page along with the name and address details. ![Billing address - checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ef7cf8ec40047464e3d2c30ae53edb2efc5955087b81f0d053e7370e17462881.png) Once the order is placed, customers can choose to use a different billing address than the shipping address, in which case, a what3words field will also be displayed under the billing information. --- # Installing the what3words BigCommerce app Adding and configuring the what3words BigCommerce app. Topics: BigCommerce, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-bigcommerce-app Updated: 2026-11-27 ### Step by step The what3words BigCommerce app allows a what3words address field to be added to the checkout page of a BigCommerce store. This enables customers to provide a what3words address with orders for faster and more reliable deliveries. **BigCommerce Minimum Supported Version:** the stores need to have BigCommerce’s *Optimized One-Page Checkout* enabled as mentioned in this [guide](https://support.bigcommerce.com/s/article/Optimized-Single-Page-Checkout?language=en_US). For a quick walkthrough, please watch [this tutorial](https://www.youtube.com/watch?v=qV-b7YYDs4g) Before you start, please make sure you are using the **Stencil theme**, and have ‘Optimise one-page checkout’ enabled. 1. Select:  **Settings > Advanced > Account sign up form > Address Fields > Create a New Field > Text Field** 2. In **Field Name**, write ‘what3words Address’ Once the plugin is installed this text field will become what3words-enabled. ## 1. Install the what3words BigCommerce app Go to **Apps** > **Marketplace,** then search for ‘what3words’ [GET THE APP](https://www.bigcommerce.com/apps/what3words-address-field/) ## 2. Installation process 1. Install the what3words app in your existing BigCommerce stores 2. Sign up or log into what3words to create a what3words API key 3. Once the API key has been created, select **Back to plugin site** to go back to BigCommerce 4. Click **Launch,** then select the API key you just created 5. Scroll down to **Configure basic features** and click **Save Settings** ### Additional settings ### Custom field label You can override the default label for the address field by selecting this option and specifying the label text. We recommend using the default label with “(optional)” text where possible. ### Custom placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field but it is also useful to change the address to a location in your market. ### Tooltip To provide guidance explaining what3words to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > what3words addresses help our delivery partners find you first time. Find yours at [what3words.com](https://delivery.w3w.co/) ### Restricting search results We provide a number of options for clipping the AutoSuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma-separated 2-digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box, or a polygon. **Note**:  When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field. **For most checkouts, we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form.** ### Viewing the what3words address of an order When a what3words address is captured in this field, it will be saved within the **order details** and will be visible in the order preview and shipping label screens. ### How to obtain the what3words fields using Stores API In BigCommerce, the what3words address attributes are stored as `customFields` in both shipping and billing address forms in the Orders endpoints of the BigCommerce Orders REST API. Please [follow this guide](https://developer.bigcommerce.com/docs/rest-storefront/orders#get-order) to be able to access the BigCommerce API. The API request to make to the BigCommerce Orders REST API should be: `GET https://yourstore.example.com/api/storefront/orders/{orderId}` **Note:** - Substitute your storefront domain for `yourstore.example.com`. - Substitute the `orderId` with your order number. The API response should be: { "orderId": "1", ... "billingAddress": { ... "customFields": \[ { "fieldId": "what3words Address", "fieldValue": "///filled.count.soap" } \] }, "shipping": \[ ... "customFields": \[ { "fieldId": "what3words Address", "fieldValue": "///filled.count.soap" } \] ... } ### Troubleshooting Login Issues with BigCommerce iFrames We are currently addressing a known issue where users can only log into our plugin when it’s embedded in a BigCommerce iframe through Google Chrome. Here’s a quick overview of the problem and our immediate actions: **Issue**: Restricted login capability to Google Chrome. **Actions**: - Investigating session and cookie handling differences across browsers. - Testing login functionality in browsers like Firefox, Safari, and Edge to identify specific issues. - Recommending the use of Google Chrome as a temporary workaround. Updates will be provided as our investigation progresses and solutions are implemented. Thank you for your patience as we work to resolve this. ### Have any questions? We’re here to support you! Get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Installing the what3words CubeCart extension Adding and configuring the what3words CubeCart extension Topics: CubeCart, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-cubecart-extension Updated: 2026-11-27 ### Step by step The what3words CubeCart extension enables you to add a what3words address field to your website’s checkout page. With just 3 words, customers can indicate exactly where they want their goods delivered and couriers can navigate directly to the requested location. A precise delivery address means faster, more reliable deliveries and a better customer experience. **Note:** This plugin has been developed by CubeCart, if you encounter any problems or have any feedback at all, please email [support@cubecart.com](mailto:support@cubecart.com). ## 1. Requirements - what3words field enabled (**Store Settings > Features** tab) - [CubeCart account](https://www.cubecart.com/) - CubeCart storefront ## 2. Enable module ![Select store settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9c91561863b6e112b24a66b93e5b4361bf1310ade3c3cb28257a7b7ea63ca9b0.png) Select **Settings** > **Store Settings** in the admin portal. ![Click on features enables what3words](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d38ca1b9f487fdde316a4af245221392d4f6d9c5816e8a5b3297f9c2aa613662.png) Click on the **Features** tab on the Store Settings page. To enable the what3words field, select the **Enable** box, as shown below, then press **Save**. ![Press clear cache](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/387f20a5c67b29ec44088d8d5f6c492daf0f522c4498808a103e2a437f8f2a98.png) In the top-right corner of the **Feature Settings** page, select **Clear Cache**. ## 3. Display what3words field on Checkout page ![Go to store](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7c303670d8a27996b527509eb75f8c8ed58783b28cf2754397d14894cc236ebb.png) Go to the **Storefront** section in the top-right corner of the page, to display your store. ![Go to Storefront](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8298aa8bb4621a581b147ab59af75b96069e4e86e264fd6432ffebfc9815982a.png) This is an example of what the store would look like. ![Add product to your basket](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ae308ffc9226413cb54c7a956802dd15c8527f774c3a3b65a859f499ab191252.png) Add a product to your basket. Tap on the basket icon and press the **Checkout** button. ![Checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/aa18b39d5b27daf089e4439b4b1756d05f63aac8a6fbbb148245ae79847a8b91.png) The what3words address field will be displayed under the **Billing Address** section of your Checkout page. ![What3words field component](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9a1e85a71f66278271e3d99e765f05204ee38125bb52d3b427712a99dac70786.png) The what3words address field will display a placeholder address (`e.g. lock.spout.radar`). Once customers input a 3 word address using this syntax, a list of auto-suggested results will popup as a dropdown menu. ![Extra terms and conditions](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4c1e409967617b18b275ff4b75715dfa404e468d7da7e8cee302c4d59647ad94.png) To finalise and save it in the field, customers simply have to select the correct suggestion from the dropdown. --- # Installing the what3words Ecwid app Adding and configuring the what3words Ecwid app. Topics: Ecwid, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-ecwid-app Updated: 2026-11-27 ### Step by step The Ecwid App adds a what3words address field to your store’s checkout page allowing your customers to easily enter and validate a what3words address when placing an order. what3words addresses can then be converted to GPS coordinates, which can then be passed onto delivery drivers allowing deliveries to arrive at right place and on time, giving a more reliable delivery experience for your customers. ## 1. Requirements To use this extension, you will need to log in/sign up to: - [Your Ecwid account](https://my.ecwid.com/cp/) - [what3words account](https://plugins.what3words.com/ecwid) ## 2. Install the what3words Ecwid app ![what3words Ecwid marketplace](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/80ca486e1e33365bb8c7b1e2bdfb23c8b1784290a0540f443a62e377d2ed74c4.png) *what3words Ecwid marketplace* Visit the **[what3words Ecwid App in the Ecwid marketplace](https://www.ecwid.com/apps/featured/what3words)** and select “GET” (or “INSTALL” from within your store apps page). You will then need to authorise our app to finalise the install process. ![ecwid login](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/91b6b0d8c384919d1fd4ff9d5f4288d0d8f166079eb8fc9317ea0de7e202f049.png) The next step is to log in/sign up to your [what3words account](https://plugins.what3words.com/ecwid) which will allow you to administer the app. ![Get an API key screen](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c9136a61638657ae76e3d2e32997f14e6bb71e3400007272c173c45bdabd21bd.png) *Get an API key screen* Once logged on to your what3words account you wil be able to access the app settings. You will need a what3words API key to use this plugin, as it authenticates and interacts with the [what3words API](https://developer.what3words.com/public-api). If you don’t already have a what3words API key, a message will pop up on your screen requesting you to “Get an API key”. If you already have one or more what3words API keys, you can simply select the API key that you will be using for your Ecwid store. ![Create API key](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cc06fac58dafee96c53be247ee2e24038c00af7e4600ae07d0069aa54cc06e75.png) *Create API key* If you don’t have an API key you can click the popup and follow the steps to create a new API key. ![Select API key](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/71ede9a667935cd2ed895d0b8f49b751894e45a1efbb64cd0c4dc1ced7cc9b4c.png) *Select API key* Once you have create an API key you can return to the [settings screen](https://plugins.what3words.com/ecwid/) and select the key. ## 3. Enable what3words at checkout page ![ecwid_enable_w3w_checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/520934a4e1f668d9cb43096f21fe021dcbdee91f65e1c4383be3e687f8c7e8b3.png) The basic settings allow you to customise how the what3words Address Field is configured on your site. The app can automatically add an address field for shipping information, allowing your customer to specify a what3words address for shipping address to help you locate your customers. Select the *Add what3words Address Field to my checkout pages* option for the field to appear. ## 4. Check if the field is appearing ![checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e069db476140ca6c78eb92a5bbed054b3f7808159be2b47da54e770bb62e0032.png) *checkout page* A new field should now be appearing on your checkout under the shipping address. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible on order preview and shipping label screens. ## 5. How to obtain the what3words fields using Stores API In Ecwid, the what3words address attributes are stored as `extraFields` and `orderExtraFields` in the Orders endpoints of the Ecwid Orders REST API. Please [follow this guide](https://api-docs.ecwid.com/reference/access-ecwid-api) to be able to access the Ecwid API. The API request to make to the Ecwid Orders REST API should be: `GET https://app.ecwid.com/api/v3/{{store_id}}/orders/{{order_id}}`, e.g. `GET https://app.ecwid.com/api/v3/75142703/orders/10POS` The API response should be: **JSON** ```json { "id": "10POS", ... "extraFields": { "w3w_address": "///filled.count.slap", "w3w_nearest": "Wednesfield, West Midlands", "w3w_lat": "52.599329", "w3w_lng": "-2.083533" }, "orderExtraFields": [ { "id": "w3w_address", "value": "///filled.count.slap", "customerInputType": "", "title": "what3words address", "orderDetailsDisplaySection": "shipping_info", "orderBy": "3", "showInNotifications": true, "showInInvoice": true }, { "id": "w3w_nearest", "value": "Wednesfield, West Midlands", "customerInputType": "", "title": "what3words nearest place", "orderDetailsDisplaySection": "shipping_info", "orderBy": "4", "showInNotifications": true, "showInInvoice": true }, { "id": "w3w_lat", "value": "52.599329", "customerInputType": "", "title": "what3words latitude", "orderDetailsDisplaySection": "shipping_info", "orderBy": "5", "showInNotifications": true, "showInInvoice": true }, { "id": "w3w_lng", "value": "-2.083533", "customerInputType": "", "title": "what3words longitude", "orderDetailsDisplaySection": "shipping_info", "orderBy": "6", "showInNotifications": true, "showInInvoice": true } ], ... } ``` ## 6. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error message: `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional settings ### Saving coordinates It is possible to the coordinates for the what3words address by selecting *Save coordinates* checkbox. The coordinates will be added to your order and visible in your Sales page on Ecwid. **Note:** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Save nearest place It is possible to store a nearby place by selecting *Save nearest place* checkbox. The nearest place info will be added to your order and visible in your Sales page on Ecwid. ### Custom field label You can override the default label for the address field by selecting this option and specifying the label text. We recommend using the default label with “(optional)” text where possible. ### Custom placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field but it is also useful to change the address to a location in your market. ### Tooltip In order to provide guidance explaining what3words to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > *By entering your 3 word address you make it much easier for our delivery partners to find you first time. To discover your 3 word address, visit [what3words.com](https://delivery.w3w.co/).* ### Restricting search results We provide a number of options for clipping the AutoSuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. N.B. – When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field. **For most checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form.** --- # Installing the what3words OpenCart Extension Adding and configuring the what3words OpenCart plugin. Topics: OpenCart, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-opencart-plugin Updated: 2026-11-27 ### Step by step The OpenCart Extension enables you to add a field to your checkout page that can accept 3 word addresses and provide autosuggest results as a user type. **OpenCart Minimum Supported Version**: > 2.3.x up to 3.0.x, and 3.0.x up to 4.0.x ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/e492ab1c2df50607adce7d4915c643d70d69997428cc9c0b635d834751db6e92.png) Add a what3words address field to your checkout page on OpenCart by clicking this button below [DOWNLOAD](https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=31868) Upload the file to your store within the OpenCart admin portal using the Extension Installer. ## 3. Enable plugin ![opencart-modules](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ea17fd92828ac0093b64c5f0c0166d9dffda3c75d9e073a4f524fe0e666bad31.png) Once installed, go to the admin panel section `Extensions > Extensions`, and from the drop-down select `Modules`, where you should see the `what3words` extension appear. Click on the `Edit` button, then to enable the module you need to change the status of the `what3words` module to `Enabled`. ## 4. Add your API Key ![opencart-settings-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ce9d45cedb75b42814b3d608cf0d283f82c33852544c08fa99397da2ea6154e2.png) You will need a what3words API key to use this plugin, as it authenticates and interacts with the [what3words API](https://developer.what3words.com/public-api). If you don’t have a what3words API key yet, you can quickly and easily [sign up and register](https://accounts.what3words.com/create-api-key) for one. Once you have a what3words API key: 1. Enter your API Key into the API key field. 2. Click *Save* ## 5. Check if the field is appearing ![opencart-checkout-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ba21f36912d43f4940d4bdd881285e0ac722bceb8788cd1c826723a824026f3e.png) A new field should now be appearing on your checkout under Billing and Shipping. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible in order preview and shipping label screens. ## 6. How to obtain the what3words field using Stores API In OpenCart, the what3words address attributes are stored in the customers’ orders of the OpenCart Orders REST APIs as: - `shipping_three_word_address` - `shipping_w3w_coordinatesLng` when the `save coordinates` option is enabled - `shipping_w3w_coordinatesLat` when the `save coordinates` option is enabled - `shipping_w3w_nearestPlace` when the `save nearest place` option is enabled The API request to make to the OpenCart Orders REST API should be: `GET {{your-opencart-site}}/index.php?route=api/order/info&api_token={{api_token}}&order_id={{order_id}}` The API response should be: **JavaScript** ```javascript { "order": { "order_id": "3", ... "shipping_three_word_address": "///filled.count.soap", "shipping_w3w_coordinatesLng": -0.195521, "shipping_w3w_coordinatesLat": 51.520847, "shipping_w3w_nearestPlace": Bayswater, London, ... "comment": "ship to w3w address ///filled.count.soap", ... } ``` ## 7. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error message: `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional settings ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. The coordinates will added to your order and visible in your Sales page on Opencart. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Save nearest place If you need to capture the nearest place information for a three word address to help with delivery information, for example, you should check the *Save nearest place* checkbox. The nearest place info will added to your order and visible in your Sales page on Opencart. ### Custom Label You can override the default label for the address field by selecting this option and specifying the placeholder text. We recommend you use the default label value, as it provides your customers with an example of how to use the what3words Address Field. ### Custom Placeholder You can override the default placeholder for the address field by selecting this option and specifying the placeholder text. We recommend you use the default placeholder value, as it provides your customers with an example of how to use the what3words Address Field. ### Tooltip In order to provide guidance to the customer, you can display a tooltip explainer and its question mark icon next to the what3words field. This message will be displayed on the tooltip explainer: > *By entering your 3 word address you make it much easier for our delivery partners to find you first time. To discover your 3 word address, visit [what3words.com](https://delivery.w3w.co/).* ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each polygon is what forms the suggestions provided when using the what3words Address Field.** For most checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### AutoSuggest Focus In addition to country clipping, it is also possible to add focus to your what3words address suggestions by selecting the Autosuggest Focus feature. The AutoSuggest Focus feature uses the users’ location as focus for AutoSuggest to provide better suggestions if the store has the users’ location permission. --- # Installing the what3words Shopware plugin Adding and configuring the what3words Shopware plugin. Topics: Shopware 6, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-shopware-plugin Updated: 2026-11-27 ### Step by step The Shopware 6 plugin adds a what3words address field to your store’s checkout page allowing your customers to easily enter and validate a what3words address when placing an order. **Shopware 6 Minimum Supported Version:** 6.0 or higher **Note:** This extension has been developed by [Benny Poensgen](mailto:https://github.com/vanWittlaer), if you encounter any problems or have any feedback at all, kindly submit any feedback to our Support team at [support@what3words.com](mailto:support@what3words.com). ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Requirements To use this extension, you will need to have: - a **Shopware 6 CE (minimum) self-hosted installation**. To get started on this please follow these [instructions](https://docs.shopware.com/en/shopware-6-en/getting-started). ## 3. Installation ![shopware-installation](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1e07c220815d57c39909c98f11ff56553f7d9804d9bf77501f18b42e9102ca1e.png) The Shopware 6 plugin can be installed in 2 different ways: 1\. by downloading the latest plugin zip file from this [GitHub page](https://github.com/what3words/shopware-w3w-plugin/releases) and uploading this file to your `custom/plugins` folder of your shopware project; **2\.** by installing it with composer run `composer require vanwittlaer/what3words --no-scripts`. Then go to `Extensions > My extensions` Click on the `Install` link to install the extension on your storefront. ## 4. Enable plugin ![shopware-activation](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/07637200c8591dce97c7f52f31d02b1a1f5d00adc4ca1edd28dd29c2f6c0357b.png) The next step is to activate the extension by clicking on the toggle next to the extension. It will display the extension at the top. ![shopware-configuration](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7096954d7a1dd011448a3688f921e735d79f18dc2f0c154477e06ddb4baf2ee3.png) Once activated, you will be able to configure the app by adding the what3words API key to your `Sales Channels`. Click on the `...` (3 dots) on the right side of the extension and then click on `Configure`. ## 5. Add your API Key ![what3words-add-api-key-and-save](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/2db383d6ee883f27114244d2d52fbe53dc92f50ee5f6930cc3f4add03ea1c47b.png) You will be able to access the settings page of the extension where you can enter your what3words API key. Then click the `Save` button. If you don’t already have a what3words API key, please go back up a few steps to Get your API key. ## 6. Check if the field is appearing ![shopware-checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/88075dc1b8af9ee0bc09cc209fa62cc56644fba8cd27f3120bb81e6d07c5e02f.png) A new field should now appear on your checkout under the shipping address. When a what3words address is captured in this field, it will be saved alongside your order details and will be visible on order and customer billing and shipping addresses as an additional custom field. ## 7. How to display the field on your order confirmation emails You can display the what3words address that your customers have submitted with their orders within the order confirmation email or invoice template by going to `Settings > Extensions > Email template`, for the billing and shipping address, it would be: `{{ delivery.shippingOrderAddress.customFields.what3words }}` `{{ billingAddress.customFields.what3words }}` ## 8. How to obtain the what3words fields using Stores API In Shopware 6, the what3words address attributes are stored as `customFields` in the Orders endpoint of the Shopware Orders REST API. Please [follow this guide](https://developers.shopware.com/developers-guide/rest-api/) to be able to access the Shopware 6 API. The API request to make to the Shopware Orders REST API should be: `GET {{shop_url}}/api/orders/{{order_id}}`, e.g. `GET https://shopware.ddev.site/api/orders/10004` The API response should be: **JSON** ```json { "id": "10004", ... "customFields": { "what3words": "///filled.count.soap", } ... } ``` --- # Installing the what3words Yext integration Adding the what3words integration to Yext. Topics: Yext, Website Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [Others](https://developer.what3words.com/docs/search-box/others.md) Source: https://developer.what3words.com/tutorial/installing-the-what3words-yext-integration Updated: 2026-11-27 The what3words Yext integration enriches the location data managed via Yext and is an efficient way to automatically generate and publish what3words addresses across many brands and publishing sites. It brings the basic functionalities from the what3words API to the Knowledge Graph Location entities, by converting the latitude and longitude of entity locations into what3words addresses. Getting started with Manuela, Product Manager at what3words, on this video: [Yext — How to use the what3words integration](https://www.youtube.com/watch?v=K9EHiM1HVYc) ## 1. Requirements To use this integration, you will need to log in/sign up to: - [Yext account](https://www.yext.com/users/login) - [what3words account](https://plugins.what3words.com/yext) ![yext-dropoff-map-marker](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/cef3cdbae471d57e4f3cdc25bd2f43a819197f5d3aa286a34a2e3d8f3a19db5c.png) After logging into Yext, you need to make sure to have Drop-off locations for your entities before installing the what3words Yext integration otherwise the what3words app won’t be able to populate automatically the what3words Address field in your Entities. To add these addresses, you need to select and drag the drop-off map marker of your Location Entity to a precise location of your entities entrance using the Yext map window. 1\. Tap on the map window of the location object; 2\. Zoom in and switch to satellite view to see more detail; 3\. Drag the Drop-off map marker, to the precise location of the entrance; 4\. Place the marker of the Drop-off location on your location entrance; 5\. Then `Save` your location. ## 2. What does the what3words Yext app do? - Convert latitude and longitude of the Drop-off location of each location entity into a what3words address and populate the what3words Address field; - Identify an empty what3words field and populate it in real-time with the corresponding what3words address; - If the Drop-off location of any Location entity changes, the what3words address will be updated in real-time; - The language of the Location entity will define the language of the what3words address; - Perform bulk updates of the what3words address if multiple addresses are changed. ## 3. Install and set up what3words Yext app ![yext-listing](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9ace0fdd6c10c795dea420405bf1e60a21eccddcac1901323c4f507c0a87367b.png) Visit the **Yext integration page** at [https://www.yext.com/integrations/what3words](https://www.yext.com/integrations/what3words) to install the what3words Yext application. Alternatively, you can log in/sign up to your Yext account. Navigate to the what3words app listed in the Yext App Directory, then click “**Install**”. ![yext-w3w-signup](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c963e55c0b6dbe262296ad9643f647668c8811543bc1c635445efff6f5568e3b.png) You will need to log in/sign up to your [what3words account](https://plugins.what3words.com/yext). ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ea7a75d5f26ab624c1601ad9cb28808b3a06f0019ebe23f51701810e33ed906f.png) You will be redirected to authorise the what3words application to access to the user’s entities in Yext. Click on the `Authorise` button to proceed. ![yext-congrats-page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/bd9b6e5fae8a608b84c478118ceb120b135d97f23c40fbc8f4a958364ef8d715.png) You will be able to go back to your Yext’s entities by clicking `View your entities` button on the what3words plugins page where you can enter a drop-off location (if you haven’t already done it as above-mentioned) to compute your what3words Address fields for your Entities. ![yext-apps-listing](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4b343c8d532412c6d19a4667e703b454139e89790ceb71bdc84467db04371eb6.png) Once successfully installed, the what3words Yext app will be displayed into your account under `Apps > Your Apps` section. ![yext-change-location](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/72c51a6c04b3a56ad7f6147b4fb94279faba9f5f81b878b782b06fde4705347b.png) The what3words Yext app will automatically populate the what3words Address field when the Drop-off location has been added to your Location Entities. You can find the `what3words Address` field within your `Business Details` form. **Note:** You will need to enter this Drop-off location by following the guidelines above-mentioned in order to obtain a more accurate what3words address. ![yext-move-maker](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d8b7b389e496fd781e766d3c8691043e4325c11fe420a08416c111b9a12c0b7f.png) The what3words app will automatically update the what3words Address field when the `Drop-off Map Marker` has been moved to a different position on the map or their coordinates have been updated programmatically. **Note:** We suggest moving the position of the `Drop-off Map Marker` on the map to the precise location of the entrance to get a more accurate what3words address. ![yext-diff-language](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9910cccb4678f412502017c71f007b3b7fad099cba65c594350c557a0d2a2d2f.png) The what3words app is available in the 60+ languages supported by what3words (see the full, live list [here](https://support.what3words.com/en/articles/1520194)). The language of the Location entity will define the language of the what3words address. If the language is not supported by what3words, it will default to an English what3words address. ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/79aafa4d0a0535fd8198d19119594edeac6b7daf3854e4cc58605385c423da96.png) You can change the way you want to display your what3words Address field in your Location entities: - You can move it up to the `Core Information` - You can enable it in the⁣ `Preview` form To update the Configuration of your Location entities, you will need to: - Click on the `Configuration` tab in your Entities - Select your Location entity - Click on the `View Details` button - Click on the `Fields` tab - Search for the `what3words Address` field - Drag this field up to your `Core Information` - Click `Save` - Then click on the `Preview` tab - Search for the `what3words Address` field - Enable this field on the Preview view of your entities - Click `Save` --- # Installing the what3words Address Field Plugin for WooCommerce Adding and configuring the what3words WooCommerce plugin. Topics: WooCommerce, WordPress, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-woocommerce-plugin Updated: 2026-11-27 The what3words WooCommerce app allows a what3words address field to be added to the checkout page of a WooCommerce store. This enables customers to provide a what3words address with orders for faster and more reliable deliveries. For a quick walkthrough, please watch this video: [https://youtu.be/YT5gAkxtjLI](https://youtu.be/YT5gAkxtjLI) ### Step by step **WordPress Minimum Supported Version**: 4.7 or higher [Arabic version](https://drive.google.com/file/d/1zb8wH6BW_r9Fh_IUytgCOLt7UwvDDYjs/view?usp=sharing) ## 1. Get an API Key Generate a what3words API key so you can use the app on your checkout [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installing the what3words plugin for WooCommerce Go to your WordPress Dashboard, select **Plugins**, click **Add New** then search for what3words. Click **Install** and then **Activate**. [Get the app](https://wordpress.org/plugins/3-word-address-validation-field/#description) ## 3. Locate the app Find the what3words app in your Plugins list and click **Settings**. ## 4. Add your API key Copy in the API key you created earlier and press **Save**. ## 5. Add widget to checkout page Under **Settings**, make sure **Add what3words address field to my checkout for me** is selected and press **Save**. ## 6. Troubleshooting If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional Settings ### Using custom fields Instead of letting the plugin create a field,  you can customise which field(s) to convert to a what3words Address Field by selecting *Convert an existing field to a what3words Address Field* option and providing selectors for the inputs to convert. You can use any DOM compliant query selector(s) here to specify a single or multiple fields that you wish to convert. **N.B. When using input selectors you should ensure each input field has a unique name attribute to ensure clashes do not occur if multiple what3words Address Fields appear on a single page.** If you want to add a new custom field to extend as a what3words Address Field you should first create an input field on the page you wish to add this functionality to and provide with a name, id and/or that can then use in the input selector to specify it. (Be careful when using classes as it can apply this behaviour to multiple fields.) If you want to capture the selected what3words address you should wrap this field in a form with a submit button and this will then be submitted as specified by your form. ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox. If you have added the what3words Address Field to your WooCommerce checkout and you select *Save coordinates* the coordinates for the billing and shipping address fields will added to your order and visible in your Orders page on WooCommerce. If you are using custom field(s) for the address then you the component will automatically attach hidden fields for both the latitude and longitude of the coordinates for the adddress prefixed with the name you supplied to the input field. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Adding a label For improved accessibility it is recommended that you add a label to your what3words Address Field. By checking this option and supplying some text for the label you can easily associate a label to each of your address field(s). For WooCommerce customers this option allows you to override the default label associated to the address field(s), while for custom field users this option tells the plugin to create a label field for you. ### Custom placeholder You can override the default placeholder for the address field(s) by selecting this option and specifying the placeholder text. We recommed you use the default placeholder value as it provides your customers with an example of how to use the what3words Address Field. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the overlap of the polygons is what forms the suggestions provided when using the what3words Address Field.** For WooCommerce checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. ### Viewing the what3words address of an order When a what3words address is captured in this field, it will be saved within the **order details** and will be visible in the order preview and shipping label screens. ### How to obtain the what3words field using Stores API In WooCommerce, the what3words address attributes are stored in the customers’ orders of the WooCommerce Orders REST API as a `meta_data` field. The API request to make to the WooCommerce Orders REST API should be: `GET {{your-wordpress-site}}/wp-json/wc/v3/orders` The API response should be: "meta\_data": \[ { "id": 606, "key": "\_billing\_w3w", "value": "///filled.count.slap" }, { "id": 607, "key": "\_billing\_nearest\_place", "value": "Wednesfield, W. Midlands" }, { "id": 608, "key": "\_billing\_w3w\_lat", "value": "52.599329" }, { "id": 609, "key": "\_billing\_w3w\_lng", "value": "-2.083533" }, { "id": 610, "key": "\_shipping\_w3w", "value": "///filled.count.slap" }, { "id": 611, "key": "\_shipping\_nearest\_place", "value": "Wednesfield, W. Midlands" }, { "id": 612, "key": "\_shipping\_w3w\_lat", "value": "52.599329" }, { "id": 613, "key": "\_shipping\_w3w\_lng", "value": "-2.083533" }, ... \], ### Have any questions? We’re here to support you! Get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Installing the what3words Address Field Plugin for WordPress Adding and configuring the what3words WordPress plugin. Topics: WooCommerce, WordPress, E-Commerce Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [E-commerce plugins](https://developer.what3words.com/docs/search-box/e-commerce-plugins.md) Source: https://developer.what3words.com/tutorial/installing-the-wordpress-plugin Updated: 2026-11-27 ### Step by step The what3words Address Field plugin helps you capture what3words addresses at checkout, using an address validation field. It includes support for WooCommerce checkouts as well as customised WordPress pages. Getting started with Andy, what3words Product Manager, showing how to add a what3words address field plugin to WordPress|WooCommerce in [this video](https://www.youtube.com/watch?v=tX-pF9G57yw) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ![Search to add plugin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/da900a0b97c0f3f3e3fe9d0ee5e6ef70d3eef3b35a0e0df9b967f19f615d921d.png) *Add what3words plugin* You can install the what3words Address Field plugin through the WordPress plugins page in your WordPress admin panel. 1. Navigate to the *Plugins > Add New* page 2. Search for “what3words” 3. Click the *Install Now* button. 4. Once installed, you can activate the plugin on the *Plugins* page. You can also find a link directly to the plugin on wordpress.org here: [https://wordpress.org/plugins/3-word-address-validation-field/](https://wordpress.org/plugins/3-word-address-validation-field/) ## 3. Add your API Key ![what3words wordpress plugin admin screen](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c9965d9c698b6430e50af0415494d5b1c10afc1c470b54ffef54526468afdeab.jpg) You will need a what3words API key to use this plugin, as it authenticates and interacts with the [what3words API](https://developer.what3words.com/public-api). If you don’t have a what3words API key yet, you can quickly and easily [sign up and register](https://accounts.what3words.com/create-api-key) for one. Once you have a what3words API key: 1. Click the *what3words* menu item on your wp-admin page. 2. Enter your API Key into the API key field. 3. Click *Save   svsv cn b * ## 4. Default Woocommerce settings ![wordpress plugin default settings](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7dd44d6d9554ddb6898eb6a0ac24fb92e4c8a5a52a3a0ad8db8333c491006e1f.png) The general settings allow you to customise how the what3words Address Field is configured on your site. For WooCommerce users the plugin can automatically add an address field for both billing and shipping information, allowing your customer to specify a three word address for both billing and/or shipping address to help you locate your customers with ease. By default this option is selected and if you have configured your WooCommerce plugin it will automatically add these fields for you on your checkout page. Or you can select the *Add what3words Address Field to my checkout page for me* option. ## 5. Check if the field is appearing ![what3words wordpress plugin on a checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ae12b1028bef5ae4edb67773a9673c2fa29d7ad315c868018551d44029f2cac4.jpg) A new field should now be appearing on your checkout under Billing and Shipping. When a what3words address is captured in this field it will be saved alongside your order details and will be visible in order preview and shipping label screens. ## 6. Troubleshooting If you find your what3words address field displayed at the top of your checkout page, and you would like to keep it at the bottom of your address form please follow this step-by-step guide: 1. Log in to your WordPress dashboard. 2. Go to Appearance > Customize. 3. Click on Additional CSS. This will open the Customizer’s CSS editor. 4. Paste the following CSS code into the editor: `#w3w-billing_field { order: 20; }` 5. Click on the Publish button to save your changes. If you are using the Free plan and have enabled the `save coordinates` feature in your plugin settings, you are making convert-to-coordinate requests, which are not supported under the Free plan. You might encounter the following errors: - You should see an error similar to `Transport error` under the what3words address field at the checkout page. - In the network panel, look for `Error 402: Payment Required`. The response to this error is: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota Exceeded. Please upgrade your usage plan, or contact support@what3words.com" } } ``` We are actively working on updating our plugins to prevent this error by disabling the `save coordinates` feature when the API key is registered under a Free plan. For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Additional Settings ### Using custom fields Instead of letting the plugin create a field,  you can customise which field(s) to convert to a what3words Address Field by selecting *Convert an existing field to a what3words Address Field* option and providing selectors for the inputs to convert. You can use any DOM compliant query selector(s) here to specify a single or multiple fields that you wish to convert. **N.B. When using input selectors you should ensure each input field has a unique name attribute to ensure clashes do not occur if multiple what3words Address Fields appear on a single page.** If you want to add a new custom field to extend as a what3words Address Field you should first create an input field on the page you wish to add this functionality to and provide with a name, id and/or that can then use in the input selector to specify it. (Be careful when using classes as it can apply this behaviour to multiple fields.) If you want to capture the selected what3words address you should wrap this field in a form with a submit button and this will then be submitted as specified by your form. ### Saving coordinates If you need to capture the coordinates for a three word address to help with delivery information, for example, you should check the *Save coordinates* checkbox with will also retrieve the coordinates for the captured three word address. If you have added the what3words Address Field to your WooCommerce checkout and you select *Save coordinates* the coordinates for the billing and shipping address fields will added to your order and visible in your Orders page on WooCommerce. If you are using custom field(s) for the address then you the component will automatically attach hidden fields for both the latitude and longitude of the coordinates for the adddress prefixed with the name you supplied to the input field. **Note** this uses an additional what3words API call to convert the what3words address to coordinates. Please ensure the tier you have signed up to covers the amount of usage you intend to do to avoid interruption of service. ### Adding a label For improved accessibility it is recommended that you add a label to your what3words Address Field. By checking this option and supplying some text for the label you can easily associate a label to each of your address field(s). For WooCommerce customers this option allows you to override the default label associated to the address field(s), while for custom field users this option tells the plugin to create a label field for you. ### Custom placeholder You can override the default placeholder for the address field(s) by selecting this option and specifying the placeholder text. We recommed you use the default placeholder value as it provides your customers with an example of how to use the what3words Address Field. ### Restricting search results We provide a number of options for clipping the autosuggest results, limiting the addresses that can be validated and captured. You can clip suggestions to a number of countries by providing comma separated 2 digit ISO codes for each country you wish to clip to. This will ensure suggestions provided are clipped within the countries specified. You can also clip within a circle, a bounding box or a polygon. **N.B. – When providing multiple clippings the intersection of each is what forms the suggestions provided when using the what3words Address Field.** For WooCommerce checkouts we recommend skipping these options as the clip to country is automatically set when a user selects a country for their billing and/or shipping information as they select a country from the dropdown menu options in the checkout form. --- # Java Getting started with the what3words Java API wrapper. Topics: Java, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/java Updated: 2026-11-27 The Java API wrapper is useful for Java developers who wish to seamlessly integrate the [what3words API](https://docs.what3words.com/api/v3/) into their Java applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words Java wrapper is available in our [Java Github repository](https://github.com/what3words/w3w-java-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The library is available through [Maven Central](https://search.maven.org/search?q=g:com.what3words). Please add one of the following to either your `pom.xml` or `gradle.build` files. Maven: **Java** ```java com.what3words w3w-java-wrapper 3.1.17 ``` Using Gradle: **Java** ```java implementation 'com.what3words:w3w-java-wrapper:3.1.17' ``` ## 3. Setup Instantiate an instance of What3WordsV3, from which all API requests can be made **Java** ```java // For all requests a what3words API key is needed What3WordsV3 api = new What3WordsV3("what3words-api-key"); ``` In the case that you run our Enterprise Suite API Server yourself, you may specify the URL to your server like so: **Java** ```java // In the case that you run our Enterprise Suite API Server yourself, you may specify the URL to your own server like so: What3WordsV3 api = new What3WordsV3("what3words-api-key", "https://api.yourserver.com/v3/"); ``` Additionally, if you run the Enterprise Suite API Server there is another optional `setup()` parameter: `customHeaders`. Use this if you need to send custom headers to your server: **Java** ```java /** * Additionally, if you run the Enterprise Suite API Server there is another optional setup() parameter: customHeaders. * Use this if you need to send custom headers to your own server: */ Map headers = new HashMap(); headers.put("Name1", "Value1"); headers.put("Name2", "Value2"); What3WordsV3 api = new What3WordsV3("what3words-api-key", "https://api.yourserver.com/v3/", headers); ``` ## 4. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.484463, -0.195405`): **Java** ```java // Convert coordinates to a 3 word address ConvertTo3WA words = api.convertTo3wa(new Coordinates(51.484463, -0.195405)) .language("en") .execute(); System.out.println("Words: " + words); ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Java** ```java // Convert a 3 word address to coordinates ConvertToCoordinates coordinates = api.convertToCoordinates("filled.count.soap") .execute(); System.out.println("Coordinates: " + coordinates); ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Java** ```java Autosuggest autosuggest = api.autosuggest("fun.with.code") .execute(); System.out.println("Autosuggest: " + autosuggest); ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Java** ```java Autosuggest autosuggest = api.autosuggest("fun.with.code") .clipToCountry("GB", "BE") .execute(); System.out.println("Autosuggest: " + autosuggest); ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Java** ```java Autosuggest autosuggest = api.autosuggest("fun.with.code") .focus(new Coordinates(51.4243877,-0.34745)) .execute(); System.out.println("Autosuggest: " + autosuggest); ``` **Code example** AutoSuggest, with Generic Voice input type. **Java** ```java Autosuggest autosuggest = api.autosuggest("fun with code") .inputType(AutosuggestInputType.GENERIC_VOICE) .language("en") .execute(); System.out.println("Autosuggest: " + autosuggest); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for (`51.527649, -0.191746`) in the south-west, and (`51.515900, -0.212517` in the north-east: **Java** ```java // Obtain a grid section within the provided bounding box GridSection gridSection = api.gridSection( new BoundingBox( new Coordinates(51.515900, -0.212517), new Coordinates(51.527649, -0.191746) ) ).execute(); System.out.println("Grid section: " + gridSection); ``` #### Serializing To GeoJSON If GeoJSON format is required (you are using on a map in an app for example) a function such as `geoJsonSerializer` can be added. This should be registered to Gson as a `TypeAdapter` and then you can then serialize the objects returned from the wrapper into GeoJSON. **Java** ```java JsonSerializer geoJsonSerializer = api.getGridSectionJsonSerializer(); GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.registerTypeAdapter(GridSection.class, geoJsonSerializer); Gson geoJsonGson = gsonBuilder.create(); String geoJson = geoJsonGson.toJson(gridSection); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Java** ```java // Obtain the list of available languages AvailableLanguages languages = api.availableLanguages().execute(); System.out.println("Languages: " + languages); ``` ### Handling errors Errors returned from the API can be caught with the wrapper through the use of a `catch` function. Within the `catch` function, `code` and `message` values which represent the error, are accessible from the `error` object parameter **Java** ```java Autosuggest autosuggest = api.autosuggest("freshen.overlook.clo") .clipToCountry("fr") .execute(); if (autosuggest.isSuccessful()) { ... } else { // An error occurred What3WordsError error = autosuggest.getError(); if (error == What3WordsError.BAD_CLIP_TO_COUNTRY) { // Invalid country clip is provided System.out.println("BadClipToCountry: " + error.getMessage()); } } ``` ## 5. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Java** ```java public class What3WordsExample { public static void main(String[] args) { // Example what3words addresses String[] addresses = {"filled.count.soap", "not a 3wa", "not.3wa address"}; // Check if the addresses are possible what3words addresses for (String address : addresses) { boolean isPossible = What3WordsV3.isPossible3wa(address); System.out.println("Is '" + address + "' a possible what3words address? " + isPossible); } } } ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Java** ```java public class What3WordsExample { public static void main(String[] args) { // Initialize the What3Words API with your API key What3WordsV3 api = new What3WordsV3("YOUR_API_KEY"); // Example addresses String[] addresses = { "filled.count.soap", "filled.count.", "coding.is.cool" }; // Check if the addresses are valid what3words addresses for (String address : addresses) { boolean response = api.isValid3wa(address); if (response.isSuccessful() && response.getIsValid()) { System.out.println(address + " is a valid what3words address"); } else if (response.isSuccessful() && !response.getIsValid()) { System.out.println(address + " is an invalid what3words address"); } else { System.out.println("isValid3wa error: " + response.getError().getKey() + " " + response.getError().getMessage()); } } } } ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 7. Full example The example below takes the concepts described above, and turns some of them into a complete example. Here we take a partial 3 word address and pass it into AutoSuggest – clipping the results to consider only addresses in France, setting a focus of Paris, and returning a single result We then take the result and convert the 3 word address to coordinates, and find the nearest place. **Java** ```java // For all requests a what3words API key is needed What3WordsV3 api = new What3WordsV3("what3words-api-key"); Autosuggest autosuggest = api.autosuggest("freshen.overlook.clo") .clipToCountry("FR") .focus(new Coordinates(48.856618, 2.3522411)) .nResults(1) .execute(); if (autosuggest.isSuccessful()) { String words = autosuggest.getSuggestions().get(0).getWords(); System.out.printf("Top 3 word address match: %s%n", words); ConvertToCoordinates convertToCoordinates = api.convertToCoordinates(words).execute(); if (convertToCoordinates.isSuccessful()) { System.out.printf("WGS84 Coordinates: %f, %f%n", convertToCoordinates.getCoordinates().getLat(), convertToCoordinates.getCoordinates().getLng()); System.out.printf("Nearest Place: %s%n", convertToCoordinates.getNearestPlace()); } else { What3WordsError error = autosuggest.getError(); if (error == What3WordsError.INTERNAL_SERVER_ERROR) { // Server Error System.out.println("InternalServerError: " + error.getMessage()); } else if (error == What3WordsError.NETWORK_ERROR) { // Network Error System.out.println("NetworkError: " + error.getMessage()); } } } else { What3WordsError error = autosuggest.getError(); if (error == What3WordsError.BAD_CLIP_TO_COUNTRY) { // Invalid country clip is provided System.out.println("BadClipToCountry: " + error.getMessage()); } else if (error == What3WordsError.BAD_FOCUS) { // Invalid focus System.out.println("BadFocus: " + error.getMessage()); } else if (error == What3WordsError.BAD_N_RESULTS) { // Invalid number of results System.out.println("BadNResults: " + error.getMessage()); } else if (error == What3WordsError.INTERNAL_SERVER_ERROR) { // Server Error System.out.println("InternalServerError: " + error.getMessage()); } else if (error == What3WordsError.NETWORK_ERROR) { // Network Error System.out.println("NetworkError: " + error.getMessage()); } else { System.out.println(error + ": " + error.getMessage()); } } ``` --- # JavaScript / TypeScript Getting started with the what3words JavaScript API wrapper. Topics: Angular, JavaScript, NodeJS, React, Vue, Server and Scripting, Website Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/javascript Updated: 2026-11-27 ### Step by step The JavaScript/TypeScript API wrapper is useful for developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their Node.js/Browser-based environment, without the hassle of having to manage the low-level API calls themselves. Alternatively, there is a [JavaScript SDK](https://developer.what3words.com/tutorial/javascript-sdk) that uses the JavaScript/TypeScript API Wrapper under the hood, and it supports native web components `@what3words/javascript-components` (which can also be loaded via CDN), Angular components – `@what3words/angular-components`, React components – `@what3words/react-components` and Vue components – `@what3words/vue-components`. The components available for you to use are as follows: - [AutoSuggest Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) - [Map Component](https://developer.what3words.com/tutorial/using-the-web-map-component) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To load the JavaScript/TypeScript wrapper for the what3words API, use npm or yarn: **npm** ```shellscript npm install @what3words/api ``` **yarn** ```shellscript yarn add @what3words/api ``` If you wish to use the built-in transports you will also need to install the peer dependencies for them. For more information on the default transports read the section on [Transports](https://developer.what3words.com/tutorial/javascript#transport). ## 3. Setup First, configure the wrapper including adding your what3words API key: **JavaScript** ```javascript const what3words, { fetchTransport } = require('@what3words/api'); const apiKey = ''; const config = { host: 'https://api.what3words.com', apiVersion: 'v3', }; const transport = fetchTransport(); // or you can import 'axiosTransport' instead const w3wService = what3words(apiKey, config, { transport }); // you can uncomment the following lines to set your api key and config after instantiation of the w3w service // w3wService.setApiKey(apiKey); // w3wService.setConfig(config); ``` **TypeScript** ```typescript import what3words, { ApiVersion, Transport, What3wordsService, axiosTransport, } from '@what3words/api'; const apiKey = ''; const config: { host: string; apiVersion: ApiVersion; } = { host: 'https://api.what3words.com', apiVersion: ApiVersion.Version3, }; const transport: Transport = axiosTransport(); const w3wService: What3wordsService = what3words(apiKey, config, { transport }); // code continues... ``` ### what3words Service The `What3wordsService` provides a quick and easy way to instantiate the API clients that can be used to make requests against the what3words API. It also provides helper functions for setting API configuration, such as host and API version and your API key across the what3words API clients. ### Clients The what3words API clients in this library are used to validate request options, serialise and handle request/response and errors against an API endpoint. Each client extends the abstract `ApiClient` class. There is a specific client for each request and you can use them independently of the `What3wordsService`. This can be particularly useful if you want to extend the client behavior, minimise your code, or, in a more extreme example, use a custom transport to handle requests differently in each client. Every client accepts the following parameters: | Parameter | Datatype | Default value | | --- | --- | --- | | apiKey | string | '' | | config | config.host | https://api.what3words.com | | | config.apiVersion | v3 | ### Transport The transport is a function responsible for executing the request against the API. Given a `ClientRequest` the transport should return a promise that resolves to `TransportResponse`. A `ClientRequest` consists of the following properties: | Property | Datatype | | --- | --- | | host\* | string | | url\* | string | | method\* | get or post | | query | object | | headers | object | | body | object | | format\* | json or geojson. Default: json | A `TransportResponse` consists of the following properties: | Property | Datatype | | --- | --- | | status\* | number | | statusText\* | string | | body\* | any | | headers | object | There are two built-in transports available with this library that you can use; either [isomorphic-unfetch](https://www.npmjs.com/package/isomorphic-unfetch) or [axios](https://www.npmjs.com/package/axios). By specifying which transport you would like to use on initialisation of the `What3wordsService` or a client, if you wish to instantiate a client for yourself. ### Built-ins There are two built-in transports available: - [Isomorphic-unfetch](https://www.npmjs.com/package/isomorphic-unfetch) - [Axios](https://www.npmjs.com/package/axios) To use either of these you will need to install the peer dependency. By default, [isomorphic-unfetch](https://www.npmjs.com/package/isomorphic-unfetch) is assumed by the `What3wordsService` or any instantiated client where no override is provided. **npm** ```shellscript npm install cross-fetch npm install axios ``` **yarn** ```shellscript yarn add cross-fetch yarn add axios ``` ### Custom You can provide your own custom transport, if you wish to use another library for handling requests, which might be useful if you have other integrations or you are already using an http library elsewhere. In order to do so you need to define your own `Transport` and pass it into the `What3wordsService` or client to use it. The custom `Transport` you create should be a function that accepts a `ClientRequest` as an argument and returns a promise that resolves to a `TransportResponse`. ### Example **TypeScript** ```typescript import what3words, { ClientRequest, TransportResponse } from '@what3words/api'; import superagent from 'superagent'; const API_KEY = ''; const config = {}; // This will ensure we do not override the defaults function customTransport( request: ClientRequest ): Promise> { const { method, host, url, query = {}, headers = {}, body = {}, format, } = request; return new Promise(resolve => superagent[method](`${host}${url}`) .query({ ...query, format }) .send(body || {}) .set(headers) .end((err, res) => { if (err || !res) return resolve({ status: err.status || 500, statusText: err.response.text || 'Internal Server Error', headers: err.headers || {}, body: err.response.text || null, }); const response: TransportResponse = { status: res.status, statusText: res.text, headers: res.headers, body: res.body, }; resolve(response); }) ); } const service = what3words(API_KEY, config, { transport: customTransport }); service .availableLanguages() .then(({ languages }) => console.log('Available languages', languages)); ``` ## 4. Usage on Browser-based environment ### Requirements There are some requirements to use the JavaScript/TypeScript API wrapper on a browser environment please note the following: - [esbuild](https://esbuild.github.io/) was used to build the project with a dependency on [esbuild-plugin-polyfill-node](https://www.npmjs.com/package/esbuild-plugin-polyfill-node) to shim node-specific features to successfully compile for browsers. You may choose to bundle your project with any appropriate tool of your choice, the only requirement as of `what3words/api v5.0.1` now is to polyfill the node `os` built-in. - To use the package, run the following command to install the javascript API wrapper and its core dependencies: **npm** ```shellscript npm install -S @what3words/api axios cross-fetch ``` - Alternatively, there is a [JavaScript SDK](https://developer.what3words.com/tutorial/javascript-sdk) that uses the JavaScript/TypeScript API Wrapper under the hood, and it supports native web components `@what3words/javascript-components` (which can also be loaded via CDN), Angular components – `@what3words/angular-components`, React components – `@what3words/react-components` and Vue components – `@what3words/vue-components`. The components available for you to use are the [AutoSuggest Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) and the [Map Component](https://developer.what3words.com/tutorial/using-the-web-map-component). ### Convert to 3 word address This function converts coordinates (expressed as latitude and longitude) to a 3 word address. More information about `convertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (51.520847, -0.195521): **JavaScript** ```javascript import what3words, { axiosTransport, ApiVersion } from "@what3words/api"; const W3W_API_KEY = ""; //TODO: Add your what3words API key here // Instantiate what3words instance window.what3words = what3words( "", { apiVersion: ApiVersion.Version3 }, { transport: axiosTransport() }, ); // Configure what3words JS wrapper window.what3words.setApiKey(W3W_API_KEY); // Convert a coordinate to a three word address and retrieve the JSON response from our API window.what3words .convertTo3wa({ coordinates: { lat: 51.520847, lng: -0.195521 }, language: 'en', format: 'json' }) .then((response) => { word = response.words; console.log(word); }) // Convert a coordinate to a three word address and retrieve the GEOJSON response from our API window.what3words .convertTo3wa({ coordinates: { lat: 51.520847, lng: -0.195521 }, language: 'en', format: 'geojson' }) .then((response) => { console.log(response); }) ``` ### Convert to coordinates This function converts a 3 word address to a position, expressed as coordinates of latitude and longitude. It takes the word parameter as a string of 3 words `'table.book.chair'` More information about `convertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **JavaScript** ```javascript import what3words, { axiosTransport, ApiVersion, W3W_REGEX, } from "@what3words/api"; const W3W_API_KEY = ""; //TODO: Add your what3words API key here // Instantiate what3words instance window.what3words = what3words( "", { apiVersion: ApiVersion.Version3 }, { transport: axiosTransport() }, ); // Configure what3words JS wrapper window.what3words.setApiKey(W3W_API_KEY); const THREE_WORD_ADDRESS = "filled.count.soap"; // Retrieve coordinates for initial three word address in JSON window.what3words .convertToCoordinates({ words: THREE_WORD_ADDRESS, format: 'json' // or format: 'geojson' }) .then((res) => { coordinates = res.coordinates; console.log(coordinates); }) // Retrieve coordinates for initial three word address in GEOJSON window.what3words .convertToCoordinates({ words: THREE_WORD_ADDRESS, format: 'geojson' // or format: json' }) .then((res) => { console.log(response); }) ``` ### AutoSuggest When presented with a 3 words address that may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `focus` to user’s current location. This will make `autosuggest` return results which are closer to the user. More information about `autosuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Example:** Basic AutoSuggest call. **JavaScript** ```javascript import what3words, { axiosTransport, ApiVersion } from "@what3words/api"; const W3W_API_KEY = ""; //TODO: Add your what3words API key here // Instantiate what3words instance window.what3words = what3words( "", { apiVersion: ApiVersion.Version3 }, { transport: axiosTransport() }, ); // Configure what3words JS wrapper window.what3words.setApiKey(W3W_API_KEY); window.what3words .autosuggest({ input: 'freshen.overlook.clo', language: 'en' }) .then(function (response) { console.log(`suggestions for: ${response}`); }); ``` ### Grid section The grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner or a `BadBoundingBoxTooBig` error will be returned. More information about `gridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for (52.208867,0.117540) in the south-west, and (52.207988,0.116126) in the north-east: **JavaScript** ```javascript import what3words, { axiosTransport, ApiVersion } from "@what3words/api"; const W3W_API_KEY = ""; //TODO: Add your what3words API key here // Instantiate what3words instance window.what3words = what3words( "", { apiVersion: ApiVersion.Version3 }, { transport: axiosTransport() }, ); // Configure what3words JS wrapper window.what3words.setApiKey(W3W_API_KEY); // Call the what3words Grid API to obtain the grid squares within the current visible bounding box window.what3words. .gridSection({ boundingBox: { southwest: { lat: sw.lat(), // replace with SouthWest Latitude coordinates lng: sw.lng() // replace with SouthWest Longitude coordinates }, northeast: { lat: ne.lat(), // replace with NorthEast Latitude coordinates lng: ne.lng() // replace with NorthEast Longitude coordinates } }, format: "json" }) .then(function (data) { console.log(data) }) .catch(console.error); ``` ### Available languages This function returns the currently supported languages. It will return the two-letter code, and the name of the language both in that language and English. More information about `availableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **JavaScript** ```javascript import what3words, { axiosTransport, ApiVersion } from "@what3words/api"; const W3W_API_KEY = ""; //TODO: Add your what3words API key here // Instantiate what3words instance window.what3words = what3words( "", { apiVersion: ApiVersion.Version3 }, { transport: axiosTransport() }, ); // Configure what3words JS wrapper window.what3words.setApiKey(W3W_API_KEY) // Retrieve and print out supported languages window.what3words.availableLanguages().then((res) => { languages = res.languages; console.log(languages); }); ``` ## 5. Usage on Node.js-based environment ### Convert to 3 word address This function converts coordinates (expressed as latitude and longitude) to a 3 word address. More information about `convertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (51.520847, -0.195521): **TypeScript** ```typescript import { ConvertTo3waClient, ConvertTo3waOptions, FeatureCollectionResponse, LocationGeoJsonResponse, LocationJsonResponse, } from '@what3words/api'; const API_KEY = ''; const client: ConvertTo3waClient = ConvertTo3waClient.init(API_KEY); const options: ConvertTo3waOptions = { coordinates: { lat: 51.520847, lng: -0.195521 }, }; // If you want to retrieve the JSON response from our API client .run({ ...options, format: 'json' }) // { format: 'json' } is the default response .then((res: LocationJsonResponse) => console.log('Convert to 3wa', res)); // If you want to retrieve the GeoJsonResponse from our API client .run({ ...options, format: 'geojson' }) .then((res: FeatureCollectionResponse) => console.log('Convert to 3wa', res) ); ``` ### Convert to coordinates This function converts a 3 word address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of 3 words `'table.book.chair'` More information about `convertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for ///filled.count.soap: **TypeScript** ```typescript import { ConvertToCoordinatesClient, ConvertToCoordinatesOptions, FeatureCollectionResponse, LocationGeoJsonResponse, LocationJsonResponse, } from '@what3words/api'; const API_KEY = ''; const client: ConvertToCoordinatesClient = ConvertToCoordinatesClient.init(API_KEY); const options: ConvertToCoordinatesOptions = { words: 'filled.count.soap' }; // If you want to retrieve the JSON response from our API client .run({ ...options, format: 'json' }) // { format: 'json' } is the default response .then((res: LocationJsonResponse) => console.log('Convert to coordinates', res) ); // If you want to retrieve the GeoJsonResponse from our API client .run({ ...options, format: 'geojson' }) .then((res: FeatureCollectionResponse) => console.log('Convert to coordinates', res) ); ``` ### AutoSuggest When presented with a 3 words address that may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `focus` to user’s current location. This will make `autosuggest` return results which are closer to the user. More information about `autosuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Example:** Basic AutoSuggest call **TypeScript** ```typescript import { AutosuggestClient, AutosuggestOptions, AutosuggestResponse, } from '@what3words/api'; const API_KEY = ''; const client: AutosuggestClient = AutosuggestClient.init(API_KEY); const options: AutosuggestOptions = { input: 'filled.count.s', }; client .run(options) .then((res: AutosuggestResponse) => console.log(`suggestions for "${options.input}"`, res) ); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `gridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for (52.208867,0.117540) in the south west, and (52.207988,0.116126) in the north east: **TypeScript** ```typescript import { GridSectionClient, GridSectionOptions, FeatureCollectionResponse, GridSectionGeoJsonResponse, GridSectionJsonResponse, } from '../src'; const API_KEY = ''; const client: GridSectionClient = GridSectionClient.init(API_KEY); const options: GridSectionOptions = { boundingBox: { southwest: { lat: 52.208867, lng: 0.11754 }, northeast: { lat: 52.207988, lng: 0.116126 }, }, }; // If you want to retrieve the JSON response from our API client .run({ ...options, format: 'json' }) // { format: 'json' } is the default response .then((res: GridSectionJsonResponse) => console.log('Grid Section', res)); // If you want to retrieve the JSON response from our API client .run({ ...options, format: 'geojson' }) // { format: 'json' } is the default response .then((res: FeatureCollectionResponse) => console.log('Grid Section', res) ); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `availableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **TypeScript** ```typescript import { AvailableLanguagesClient, AvailableLanguagesResponse, } from '@what3words/api'; const API_KEY = ''; const client: AvailableLanguagesClient = AvailableLanguagesClient.init(API_KEY); client .run() .then((res: AvailableLanguagesResponse) => console.log('Available Languages', res) ); ``` ## 6. RegEx functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **TypeScript** ```typescript import { AutosuggestClient } from "@what3words/api"; // Initialise the What3Words API with your API key const API_KEY = 'YOUR_API_KEY'; const client = AutosuggestClient.init(API_KEY); // Example what3words addresses const addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"]; // Function to check if the address is a possible what3words address const checkPossible3wa = (address) => { const isPossible = client.isPossible3wa(address); console.log(`Is '${address}' a possible what3words address? ${isPossible}`); }; // Check each address addresses.forEach(checkPossible3wa); ``` ### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **TypeScript** ```typescript import { AutosuggestClient } from "@what3words/api"; const API_KEY = 'YOUR_API_KEY'; const client = AutosuggestClient.init(API_KEY); // Example addresses const addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ]; // Function to check if the address is valid const checkIsValid3wa = async (address) => { try { const isValid = await client.isValid3wa(address); console.log(`Is '${address}' a valid what3words address? ${isValid}`); } catch (error) { console.error(`Error validating address '${address}':`, error); } }; // Check each address for validity addresses.forEach(checkIsValid3wa); ``` ### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Using the JavaScript AutoSuggest Component Adding a what3words address input box with AutoSuggest. Topics: Angular, JavaScript, React, Salesforce, Vue, Website Section: [Search Box](https://developer.what3words.com/docs/search-box.md) Source: https://developer.what3words.com/tutorial/javascript-autosuggest-component Updated: 2026-11-27 ### Tutorial The easiest way to add what3words to your technology is to use one of our components. We have components available for JavaScript, iOS and Android which require minimal development to integrate. The JavaScript component can also be used in React.js, Vue.js and Angular. The AutoSuggest Component allows users to quickly and correctly input a what3words address to a form input or search field by providing suggestions as a user types and validation to ensure the input value is a valid what3words address. The component by default uses the what3words API or can be configured to use a privately hosted instance of the what3words API. This tutorial steps through how our JavaScript AutoSuggest Component can be added to a website either for static pages or using npm, how it can be customised to refine the what3words address suggestions displayed and how it can inherit the style of your site. In case you are looking to seamlessly integrate the what3words Public API into your Node.js/Browser-based environment applications, the [JavaScript API Wrapper](https://developer.what3words.com/tutorial/javascript) is the right technology for your application. Find out how else you can access the JavaScript API Wrapper via the window object by using our [JavaScript SDK](https://developer.what3words.com/tutorial/javascript-sdk). Getting started with Christian, what3words Lead Frontend Developer, showing you how to add our AutoSuggest component to a web-based project in JavaScript: [https://youtu.be/3XhNzJszZYQ](https://youtu.be/3XhNzJszZYQ) ### Quickstart The AutoSuggest Component requires just a few lines of code to be added to a form to create a what3words powered input field. Replace `YOUR-API-KEY` with your what3words API key to get started. **HTML** ```html
``` **React** ```jsx import { useState } from "react"; import { What3wordsAutosuggest } from "@what3words/react-components"; function MyFormElement() { const [value, setValue] = useState(""); const onChange = (e) => setValue(e.target.value); return ( ); } export default MyFormElement; ``` **Vue** ```vue ``` **Angular** ```typescript import { NgModule } from "@angular/core"; import { Component } from "@angular/core"; import { ComponentsModule } from "@what3words/angular-components"; @Component({ selector: "app-component-autosuggest", template: ` ` }) export class W3WAutosuggestComponent { } @NgModule({ imports: [ComponentsModule], declarations: [W3WAutosuggestComponent], exports: [W3WAutosuggestComponent], bootstrap: [W3WAutosuggestComponent] }) export class W3WAutosuggestModule { } ``` [AutoSuggest Component](https://codesandbox.io/s/sweet-hamilton-4s855) (interactive example) ### Step by Step ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the UI Component ## Installation The component can be added to static HTML pages by including the `what3words.js` script on each page of your site that you would like to use the component on. You could add the what3words API key as a parameter to `what3words.js` script but we recommend adding the API key as an attribute to the component element instead. Alternatively, if you are using `NPM` within your site you can consume one of our packages for your framework. **HTML** ```html ``` **JavaScript** ```javascript npm install @what3words/javascript-components ``` **React** ```jsx npm install @what3words/react-components ``` **Vue** ```vue npm install @what3words/vue-components ``` **Angular** ```typescript npm install @what3words/angular-components ``` ## Versioning The AutoSuggest Component is versioned to allow for updates and bug fixes. If installing using HTML, we recommend using `@latest` the development version of your integrations to specify that the latest version of the current major version is loaded. This will ensure that the component is loaded without any breaking changes but receives the benefits of bug fixes and new features. **Note:** We prefer to use a fixed version for the Production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example`@5.0.0`. A log of versions can be found [here](https://www.npmjs.com/package/@what3words/javascript-components). **HTML** ```html ``` **JavaScript** ```javascript npm install @what3words/javascript-components@5.0.0 ``` **React** ```jsx npm install @what3words/react-components@5.0.0 ``` **Vue** ```vue npm install @what3words/vue-components@5.0.0 ``` **Angular** ```typescript npm install @what3words/angular-components@5.0.0 ``` ## Extending an input with AutoSuggest functionality The what3words AutoSuggest Component is a container tag that wraps around an `input` element. You can either extend an existing input that is to be used as a what3words field or add a new one and wrap the what3words autosuggest container tags around the input. We recommend specifying the what3words API key as an attribute to the AutoSuggest Component container. You should now replace `YOUR-API-KEY` with your what3words API key. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` You will also need to add an `import` line to our package if you are using `NPM`. Adding a label and placeholder as well as making the field optional is recommended particularly when used as part of an input field for a checkout page. **HTML** ```html ``` **React** ```jsx import "./styles.css"; import { useState } from "react"; import { What3wordsAutosuggest } from "@what3words/react-components"; function MyFormElement() { const [value, setValue] = useState(""); const onChange = (e) => setValue(e.target.value); return ( ); } export default MyFormElement; ``` **Vue** ```vue ``` **Angular** ```typescript import { NgModule } from "@angular/core"; import { Component } from "@angular/core"; import { ComponentsModule } from "@what3words/angular-components"; @Component({ selector: "app-component-autosuggest", template: ` ` }) export class W3WAutosuggestComponent { } @NgModule({ imports: [ComponentsModule], declarations: [W3WAutosuggestComponent], exports: [W3WAutosuggestComponent], bootstrap: [W3WAutosuggestComponent] }) export class W3WAutosuggestModule { } ``` ## Configuring for use with API server If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server by appending the `baseUrl` parameter to the `script` loaded. Using the frameworks you can specify the `baseUrl` using `window.what3words.api.setOptions`. Although we recommend adding the `base_url` parameter within the AutoSuggest Component container. **HTML** ```html ``` **React** ```jsx import { useState, useEffect } from "react"; useEffect(() => { window.what3words.api.setConfig({ baseUrl: "https://example.com/v3" }); }, []); ``` **Vue** ```vue window.what3words.api.setConfig({ baseUrl: 'https://example.com/v3' }); ``` **Angular** ```typescript window.what3words.api.setConfig({ baseUrl: 'https://example.com/v3' }); ``` ## Add Strict mode You can now add `strict=false` or just `strict` if you want it to be true (which is the default) to the AutoSuggest Component which allows for non-3wa-like strings to be accepted and the component will not remove the value. It will emit the `value_invalid` event as it normally does, but the value is not removed and can be used to trigger another integration, such as Google Places API, which the map component does. This way you can now use the autosuggest component with an existing field rather than having to have a dedicated field on your form. ## Customise Suggestions You can also push your suggestions to the AutoSuggest Component using the `option` attribute or programmatically updating this with JavaScript as is shown in the example below. This is currently available through the React and Vue wrappers. **React** ```jsx import { What3wordsAutosuggest } from "@what3words/react-components"; import { createRef, useEffect } from "react"; import "./styles.css"; export default function App() { const ref = createRef(); useEffect(() => { ref.current.addEventListener("value_invalid", () => { const options = [ { value: "Street A", id: "street-a", description: "Some village", distance: { value: 10, units: "km" } }, { value: "Street B", id: "street-b", description: "Some town", distance: { value: 30, units: "km" } }, { value: "Street C", id: "street-c", description: "Some city", distance: { value: 90, units: "metres" } } ]; ref.current.options = options; }); return () => ref.current.removeEventListener("value_invalid", () => { console.log("here"); }); }, [ref]); return ( ); } ``` ## 3. Style the Component By default, the JavaScript AutoSuggest Component will load with the what3words predefined style. Whether you have an e-commerce store or a web application, you can match the style of your own site by overriding: - `CSS class` attribute of the Input; - `variant` attribute of the component; - `what3words address suggestions` provided by the component. ## Override CSS class The Input element attributes can be overridden by specifying new CSS values for classes used by the component. For example, you can give the input a `class="input-field"` and then use CSS to style as it is shown in our example. **Note:** recommended using with the `variant="inherit"` component attribute for the JavaScript AutoSuggest component to inherit the style from a CSS class to match other inputs on your site. Please visit this **[interactive code sample](https://codesandbox.io/s/web-autosuggest-component-v4-inherit-input-ctgvz?from-embed)** to quickly and easily use this solution. **CSS** ```css ``` ## Use Inherit variant We strongly recommend that if you have your own styling set up in your site for other input elements, that you use the component’s `variant="inherit"` attribute. This attribute removes the default styling, which allows you to easily modify the input style used by the component to match the others on your form. **Note:** `variant="inherit"` attribute should be applied to the component as it shown below. Please visit this **[interactive code sample](https://codesandbox.io/s/web-autosuggest-component-v4-inherit-input-ctgvz?from-embed)** to quickly and easily use this solution ![Styling Input](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/640bf103e0e3df04913812933dbc2eb5dea6682b9dde1d4ed6d6c3e7dc726127.w1600.webp) **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## Override what3words address suggestions The what3words address suggestions and error message used by the component are unaffected by the variant attribute to ensure that the layout of the suggestions is optimal. It is, however, possible to override the style of the what3words address suggestions provided by the component too if desired using CSS overrides to match the styling of your own site. Please visit this **[interactive code sample](https://codesandbox.io/s/web-autosuggest-component-v4-dropdown-component-3t934?from-embed)** to quickly and easily use this solution ![Override the style of the Dropdown](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/31947941ae630f84950be3b7cb90a064315d437ac79cf98c90f4e1d1faf3603a.w1600.webp) **CSS** ```css ``` ## 4. Localising the Component ## Supported languages The AutoSuggest Component will accept any what3words address in any language supported by the what3words API. It can also be added to a site using a right to left language as long as the HTML direction has been set, for example: **HTML** ```html ``` **JavaScript** ```javascript ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## Localising errors The error message displayed by the component if a valid what3words address has not been added can be changed to support location. This can be changed using the attribute `error_message`: **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## Seamless Language Support The AutoSuggest Component now automatically adapts to your user’s language preferences. Localised parts include the placeholder, error message, and invalid error message. If you specify the language in the HTML (e.g. ``), the component will use that language. If not, it falls back to the browser’s language settings. If the language of the what3words address isn’t specified (e.g. `language='es'`), the component will default to the HTML page or browser language. This uses 2-letter ISO codes or locale codes and defaults to English (en-GB) if an unsupported language is detected. Error handling is improved, providing clear feedback in the console for unsupported languages. The update supports `javascript-components@5.0.0`, benefiting React, Vue, and Angular components. ## 5. Configure Advanced Options ## Country clipping To refine the suggestions supplied to a user we recommend using country clipping where appropriate. If, for example, the component is to be used on a checkout page then country clipping can be specified using the `clip_to_country` attribute for the delivery country to ensure that only suggestions are shown in that country and closer matches are displayed. Multiple countries can be specified as comma-separated. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## Focus In addition to country clipping, it is also possible to add focus to results using the `autosuggest_focus` attribute. The focus should be supplied as a lat, long, usually the user’s location from the GPS on their device. Supplying focus will ensure that suggestions displayed to the user are biased to their location. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## 6. Attributes ### Component script parameters | Parameter | Type | Description | | --- | --- | --- | | key | String | An API key is required for the component to function correctly. Example: key=Your-API-Key | | baseUrl | String | The component can be used with an Enterprise Suite API Server instance by using baseUrl. Example: baseUrl=https://example.com/v3 | | callback | String | Allows for a callback to be fired once the component has loaded. This should be the function name to be fired. Example: callback=initMap | | headers | String | Enterprise API Server only - Allows for custom headers to be passed through in requests. | ### Recommended input element attributes | Attribute | Type | Description | | --- | --- | --- | | name | String | Standard CSS name. Example: name="what3words" | | id | String | Standard CSS input ID. If not specified then one will be added by our component. Example: id="what3words" | | class | String | Standard CSS class - use with the variant=inherit attribute to apply this class to the input element of the component. Example: class="input-field" | | value | String | Sets the initial value of the input element. We recommend always including the /// before the what3words address. Example: value="///filled.count.soap" | | placeholder | String | Placeholder text to display. We recommend keeping the placeholder as a what3words address proceeded with "e.g." Example: placeholder="e.g ///filled.count.soap" | ### Component attributes | Attribute | Type | Description | | --- | --- | --- | | api\_key | String | Your what3words API Key can be specified as an attribute to the component. Example: api\_key="Your-API-Key" | | variant | String | Variant attribute allows for a different variant style to be applied to the input element. variant=inherit allows for the component to inherit the style from a CSS class to match other inputs on a site. A class should be specified on the input in conjunction with variant=inherit. Example: variant="inherit" | | invalid\_address\_error\_message | String | Overwrites the error message with a custom value. Example value:"You have entered an invalid address" | | language | String | Allows you to add a preferred suggestion fallback language. Only used when input value language cannot be determined. Example: language="EN" | | autosuggest\_focus | String | Comma separated lat/lng of a point to focus on AutoSuggest results on. This is useful to focus results on a users location. Example value: autosuggest\_focus="51.521251,-0.203586" | | n\_focus\_results | Number | The number of AutoSuggest results to apply the focus to. Example: n\_focus\_results="2" | | clip\_to\_country | String | Restrict suggestions to a given country or comma separated list of countries. Example: clip\_to\_country="GB,US" | | clip\_to\_bounding\_box | String | Restrict suggestions to a bounding box specified using co-ordinates. Example: clip\_to\_bounding\_box="51.521,-0.343,52.6,2.3324" | | clip\_to\_circle | String | Restrict suggestions to a circle, specified by lat,lng,kilometres, where kilometres is the radius of the circle. Example: clip\_to\_circle="51.521251,-0.203586,2" | | clip\_to\_polygon | String | Restrict suggestions to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs. Example: clip\_to\_polygon="51.521,-0.343,52.6,2.3324,54.234,8.343,51.521,-0.343" | | return\_coordinates | Boolean | Makes an additional call to the what3words API to obtain the coordinates for the selected what3words address. Note this will use a convert-to-coordinates call whereas without this property only AutoSuggest API calls are made. Example: return\_coordinates=true | ## 7. Events | Event | Description | | --- | --- | | value\_changed | Fired when the value entered into the input changes | | value\_valid | Fired when a valid what3words address has been selected from the suggestions | | value\_invalid | Fires when input value is not a valid what3words address | | selected\_suggestion | Fires when a suggestion is selected from the dropdown. | | suggestions\_changed | Fires when the suggestions displayed in the dropdown change | | coordinates\_changed | Only when return\_coordinates attribute has been enabled. Fires when coordinates change when a new valid what3words address is selected. | ## Listening for events Using an event listener, it is possible to fire other functionality in a site when something changes in the AutoSuggest Component. For example, it is possible to listen for when a valid what3words address has been entered and update another element in the page or to listen for when new coordinates have been returned and pan/zoom a map to the location. **JavaScript** ```javascript const autosuggest = document.getElementById("what3words"); autosuggest.addEventListener( "selected_suggestion", ({ detail: { suggestion: { words } } }) => { console.log("Suggestion selected"); } ); ``` **React** ```jsx import { What3wordsAutosuggest } from "@what3words/react-components"; export default function App() { return (
console.log(detail.value)} onValue_valid={({ detail }) => console.log(detail.value)} onValue_invalid={({ detail }) => console.log(detail.value)} onSelected_suggestion={({ detail }) => console.log(detail.suggestion)} onSuggestions_changed={({ detail }) => console.log(detail.suggestions)} onCoordinates_changed={({ detail }) => console.log(detail.coordinates)} >
); } ``` **Vue** ```vue ``` **Angular** ```typescript import { NgModule } from "@angular/core"; import { Component } from "@angular/core"; import { ComponentsModule } from "@what3words/angular-components"; @Component({ selector: "app-component-autosuggest", template: ` console.log(detail.value)} onValue_valid={({ detail }) => console.log(detail.value)} onValue_invalid={({ detail }) => console.log(detail.value)} onSelected_suggestion={({ detail }) => console.log(detail.suggestion)} onSuggestions_changed={({ detail }) => console.log(detail.suggestions)} onCoordinates_changed={({ detail }) => console.log(detail.coordinates)} > ` }) export class W3WAutosuggestComponent { } @NgModule({ imports: [ComponentsModule], declarations: [W3WAutosuggestComponent], exports: [W3WAutosuggestComponent], bootstrap: [W3WAutosuggestComponent] }) export class W3WAutosuggestModule { } ``` ## 8. Migration Guide to Version 5 Generally speaking, this release should be a drop-in replacement for any standard application integrations that consume our components. The notes below largely apply if you’re using external builders like [vite](https://vite.dev/) or [esbuild](https://esbuild.github.io/). ### Vite When using [vite](https://vite.dev/), make sure to exclude our imported component library (e.g. `@what3words/javascript-components`) from the dependency optimisation using the `optimizeDeps.exclude` option in your `vite.config.[js,ts]` file. **TypeScript** ```typescript import { defineConfig } from "vite"; export default defineConfig({ ... optimizeDeps: { exclude: ["@what3words/javascript-components"], }, }); ``` ### Angular Angular generally requires more configuration for bespoke setups. The following sections should cover all integration patterns when using the `@what3words/angular-components` package. The `@angular-devkit/build-angular:application` is currently unsupported as this is based on vite/esbuild with no mechanism to disable dependency optimizations as would typically be done to resolve this known bundler issue. As such, only the `"@angular-devkit/build-angular:browser` (based on [webpack](https://webpack.js.org/)) builder is supported. To apply this builder, set the `projects..architect.build.builder` option in your `angular.json` config to `@angular-devkit/build-angular:browser` as shown below. **JSON** ```json { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "projects": { "my-app": { "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", ... }, ... }, ... }, ... }, } ``` > **Note:** Your application requirements might conflict with this downgrade. Additionally, Angular 19 is configured to use and support standalone components out-of-the-box whereas our libraries are currently built on the older NgModules pattern. They can however still be used in standalone components by using the `@angular/core`\-provided `importProvidersFrom` DI [utility method](https://angular.dev/api/core/importProvidersFrom?tab=api) to use it within the `bootstrapApplication` config and other standalone contexts. In your `main.ts`, update as follows: **TypeScript** ```typescript import { ApplicationConfig, importProvidersFrom, } from "@angular/core"; import { ComponentsModule } from "@what3words/angular-components"; export const appConfig: ApplicationConfig = { providers: [ importProvidersFrom(ComponentsModule), .... ], }; ``` The `@angular-devkit/build-angular:application` is currently unsupported as this is based on `vite/esbuild` with no mechanism to disable dependency optimisations as would typically be done to resolve this known bundler issue. As such, only the `@angular-devkit/build-angular:browser` (based on [webpack](https://webpack.js.org/)) builder is supported. To apply this builder, set the `projects..architect.build.builder` option in your angular.json config to `@angular-devkit/build-angular:browser` as shown below. **JSON** ```json { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "projects": { "my-app": { "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", ... }, ... }, ... }, ... }, } ``` > **Notes:** Your application requirements might conflict with this downgrade. If the above doesn’t work for your use-case, it might be more useful to use our `@what3words/javascript-components` which is what this wrapper library is based on. To do so, follow the instructions below: **Shell** ```shellscript // Step 1 - Uninstall @what3words/angular-components npm uninstall @what3words/angular-components // Step 2 - Install @what3words/javascript-components npm install @what3words/angular-components ``` Step 3 – Bind the custom element to the DOM in your main.ts file **TypeScript** ```typescript import { applyPolyfills, defineCustomElements, } from '@what3words/javascript-components/loader'; bootstrapApplication(...); // Add web component polyfills defineCustomElements(window).then(applyPolyfills); ``` Step 4 – Instruct the angular compiler to allow the usage of custom elements using the `CUSTOM_ELEMENTS_SCHEMA` flag in your app.module.ts file **TypeScript** ```typescript import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; @NgModule({ ... schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class AppModule {} ``` ## 9. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## Issues with Angular 17 Compatibility If you are facing issues with installing the `@what3words/angular-components` library in your `Angular 17` project that is due to a change in how angular projects are [built](https://angular.io/guide/esbuild#esm-default-imports-vs-namespace-imports) (moving away from `babel`  in v15 to `vite` in v17) and means the what3words Angular component isn’t successfully imported into `Angular 17` projects. We recommend to: 1. Update the `angular.json` file to downgrade the builder from `@angular-devkit/build-angular:application` to `@angular-devkit/build-angular:browser.` 2. Install the `@what3words/javascript-components` web component library (the `@what3words/angular-components` won’t work) 3. Run the `src/main.ts` file with the web component loader from the `@what3words/javascript-components`  library Reverting to the legacy angular builder shouldn’t have any downstream impact on your application, as it’s not a breaking change. For now, the `@what3words/angular-components` doesn’t work in either configuration and we’ll continue to look into this. Please contact [support@what3words.com](mailto:support@what3words.com) for a working sample to still be able to use our what3words components in your Angular 17 projects. ## Vite Compatibility Issue Our current components do not yet work with Vite due to a known issue with Stencil. A potential fix is expected in a future version upgrade, which we are currently working on. It may take some time before this fix is available and tested. For now, we advise against using Vite. For more details, refer to our [GitHub issue](https://github.com/ionic-team/stencil/issues/2827). #### AI coding agents (like **Replit**, **Lovable and** **Cursor**) should follow the steps below when building with what3words. **Markdown** ~~~~markdown what3words - Agent Guide (CDN‑only) Goal: Minimal POC where selecting a suggestion from the what3words autosuggest converts to `{lat,lng}` and displays it. No bundler edits, no extra packages. Rules: - Use CDN web‑component only. Do not install `@what3words/*` or edit Vite config. - Convert only after a selection (`"selected_suggestion"` event), never while typing. - Expose the API key as `VITE_W3W_API_KEY` (works with default Vite). ## 1) Set the what3words API key - Key: `VITE_W3W_API_KEY` ## 2) Add the component (no npm) Open `client/index.html` and paste these **two** lines just before ``: ```html ``` This defines the `` element at runtime — no Vite changes needed. ## 3) Minimal `client/src/App.tsx` ```tsx import { useEffect, useRef, useState } from "react"; // allow the custom element without extra .d.ts files declare global { namespace JSX { interface IntrinsicElements { "what3words-autosuggest": any } } } const API_KEY = import.meta.env.VITE_W3W_API_KEY as string | undefined; export default function App() { const [coords, setCoords] = useState<{ lat: number; lng: number } | null>(null); const ref = useRef(null); if (!API_KEY) return

Set VITE_W3W_API_KEY and rerun.

; useEffect(() => { const el = ref.current; const onSelect = (e: any) => { const w = e.detail?.suggestion?.words as string; fetch( \`https://api.what3words.com/v3/convert-to-coordinates?words=\${encodeURIComponent(w)}&key=\${API_KEY}\` ) .then((r) => r.json()) .then((d) => setCoords(d.coordinates ?? null)); }; el?.addEventListener("selected_suggestion", onSelect); return () => el?.removeEventListener("selected_suggestion", onSelect); }, [API_KEY]); return ( <>
{coords ? \`\${coords.lat}, \${coords.lng}\` : "Pick a suggestion"}
); } ``` ~~~~ --- # Address Autocomplete Component: Integrate Swiftcomplete into Web Forms The JavaScript Swiftcomplete integration is a code snippet that can be included on your website or in your checkout to provide address search with real-time suggestions as you type. Topics: JavaScript, SwiftComplete, Website Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Web and Mobile Components](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/web-and-mobile-components.md) Source: https://developer.what3words.com/tutorial/javascript-component-integrate-swiftcomplete-into-web-forms-new Updated: 2026-11-27 The [Swiftcomplete](https://what3words.com/swiftcomplete/) API provides real-time address suggestions as you type, eliminating typos and mistakes and reducing the time it takes to find accurate postal addresses. If you need help integrating our Swiftcomplete API into your website or application, [contact us](mailto:support@swiftcomplete.com), and one of our product experts will help you get started. ## 1. Get a Swiftcomplete API key Each request must be authenticated with a Swiftcomplete API key, which you can create in your Swiftcomplete account. [GET API KEY](https://www.swiftcomplete.com/account/api/) ## 2. Add the search field Pick your framework. Each tab below is a working snippet. Copy it, drop in your API key, and you have address search. ### HTML No build step, no npm. Add one script tag and one element. **HTML** ```html ``` That is a working address search. To do something with the result, listen for the select event: **HTML** ```html ``` ### React **Bash** ```shellscript npm install @swiftcomplete/react ``` **AddressForm.tsx** ```tsx import { useRef, useCallback } from 'react'; import { Swiftcomplete, useSelectedAddress, useApi } from '@swiftcomplete/react'; import type { SwiftcompleteRef } from '@swiftcomplete/react'; export function AddressForm() { const ref = useRef(null); useApi({ apiKey: 'YOUR_API_KEY', country: 'gb' }); useSelectedAddress(ref, useCallback((address) => { console.log(address.addressLine1, address.city, address.postalCode); }, [])); return ; } ``` Every event has a matching hook: `useSearchStarted`, `useSearchEnded`, `useManualEntry`, `useSearchClear`, `useSearchFocus`, `useSearchBlur`. Or use `useEvents` to subscribe to all of them at once. Requires React 18 or later. ### Vue **Bash** ```shellscript npm install @swiftcomplete/vue ``` **AddressForm.vue** ```vue ``` The same composables are available as the React hooks. Requires Vue 3.4 or later. ### Angular **Bash** ```shellscript npm install @swiftcomplete/angular ``` **address-form.component.ts** ```typescript import { Component } from '@angular/core'; import { SwiftcompleteComponent, configureSwiftcomplete } from '@swiftcomplete/angular'; import type { Address } from '@swiftcomplete/angular'; @Component({ selector: 'address-form', standalone: true, imports: [SwiftcompleteComponent], template: ` `, }) export class AddressFormComponent { constructor() { configureSwiftcomplete({ apiKey: 'YOUR_API_KEY', country: 'gb' }); } onSelect(address: Address) { console.log(address.addressLine1, address.city, address.postalCode); } } ``` Outputs mirror the events: `selectAddress`, `searchStart`, `searchEnd`, `manualEntry`, `searchClear`, `searchFocus`, `searchBlur`. Requires Angular 18 or later. ## 3. Fill in your form fields Most integrations want the selected address split across the fields of an existing checkout form. Give the component a map of your field IDs and it fills them in on selection. ### HTML **HTML** ```html ``` **JavaScript** ```javascript const el = document.querySelector('swiftcomplete-search'); el.populateFields({ addressLine1: { fieldId: 'address-line-1', format: 'AddressLine1' }, addressLine2: { fieldId: 'address-line-2', format: 'AddressLine2' }, city: { fieldId: 'address-city', format: 'TertiaryLocality, SecondaryLocality, PrimaryLocality' }, postalCode: { fieldId: 'address-postcode', format: 'POSTCODE' }, what3words: { fieldId: 'address-w3w', format: 'what3words' }, }); ``` When the user picks a result, each `fieldId` is looked up with `document.getElementById()` and its value is set. Only `` elements are filled; anything else logs a warning naming the key. > [!NOTE] > **The keys you choose become the keys on `e.detail.selected`.** They’re your own labels, not fixed names, so if you map `postalcode`, you read back `selected.postalcode`, not `selected.postalCode`. Match the default key names below unless you have a reason not to. The one key that is special is `what3words`, which the component recognises and fills with the three word address. Call `populateFields()` once the component is in the DOM, and make sure each `fieldId` matches exactly one element. ### React **TSX** ```tsx const ref = useRef(null); useEffect(() => { ref.current?.getElement()?.populateFields({ addressLine1: { fieldId: 'address-line-1', format: 'AddressLine1' }, postalCode: { fieldId: 'address-postcode', format: 'POSTCODE' }, }); }, []); ``` > [!NOTE] > **In React you usually don’t need this.** If your form fields are controlled inputs, take the address from `useSelectedAddress` and set state instead. `populateFields` writes to the DOM directly, and React will not know about it. **TSX** ```tsx useSelectedAddress(ref, useCallback((address) => { setForm({ line1: address.addressLine1, city: address.city, postcode: address.postalCode, }); }, [])); ``` ### Vue > [!NOTE] > **With Vue, bind your own state.** Take the address from `useSelectedAddress` and assign it to your reactive form object. `populateFields` writes to the DOM directly and will not update Vue’s state. **Vue** ```vue const form = reactive({ line1: '', city: '', postcode: '' }); useSelectedAddress(search, (address) => { form.line1 = address.addressLine1; form.city = address.city; form.postcode = address.postalCode; }); ``` ### Angular **TypeScript** ```typescript onSelect(address: Address) { this.form.patchValue({ line1: address.addressLine1, city: address.city, postcode: address.postalCode, }); } ``` Bind the output to your reactive form rather than using `populateFields`, so Angular stays in control of the values. ### Default address keys If you never call `populateFields`, `e.detail.selected` still arrives with these keys: | KEY | FORMAT STRING | EXAMPLE | | --- | --- | --- | | company | Company | what3words Ltd | | addressLine1 | AddressLine1 | 65 Alfred Road | | addressLine2 | AddressLine2 | | | city | TertiaryLocality, SecondaryLocality, PrimaryLocality | London | | postalCode | POSTCODE | W2 5EU | | country | PrimaryCountry | United Kingdom | | what3words | what3words | filled.count.soap | ## 4. Configure it There are two ways to configure the component, and you can mix them freely. Attributes are simplest for a static page; the JavaScript API is better when settings come from config, or when you need to change them at runtime. ### With attributes Set everything on the tag. Attributes are live: change one at runtime and the component updates. **HTML** ```html ``` Good for static pages, server-rendered templates and CMS blocks where the key is safe to put in markup. ### With Javascript Use `runWhenReady` so the component is registered before you call the service. **JavaScript** ```javascript window.swiftcomplete.runWhenReady((api) => { api.setApiKey('YOUR_API_KEY'); api.setCountry('gb'); api.setSearchFor('address', 'what3words'); api.enableDeviceLocation(); api.setDebounce(0); }); ``` Installed from npm, import the `sdk` instead of reaching for `window`: **JavaScript** ```javascript import '@swiftcomplete/component'; import { sdk, SearchEvents } from '@swiftcomplete/component'; sdk.runWhenReady((api) => api.setApiKey('YOUR_API_KEY')); ``` ### Debouncing requests By default the component searches on every keystroke. On a busy checkout that can be a dozen requests for one address, and a fast typist can push an API key past its queue depth, which returns HTTP 503. Set a debounce so the component waits until typing pauses before it searches. **JavaScript** ```javascript // Vanilla JavaScript window.swiftcomplete.runWhenReady((api) => api.setDebounce(0)); // React and Vue useApi({ debounce: 0 }); // Angular configureSwiftcomplete({ debounce: 0 }); ``` The value is in milliseconds and applies to every search field on the page. The default is `0`, meaning no debounce. ### Turning an existing input into a search field If you already have an address input in a checkout form you’d rather not restructure, wrap it. The original input is preserved inside the component, along with its `id`, `name` and any `data-` attributes. **JavaScript** ```javascript import { Swiftcomplete } from '@swiftcomplete/component'; // const search = Swiftcomplete.wrap(document.getElementById('my-input')); ``` > [!NOTE] > **This is the closest equivalent to the v1 component**, which always attached to an input you already had. `wrap()` requires an `` element and throws a `TypeError` on anything else. ### Creating one from scratch **JavaScript** ```javascript import { Swiftcomplete, SearchEvents } from '@swiftcomplete/component'; const search = new Swiftcomplete(); search.setAttribute('api-key', 'YOUR_API_KEY'); search.setAttribute('placeholder', 'Search address…'); document.getElementById('container').append(search); search.addEventListener(SearchEvents.Select, (e) => { console.log(e.detail.index, e.detail.selected); }); ``` ## 5. Going further Three things most integrations reach for eventually. None are required to get started. ### what3words search The component can search addresses (the default), three word addresses, or both in the same input. This is controlled on the service, not per element, so every search field on the page follows it. **JavaScript** ```javascript window.swiftcomplete.runWhenReady((api) => { api.setApiKey('YOUR_API_KEY'); api.setSearchFor('address'); // default api.setSearchFor('what3words'); // three word addresses only api.setSearchFor('address', 'what3words'); // both in one box }); ``` Any field without an explicit `placeholder` updates its own wording to match. To capture the three word address, add a `what3words` entry to your field map. > [!NOTE] > **Pasted what3words links work too.** If someone pastes `https://what3words.com/filled.count.soap`, the component strips the URL and searches the three words, including locale subdomains. ### Location biasing > [!NOTE] > **Pasted what3words links work too.** If someone pastes `https://what3words.com/filled.count.soap`, the component strips the URL and searches the three words, including locale subdomains. **JavaScript** ```javascript window.swiftcomplete.runWhenReady((api) => { api.setApiKey('YOUR_API_KEY'); api.enableDeviceLocation(); }); ``` That is the whole setup, with no extra markup. The browser prompts for permission, and the position is reused across searches until you call `disableDeviceLocation()`. Clearing the input does not discard it. > [!NOTE] > **Call it inside `runWhenReady`.** Each search field registers for location updates when it enters the DOM, so requesting the position before the fields exist means nothing receives it. To test with a fixed position in Chrome: DevTools → More tools → Sensors → Location. ### Custom UI Replace the built-in icons and indicators on any element instance. Each method takes an HTML string or a DOM node. **JavaScript** ```javascript const el = document.querySelector('swiftcomplete-search'); el.overrideResetSearchElement(''); el.overrideLoadingElement('Loading…'); el.overrideBackElement('Back'); el.overrideExpandContainerElement('→'); el.overrideScrollHintElement('Scroll for more'); ``` The shadow root is closed, so if you need the input itself, for tests, validation or focus management, use `getInput()` rather than querying into the component. **JavaScript** ```javascript const input = el.getInput(); // HTMLInputElement ``` > [!NOTE] > **Several fields on one page** share one service: API key, country, search type and device location are set once. Field maps and UI overrides stay per element. ## 6. Reference ### Attributes | ATTRIBUTE | VALUES | DESCRIPTION | | --- | --- | --- | | api-key | string | Your Swiftcomplete API key. | | country | ISO 3166-1 alpha-2 | Restrict suggestions to one country. Omit to search all available countries. | | placeholder | string | Placeholder text. If omitted it follows what you're searching for: "Type your address or postcode", or "Type your address, what3words, or postcode" when both are enabled. | | name | string | Form field name, so the value submits with your form. | | value | string | Initial value of the input. | | variant | outlined · filled · minimal · modern | Preset visual style. | | size | default · small · large | Scales font and icon size. | | theme | auto · light · dark | auto is the default and follows the page's prefers-color-scheme. | | class / style | string | Copied onto the inner input. Layout properties are ignored; style the host element for those. | ### Events All events fire on the `` element. They bubble and are composed, so they cross the shadow boundary and you can listen on a parent element or on `document` instead. The constants in `SearchEvents` and `FieldEvents` are the same strings, so you can use either. | EVENT | CONSTANT | EVENT.DETAIL | | --- | --- | --- | | swiftcomplete:swiftcomplete:start | SearchEvents.Start | { query } | | swiftcomplete:swiftcomplete:end | SearchEvents.End | { query, success, results?, reason?, canceled? } | | swiftcomplete:swiftcomplete:select | SearchEvents.Select | { index, selected } | | swiftcomplete:swiftcomplete:manualentry | SearchEvents.ManualEntry | None | | swiftcomplete:field:clear | FieldEvents.Clear | None | | swiftcomplete:field:focus | FieldEvents.Focus | None | | swiftcomplete:field:blur | FieldEvents.Blur | None | ### Service methods Available on the `api` object passed to `runWhenReady`. | METHOD | DEFAULT | DESCRIPTION | | --- | --- | --- | | setApiKey(key) | None | Sets the API key for every component on the page. | | setCountry(code) | all countries | Restricts suggestions to one country. | | setSearchFor(...types) | 'address' | Pass 'address', 'what3words' or both. | | setResultOrdering(order) | None | location\_biasing | | setHideOnEmptyResults(bool) | false | Hide the dropdown instead of showing "no results". | | setEnableSearchOnEmptySearch(bool) | false | Show nearby roads on focus, before the user types. | | enableDeviceLocation() | off | Asks for browser geolocation and biases results towards the user. | > [!NOTE] > **what3words search is off by default.** The component searches addresses only unless you call `setSearchFor('address', 'what3words')`. The v1 component’s snippet enabled both, so this is a deliberate step when migrating. ### Supported countries Austria `at` · Canada `ca` · Denmark `dk` · France `fr` · Germany `de` · Guernsey `gg` · Isle of Man `im` · Italy `it` · Jersey `je` · Liechtenstein `li` · Luxembourg `lu` · Netherlands `nl` · Norway `no` · Switzerland `ch` · United Kingdom `gb` ### Styling The component renders inside a shadow root, so your page’s CSS won’t reach into it. Style it by setting custom properties on the element. **CSS** ```css swiftcomplete-search { --swiftcomplete-input-border-radius: 4px; --swiftcomplete-focus-border-color: #e11f26; --swiftcomplete-font-family: inherit; --swiftcomplete-padding: 0.75em; --swiftcomplete-result-max-items: 6; } ``` | CUSTOM PROPERTY | DEFAULT | | --- | --- | | \--swiftcomplete-background | #fff | | \--swiftcomplete-primary-text-color | #474747 | | \--swiftcomplete-secondary-text-color | #707070 | | \--swiftcomplete-focus-border-color | #007bff | | \--swiftcomplete-error-color | #dc3545 | | \--swiftcomplete-input-border | 1px solid #dedede | | \--swiftcomplete-input-border-radius | 8px | | \--swiftcomplete-padding | 1em | | \--swiftcomplete-icon-size | 16px | | \--swiftcomplete-result-max-items | 5 (4 on tablet, 3 on mobile) | | \--swiftcomplete-min-width | 250px | Around twenty further properties cover the results list, header, footer, scrollbar and hover states. See the [component README](https://www.npmjs.com/package/@swiftcomplete/component) for the full list. --- # JavaScript Component: Integrate Swiftcomplete into Web Forms – Old The JavaScript Swiftcomplete integration is a code snippet that can be included on your website or in your checkout to provide address search with real-time suggestions as you type. Topics: JavaScript, SwiftComplete, Website Source: https://developer.what3words.com/tutorial/javascript-component-integrate-swiftcomplete-into-web-forms-old Updated: 2026-11-27 The [Swiftcomplete](https://what3words.com/swiftcomplete/) API provides real-time address suggestions as you type, eliminating typos and mistakes and reducing the time it takes to find accurate postal addresses. If you need help integrating our Swiftcomplete API into your website or application, [contact us](mailto:support@swiftcomplete.com), and one of our product experts will help you get started. ## 1. Get a Swiftcomplete API key Each request must be authenticated with a Swiftcomplete API key, which you can create in your Swiftcomplete account: [GET API KEY](https://www.swiftcomplete.com/account/api/) ## 2. Add the script to load the Swiftcomplete JavaScript file The JavaScript Swiftcomplete integration is a code snippet that can be included on your website or in your checkout to provide address search with real-time suggestions as you type. Firstly, copy & paste the code snippet into the `` section of your HTML, before the closing ``  tag. > **Note:** Make sure you only copy the code snippet once, even if you have multiple address fields on your page. **JavaScript** ```javascript ``` ## 3. Add Swiftcomplete functionality to a text field Now copy this script and paste it directly after the previous code snippet, before the closing `` tag. To get the script running, replace `INSERT_KEY_HERE` with your Swiftcomplete API key, and replace `INSERT_TEXT_FIELD_ID_HERE` with the ID of an existing textbox on your page. To populate the address into your form, modify `populateLineFormat` to match the fields on your checkout page. The script initialises Swiftcomplete on your existing textbox, restricts searching to Great Britain and logs the record and coordinates to the developer console when you select a result from the list of autocomplete suggestions. **JavaScript** ```javascript ``` ## 4. Test your integration Refresh your page, and try searching in your existing text field. The record and coordinates are printed to the developer console when you click a result from the list of suggestions. ## 5. Troubleshooting **Need help, or have any questions?** Get in touch with our customer support team at [support@swiftcomplete.com](mailto:support@swiftcomplete.com), and we’ll help you get started with the JavaScript integration for the Swiftcomplete API. --- # JavaScript SDK Getting started with the what3words JavaScript SDK. Topics: Angular, JavaScript, React, Vue, Website Source: https://developer.what3words.com/tutorial/javascript-sdk Updated: 2026-11-27 ### Step by Step The JavaScript SDK uses the [JavaScript API Wrapper](https://developer.what3words.com/tutorial/javascript) under the hood, and it supports native web components `@what3words/javascript-components` (which can also be loaded via CDN), Angular components – `@what3words/angular-components`, React components – `@what3words/react-components` and Vue components – `@what3words/vue-components`. The components available for you to use are as follows: – [AutoSuggest Component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) – [Map Component](https://developer.what3words.com/tutorial/using-the-web-map-component) In case you are looking to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into your Node.js/Browser-based environment applications, the [JavaScript API Wrapper](https://developer.what3words.com/tutorial/javascript) is the right technology for your application. ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation This is the script that is at the core of the component libraries. To add the core SDK natively to a web document you should add the what3words `script` tags within the `head` of your document. **JavaScript** ```javascript ... ``` The URL contained in the script tags are the location of JavaScript files that load everything you need for using the [JavaScript API wrapper](https://developer.what3words.com/tutorial/javascript) for the what3words API. **Note**: We prefer to use a fixed version of the production version of your integrations. A specific version can also be specified within the script to ensure a predictable version of the component is loaded, for example `@5.0.0`. A log of versions can be found [here](https://www.npmjs.com/package/@what3words/javascript-components). It is recommended to set up a callback function to attach the what3words API to the window accessible via `window.what3words` in the script within your `head` HTML tag as mentioned below. **JavaScript** ```javascript ... ``` To initiate this function pass a parameter e.g. `sdk` to the callback function `initW3w`. Also, make sure to set up the what3words API key with the `setApiKey` function by replacing the `"YOUR-API-KEY"` with your application’s API key. [Sign up](https://accounts.what3words.com/create-api-key) to obtain your free API key. Otherwise you can add our [AutoSuggest component](https://developer.what3words.com/tutorial/javascript-autosuggest-component) or [Map component](https://developer.what3words.com/tutorial/using-the-web-map-component) to your page with our component tags. **JavaScript** ```javascript function initW3w(sdk) { // Set what3words API key sdk.api.setApiKey('YOUR-API-KEY'); // OR you can also just use the global window object at this point // window.what3words.api.setApiKey("YOUR-API-KEY"); sdk.api .autosuggest({ input: 'freshen.overlook.clo', nFocusResults: 1, clipToCountry: ['FR'], focus: { lat: 48.856618, lng: 2.3522411 }, nResults: 1, language: 'en' }) .then(function (response) { console.log(response); }); sdk.api .convertToCoordinates({ words: 'filled.count.soap', format: 'json' // or format: 'geojson' }) .then(function (response) { console.log(response);  }); sdk.api .convertTo3wa ({ coordinates: { lat: 51.520847, lng: -0.195521 }, language: 'en', format: 'json' // or format: 'geojson' }) .then(function (response) { console.log(response); }); sdk.api .gridSection({ boundingBox: { southwest: { lat: sw.lat, lng: sw.lng }, northeast: { lat: ne.lat, lng: ne.lng } }, format: "geojson" // or format: 'json' }) .then(function (data) { console.log(data) }) .catch(console.error); } ``` ## 3. Usage ### Convert to 3 word address Convert coordinates, expressed as latitude and longitude to a 3 word address. More info about `convertTo3wa`, including returned results is available in the [what3words REST API documentation](https://developer.what3words.com/public-api/docs/#convert-to-3wa). Return standard response: **JavaScript** ```javascript /** * Converts a coordinate to a 3 word address * @param {Object} coordinates - The coordinate object * @param {number} coordinates.lat - The latitude * @param {number} coordinates.lng - The longitude * @param {string} [language= ‘en’] - The language to return the 3 word address in * @param {string} [format= ‘json’ | format= ‘geojson’] * @returns {Promise} Promise 3 word address response */ sdk.api .convertTo3wa ({ coordinates: { lat: 51.520847, lng: -0.195521 }, language: 'en', format: 'json' // or format: 'geojson' }) .then(function (response) { console.log(response); }); ``` ### Convert to coordinates This function converts a 3 word address to a position (expressed as coordinates of latitude and longitude). It takes the words parameter as a string of 3 words `'table.book.chair'` More info about `convertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://developer.what3words.com/public-api/docs/#convert-to-coords). Return standard response: **JavaScript** ```javascript /** * Returns coordinates for a 3 word address * @param {string} words - The 3 word address words to convert to coordinates * @param {string} [format= ‘json’ | format= ‘geojson’] * @returns {Promise} - Promise coordinates response */ sdk.api .convertToCoordinates({ words: 'filled.count.soap', format: 'json' // or format: 'geojson' }) .then(function (response) { console.log(response);  }); ``` ### AutoSuggest When presented with a 3 words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `focus` to user’s current location. This will make `autosuggest` return results which are closer to the user. More information about `autosuggest`, including returned results is available in the [what3words REST API documentation](https://developer.what3words.com/public-api/docs/#autosuggest). **Example:** Basic Autosuggest call. **JavaScript** ```javascript /** * Returns autosuggest results for a search term * @param {string} input - The input to search for autosuggests * @param {Object} [options] - The result filter and clipping options * @param {Object} [options.focus] - The coordinates for the focus of the search * @param {number} [options.focus.lat] - The latitude of the focus * @param {number} [options.focus.lng] - The longitude of the focu * @param {string} [options.nFocusResults] - The number of focused results * @param {string[]} [options.clipToCountry] - The countries to clip results to * @param {Object} [options.clipToBoundingBox] - The bounding box to clip results within * @param {Object} [options.clipToBoundingBox.southwest] - The coordinates of the southwest corner of the clipping box * @param {Object} [options.clipToBoundingBox.southwest.lat] - The latitude of the southwest corner of the clipping box * @param {Object} [options.clipToBoundingBox.southwest.lng] - The longitude of the southwest corner of the clipping box * @param {Object} [options.clipToBoundingBox.northeast] - The coordinates of the northeast corner of the clipping box * @param {Object} [options.clipToBoundingBox.northeast.lat] - The latitude of the northeast corner of the clipping bo * @param {Object} [options.clipToBoundingBox.northeast.lng] - The longitude of the northeast corner of the clipping box * @param {Object} [options.clipToCircle] - The circle to clip results within * @param {Object} [options.clipToCircle.center] - The center of the circle to clip results within * @param {number} [options.clipToCircle.center.lat] - The latitude of the center of the circle to clip results within * @param {number} [options.clipToCircle.center.lng] - The longitude of the center of the circle to clip results within * @param {number} [options.clipToCircle.radius] - The radius of the circle to clip results within * @param {number[]} [options.clipToPolygon] - An array of polygon coordinates to clip results within * @param {string} [options.inputType] - 'text' | 'vocon-hybrid' | 'nmdp-asr' | 'generic-voice' * @param {string} [options.language] - The language to return autosuggest results in * @param {boolean} [options.preferLand] - Whether to bias towards results that are over land vs over the sea. * @returns {Promise} - Promise 3 word address autosuggestions response */ sdk.api .autosuggest({ input: 'freshen.overlook.clo', language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, clipping the results returned to France and Germany. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'freshen.overlook.clo', clipToCountry: ['FR', 'DE'], language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, clipping to a circle. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'freshen.overlook.clo', clipToCircle: {center: {lat:51.4243877, lng:-0.34745}, radius:50}, language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, clipping to a polygon. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'freshen.overlook.clo', clipToPolygon: [{ lat: 51.421, lng: -0.343 }, { lat: 52.6, lng: 2.3324 }, { lat: 54.234, lng: 8.343 }, { lat: 51.421, lng: -0.343 }], language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, clipping to a bounding box. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'fun.with.code', clipToBoundingBox:{ southwest: { lat: 51.521, lng: -0.343 }, northeast: { lat: 52.6, lng: 2.3324 } }, language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, Focus on (51.4243877,-0.34745). **JavaScript** ```javascript sdk.api .autosuggest({ input: 'fun.with.code', focus: {lat:51.4243877, lng:-0.34745}, language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, Focus on (51.4243877,-0.34745) and then determine how many results within the response it applies to. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'fun.with.code', focus: {lat:51.4243877, lng:-0.34745}, nFocusResults: 2, language: 'en' }) .then(function (response) { console.log(response); }); ``` > [!NOTE] > **Example:** AutoSuggest, with Generic Voice input type. **JavaScript** ```javascript sdk.api .autosuggest({ input: 'fun.with.code', inputType: 'generic-voice', language: 'en' }) .then(function (response) { console.log(response); }); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `gridSection`, including returned results is available in the [what3words REST API documentation](https://developer.what3words.com/public-api/docs/#grid-section). Return standard response: **JavaScript** ```javascript /** * Returns a section of the what3words grid * @param {Object} boundingBox - The bounding box for the grid to return * @param {Object} [boundingBox.southwest] - The coordinates of the southwest corner of the bounding box * @param {Object} [boundingBox.southwest.lat] - The latitude of the southwest corner of the bounding box * @param {Object} [boundingBox.southwest.lng] - The longitude of the southwest corner of the bounding box * @param {Object} [boundingBox.northeast] - The coordinates of the northeast corner of the bounding box * @param {Object} [boundingBox.northeast.lat] - The latitude of the northeast corner of the bounding box * @param {Object} [boundingBox.northeast.lng] - The longitude of the northeast corner of the bounding box * @param {string} [format= ‘json’ | format= ‘geojson’] * @return {Promise} - Promise the grid section */ sdk.api .gridSection({ boundingBox: { southwest: { lat: sw.lat, //replace sw.lat with your south west latitude lng: sw.lng //replace sw.lng with your south west longitude }, northeast: { lat: ne.lat, //replace ne.lat with your north east latitude lng: ne.lng //replace ne.lat with your north east longitude } }, format: "json" // or format:"geojson" }) .then(function (data) { console.log(data }) .catch(console.error); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `availableLanguages`, including returned results is available in the [what3words REST API documentation](https://developer.what3words.com/public-api/docs/#available-languages). **JavaScript** ```javascript /** * Returns the available languages supported by what3words API * @returns {Promise} - Promise the available languages response */ sdk.api .availableLanguages() .then(function (n) { console.log("[availableLanguages]", n) }); ``` ### Handling errors Errors returned from the API can be caught with the wrapper through the use of a `catch` function. Within the `catch` function, `code` and `message` values which represent the error, are accessible from the `error` object parameter. **JavaScript** ```javascript sdk.api .convertToCoordinates({ words: 'filled.count.soap', format: 'json' // or format: 'geojson' }) .then(function (response) { console.log(response); }) .catch(function(error) { // catch errors here console.log("[code]", error.code); console.log("[message]", error.message); }); ``` ## 4. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 5. Full example The example below takes the concepts described in the step-by-step and turns some of them into a complete example. Here we take a partial 3 word address and pass it into AutoSuggest – clipping the results to consider only addresses in France, setting a focus on Paris, and returning a single result. We also show how easy is to implement the AutoSuggest Component instead of using the JavaScript SDK. We then take the result convert the 3 word address to coordinates, and find the nearest place. **JavaScript** ```javascript what3words JavaScript SDK

Add what3words AutoSuggest Component to your page


Or programatically access the what3words API

Top 3 word address match:

WGS84 Coordinates:

Nearest Place:

``` --- # Legacy Android Getting started with the what3words Android API wrapper Topics: Android, Mobile App Source: https://developer.what3words.com/tutorial/legacy-android Updated: 2026-11-27 ### Step by step > #### **Note**: This library has been deprecated and will no longer receive support. To upgrade to the Version 4.x of the Android API Wrapper library, please refer to this [Version 4.x Tutorial](https://developer.what3words.com/tutorial/android) and this [Migration Guide](https://developer.what3words.com/tutorial/migrating-android-api-wrapper-from-version-3-x-to-4-x). The Android API wrapper is useful for Android developers who wish to seamlessly integrate the [what3words API](https://docs.what3words.com/api/v3/) into their Android applications, without the hassle of having to manage the low level API calls themselves. The what3words API allows conversion between 3-word addresses (e.g., ///index.home.raft) and coordinates (e.g., -0.203586, 51.521251). It features powerful autosuggest functions to validate and autocorrect user input, restrict suggestions to specific areas, request sections of the what3words grid as GeoJSON, and list all supported languages. Advanced users can also post-process voice output with autosuggest. All coordinates are in latitude, longitude pairs using the WGS-84 standard, with latitudes ranging from -90 to 90. Full sample app for the wrapper can be found in our Github repo [Android Sample Apps](https://github.com/what3words/w3w-android-samples) ## 1. Get an API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The library is available through [Maven Central](https://search.maven.org/search?q=g:com.what3words). Please add the following to your `gradle.build:` **Android** ```java implementation 'com.what3words:w3w-android-wrapper:3.1.22' ``` ## 3. Setup Add to AndroidManifest.xml: **Android** ```java ``` Add the following to build.gradle (app level): **Android** ```java android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { ... // we are going to use coroutines for kotlin examples, feel free to use any other library of your choice. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7" // we are going to use rxjava for java examples, feel free to use any other library of your choice. implementation 'io.reactivex.rxjava3:rxjava:3.0.7' implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' } ``` ## 4. Usage ### convertTo3wa example in kotlin with Coroutines. Because it is not possible to perform a networking operation on the main application thread, API calls need to be made in a background thread, we used Coroutines in this example. *for more Kotlin examples try our [**sample app** in this repo](https://github.com/what3words/w3w-android-wrapper)*. **Android** ```kotlin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) CoroutineScope(Dispatchers.IO).launch { //use wrapper.convertTo3wa() with Dispatcher.IO - background thread val result = wrapper.convertTo3wa(Coordinates("51.2305", "-0.24123")).execute() CoroutineScope(Dispatchers.Main).launch { //use Dispatcher.Main to update your views with the results if needed - Main thread if (result.isSuccessful) { Log.i("MainActivity", "3 word address: ${result.words}") } else { Log.e("MainActivity", result.error.message) } } } } } ``` ### convertTo3wa example in Java with RxJava Because it is not possible to perform a networking operation on the main application thread, API calls need to be made in a background thread, we used RxJava in this example. for more Java examples try our sample-java app in this repo **Java** ```java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); What3WordsV3 wrapper = new What3WordsV3("YOUR_API_KEY_HERE", this); Observable.fromCallable(() -> wrapper.convertTo3wa(new Coordinates(51.2423, -0.12423)).execute()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { if (result.isSuccessful()) { Log.i("MainActivity", String.format("3 word address: %s", result.getWords())); } else { Log.e("MainActivity", result.getError().getMessage()); } }); } } ``` ### voice autosuggest example in Kotlin The Voice API AutoSuggest allows the user to say 3 words and using speech recognition technology displays 3 word address suggestions to the user. Before enabling Voice AutoSuggest you will need to add a Voice API plan in [your account](https://accounts.what3words.com/billing). For a full working example with voice and AUDIO\_RECORD permission, request check our [sample](https://github.com/what3words/w3w-android-wrapper/blob/master/sample/src/main/java/com/what3words/androidwrappersample/MainActivity.kt) and [sample-java](https://github.com/what3words/w3w-android-wrapper/blob/master/sample-java/src/main/java/com/what3words/androidwrappersamplejava/MainActivity.java) Note: Please bear in mind that the Android Emulator cannot record audio. Therefore, you will need to test on a real device that can record. **Kotlin** ```kotlin val microphone = VoiceBuilder.Microphone().onListening { volume -> Log.i("VoiceSample","volume: $volume") } wrapper.autosuggest(microphone, "en") .focus(51.423, -0.1245) .onSuggestions { suggestions -> Log.i("VoiceSample","Suggestions: ${suggestions.joinToString { it.words }}") }.onError { error -> Log.e("VoiceSample", error) }.startListening() ``` ### Other available wrapper calls and examples. wrapper.convertToCoordinates() – Convert a 3 word address to a latitude and longitude **Kotlin** ```kotlin val result = wrapper.convertToCoordinates("index.home.raft").execute() ``` **wrapper.autosuggest()** – AutoSuggest can take a slightly incorrect 3 word address, and suggest a list of valid 3 word addresses. For more autosuggest proprieties similar to *focus* below go to our [documentation](https://developer.what3words.com/public-api/docs#autosuggest) **Kotlin** ```kotlin val result = wrapper.autosuggest("index.home.r").focus(51.502,-0.12345).execute() ``` **wrapper.gridSection()** – Returns a section of the 3m x 3m what3words grid for a bounding box. **Kotlin** ```kotlin val result = wrapper.gridSection(BoundingBox( Coordinates(51.515900, -0.212517), Coordinates(51.527649, -0.191746) )).execute() ``` **wrapper.availableLanguages()** – Retrieves a list all available 3 word address languages. **Kotlin** ```kotlin val result = wrapper.availableLanguages().execute() ``` If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server like so: **Kotlin** ```kotlin val wrapper = What3Words("YOUR_API_KEY_HERE", "https://api.yourserver.com") ``` > #### **Reminder**: To upgrade to the latest version (4.x) of the Android API Wrapper library, please refer to the [Migration Guide from Version 3.x to 4.x](https://developer.what3words.com/tutorial/migrating-android-api-wrapper-from-version-3-x-to-4-x). --- # Migrating an application from API V2 to API V3 Moving applications that have previously used API V2 to API V3 Topics: Android, Java, JavaScript, NodeJS, Objective-C, PHP, Python, Swift, Mobile App, Server and Scripting, Website Section: [Guidelines & Support](https://developer.what3words.com/docs/guidelines-support.md) Source: https://developer.what3words.com/tutorial/migrating-an-application-from-api-v2-to-api-v3 Updated: 2026-11-27 ### Differences V3 The what3words API has been updated to V3 with the benefits of a simplified interface and new functionality. AutoSuggest has been greatly simplified and now features powerful new country clipping. Error handling has been improved for v3, making it easier and more robust to use v3. With the release of V3 of the what3words API, V2 of the API is now officially *deprecated*, though V2 and V3 will continue to run in parallel for some time. ## 1. Resource names To bring consistency to our function names across all our offline SDKs and our online API, the v2 API resource names have changed in v3, as follows: - `forward` is now `convert-to-coordinates` - `reverse` is now `convert-to-3wa` - `grid` is now `grid-section` - `languages` is now `available-languages` - `autosuggest`, `voice-autosuggest`, `standardblend` and `voice-standardblend` has been greatly simplified and combined into one v3 function: `autosuggest` In many cases, the parameters have changed. Please refer to [the v3 API Reference Docs.](https://developer.what3words.com/public-api/docs/) ## 2. Standardblend The Standardblend resource has been removed but the functionality can be easily replicated within the unified autosuggest function. To implement in v3 call `autosuggest` with `n-focus-results=1`. This replicates the V2 `standardblend` behaviour, which was to have one focussed result, and the rest unfocussed. ## 3. API response formats By default, V2 of the API returns a payload in JSON; optional format types of GeoJSON is also supported. Due to low usage, JSONP and XML are no longer supported. ## 4. HTTP status codes and API error codes V3 of the API now uses appropriate HTTP status code. It returns a `200` on success. For more details see [here](https://developer.what3words.com/public-api/docs/#error-handling). --- # Migrating Android API Wrapper from version 3.x. to 4.x This guide helps developers transition from version 3.x to 4.x with clear examples and detailed references. Topics: Android, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/migrating-android-api-wrapper-from-version-3-x-to-4-x Updated: 2026-11-27 In version 4.0, the Android API Wrapper library changed significantly. This guide will help you gradually adapt your existing code to the new wrapper. **Note**: - For users still using version 3.x, you can access the legacy Android tutorial [here](https://developer.what3words.com/tutorial/legacy-android). - For users using version 4.x, you can access the latest Android tutorial [here](https://developer.what3words.com/tutorial/android). ## 1. Introduction to the Core Library The core library establishes essential models and interfaces that maintain consistency across various other libraries. Significant changes have been made by substituting existing models with those from the core library. It is imperative to update your code accordingly to utilise these new models. **Android v4 Tutorial**: For a comprehensive guide on using the latest version 4.x, see its tutorial [here](https://developer.what3words.com/tutorial/android). ### Model Replacements | Android v3 models | Android v4 models | | --- | --- | | com.what3words.javawrapper.response.SuggestionWithCoordinates | com.what3words.core.types.domain.W3WSuggestion | | com.what3words.javawrapper.request.AutosuggestOptions | com.what3words.core.types.options.W3WAutosuggestOptions | | com.what3words.javawrapper.response.Coordinates | com.what3words.core.types.geometry.W3WCoordinates | | com.what3words.javawrapper.response.Square | com.what3words.core.types.geometry.W3WRectangle | | com.what3words.core.domain.language.W3WLanguage | com.what3words.core.types.language.W3WLanguage | | com.what3words.javawrapper.request.BoundingBox | com.what3words.core.types.geometry.W3WRectangle | | com.what3words.androidwrapper.voice.Microphone | com.what3words.core.datasource.voice.audiostream.W3WMicrophone | ## 2. Transition to W3WApiTextDataSource and W3WApiVoiceDataSource The Android API Wrapper version 3 What3WordsV3 has been restructured into two distinct classes: - **W3WApiTextDataSource**: Handles text-based tasks like address searching and conversions. - **W3WApiVoiceDataSource**: Specialises in voice-based address suggestions. For more information on version 4.x usage, see the latest tutorial [here](https://developer.what3words.com/tutorial/android). ## 3. Method Changes List ### convertToCoordinates Converts a what3words address to coordinates. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.convertToCoordinates(words).execute() ``` **Parameters**: - `words`: String (the what3words address to convert) **Return**: ConvertToCoordinates (coordinates corresponding to the what3words address) **Android v4** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, API_KEY) val result = textDataSource.convertToCoordinates(words) // Must run on background thread ``` **Parameters**: - `words`: String (the what3words address to convert) **Return**: W3WResult (result containing the coordinates) For more details and instructions, see [Convert to Coordinates Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#converttocoordinates-example). ### convertTo3wa Converts coordinates to a what3words address. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.convertTo3wa(coordinates).execute() ``` **Parameters**: - `coordinates`: Coordinates (latitude and longitude to convert) **Return**: ConvertTo3WA (the corresponding what3words address) **Android v4** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, API_KEY) val result = textDataSource.convertTo3wa(coordinates, language) // Must run on background thread ``` **Parameters**: - `coordinates`: W3WCoordinates (latitude and longitude to convert) - `language`: W3WLanguage (the language for the what3words address) **Return**: W3WResult (result containing the what3words address) For more details and instructions, see [Convert to what3words Address Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#converttocoordinates-example). ### AutoSuggest Provides address suggestions based on a partial or full what3words address. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.autosuggest(word).execute() ``` **Parameters**: - `word`: String (the partial or full what3words address to get suggestions for) **Return**: Autosuggest (list of suggested addresses) **Android v4** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, API_KEY) val result = textDataSource.autosuggest(word, options) // Must run on background thread ``` **Parameters**: - `word`: String (the partial or full what3words address to get suggestions for) - `options`: W3WAutosuggestOptions? (optional parameters to refine suggestions) **Return**: W3WResult> (result containing the list of suggestions) For more details and instructions, see [Autosuggest Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#autosuggest-example). ### availableLanguages Fetches the list of available languages for what3words addresses. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.availableLanguages().execute() ``` **Return**: AvailableLanguages (set of supported languages) **Android v4** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, API_KEY) val result = textDataSource.availableLanguages() // Must run on background thread ``` **Return**: W3WResult> (result containing the set of supported languages) For more details and instructions, see [Get Available Languages Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#availablelanguages-example). ### gridSection Retrieves a section of the what3words address grid for a specified bounding box. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.gridSection(boudingBox).execute() ``` **Parameters**: - `boundingBox`: BoundingBox (the area to get the grid section for) **Return**: GridSection (section of the grid) **Android v4** ```kotlin val textDataSource = W3WApiTextDataSource.create(context, API_KEY) val result = textDataSource.gridSection(boundingBox) // Must run on background thread ``` - **Parameters**: - `boundingBox`: W3WRectangle (the area to get the grid section for) - **Return**: W3WResult (result containing the section of the grid) For more details and instructions, see [Grid Section Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#gridsection-example). ### Voice AutoSuggest Provides address suggestions based on voice input. **Android v3** ```kotlin val wrapper = What3WordsV3(API_KEY, activityContext) val result = wrapper.autosuggest(microphone, voiceLanguage) .onSuggstions { suggestions -> // Handle the suggestions } .onError { error -> // Handle the error } ``` **Parameters**: - `microphone`: Microphone (the audio input device) - `voiceLanguage`: String (the language for voice recognition) **Return**: - `suggestions`: List (list of suggested addresses) - `error`: APIResponse.What3WordsError (error information) **Android v4** ```kotlin val voiceDataSource = W3WApiVoiceDataSource.create(API_KEY) val result = voiceDataSource.autosuggest( audioStream, voiceLanguage, options, onSpeechDetected, ) { result -> // Handle result } ``` **Parameters**: - `input`: W3WAudioStream (the audio input stream) - `voiceLanguage`: W3WLanguage (the language for voice recognition) - `options`: W3WAutosuggestOptions? (optional parameters to refine suggestions) - `onSpeechDetected`: ((String) -> Unit)? (callback for speech detection) **Return**: - `result`: W3WResult> (result containing the list of suggestions) For more details and instructions, see [Voice Autosuggest Example](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#w3wapivoicedatasource). ## 4. AutosuggestHelper In the previous version, AutosuggestHelper relied on the Android API Wrapper v3 (What3WordsV3). Now, it has transitioned to using `W3WApiTextDataSource`. **Android v3** ```kotlin val what3words = What3WordsV3("YOUR_API_KEY_HERE", this) val autosuggestHelper = AutosuggestHelper(what3words) ``` **Android v4** ```kotlin val dataSource = W3WApiTextDataSource.create(context, "YOUR_API_KEY_HERE") val autosuggestHelper = AutosuggestHelper(dataSource) ``` For more details and instructions, see [AutoSuggestHelper](https://github.com/what3words/w3w-android-wrapper?tab=readme-ov-file#using-autosuggesthelper-class). --- # Mobile linking to the what3words app Using intents and the custom URL scheme to open the what3words app at a location Topics: Android, Objective-C, Swift, Mobile App Section: [Guidelines & Support](https://developer.what3words.com/docs/guidelines-support.md) Source: https://developer.what3words.com/tutorial/mobile-linking-to-the-what3words-app Updated: 2026-11-27 ### Step by step The what3words mobile apps on Android and on iOS support the ability to allow your mobile app to send the user to the what3words app. You can either open the what3words app at the user’s current location or navigate directly to a 3 word address. ## 1. Android intents In your Android app, you can create a request to send the user to the what3words app using an [`Intent`](https://developer.android.com/training/basics/intents/sending.html) . **Android** ```java Intent intent = packageManager.getLaunchIntentForPackage("com.what3words.android"); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse("w3w://show?threewords=daring.lion.race")); startActivity(intent); ``` ## 2. iOS URL Schemes In your iOS app, you can create a request to send the user to the what3words app using a [URL scheme for inter-app communication](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html). **Objective-C** ```objective-c NSURL *myURL = [NSURL URLWithString:@"w3w://show?threewords=index.home.raft"]; [[UIApplication sharedApplication] openURL:myURL] ``` **Swift** ```swift if let url = URL(string: "w3w://show?threewords=fancy.duck.cloud") { UIApplication.shared.open(url, options: [:]) { (success) in print("Opened: \(success)") } } ``` ## 3. Supported URIs - To open the what3words app at the user’s current location, use the URI `w3w://show?currentlocation`. - To navigate to a 3 word address in the what3words app, use the URI `w3w://show?threewords=[word.word.word]`, replacing `[word.word.word]` with a 3 word address and omitting the square brackets. --- # Navigation How to add what3words to a navigation app Topics: Android, Java, Objective-C, Swift, Mobile App Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [Enable Existing Search Box](https://developer.what3words.com/docs/search-box/enable-existing-search-box.md) Source: https://developer.what3words.com/tutorial/navigation Updated: 2026-11-27 ### Step by step The easiest way to add what3words to your navigation applications is to use one of what3words API wrapper libraries in [**Java**](https://developer.what3words.com/tutorial/android#get-an-api-key) and [**Kotlin**](https://developer.what3words.com/tutorial/android#get-an-api-key) for your Android apps or in [**Swift**](https://developer.what3words.com/tutorial/swift) for your iOS apps. Follow our [UX guidelines](https://developer.what3words.com/tutorial/ux-guidelines) and these easy self-explanatory steps on how to integrate what3words into a navigation app. ## 1. Get a what3words API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Install API wrapper To utilise our wrappers, you will first need to download the packages, from either [**Maven Central**](https://central.sonatype.com/artifact/com.what3words/w3w-android-wrapper) (or this [**GitHub page**](https://github.com/what3words/w3w-android-wrapper)) or through the [**Swift Package Manager**](https://swift.org/package-manager). For full details on how to install and initialise the what3words wrappers, see the [**Swift**](https://developer.what3words.com/tutorial/swift) and [**Android**](https://developer.what3words.com/tutorial/android) wrapper tutorials. **Note:** For Android integrations, we recommend using exclusively—either the what3words Android wrapper or the what3words Java wrapper. The what3words Android wrapper essentially encompasses the functionality of the Java wrapper, offering additional features such as **voice capabilities** and the ability to manage **API key restrictions**. The code snippets that we have added in this tutorial assume that you will be using the [what3words Android wrapper](https://developer.what3words.com/tutorial/android). ## 3. Add suggestions to the search bar To aid user education, it is useful to add placeholder text in your app’s address search bar indicating to users that what3words addresses can be searched for. ![An example of placeholder text](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f966dede25905b296aa5f14b9b4f5a4b677060906b4f35f7f2aa6db07aadbbbb.w1600.webp) what3words address entry encompasses: - copy and paste a what3words address into the search bar (with or without the preceding `///`) - detect when a user is typing in a what3words address and display intelligent suggestions using the what3words API’s AutoSuggest functionality (this will be covered in more detail at a later step) The latter case requires utilising the RegEx function of our wrappers, to identify the what3words address pattern. what3words Address Detection Example: **Java** ```java import com.what3words.javawrapper.What3WordsV3 String text = "index.home.raft" if(What3WordsV3.isPossible3wa(text)){ System.out.println("Input is in the form of a three word address") } else { System.out.println("Input is NOT in the form of a three word address") } ``` **Kotlin** ```kotlin import com.what3words.javawrapper.What3WordsV3 val text = "index.home.raft" if(What3WordsV3.isPossible3wa(text)){ println("Input is in the form of a three word address") } else { println("Input is NOT in the form of a three word address") } ``` **Swift** ```swift import W3WSwiftApi import CoreLocation let api = What3WordsV3(apiKey: "YourApiKey") let text = "index.home.raft" let matches = api.findPossible3wa(text: text) for match in matches { print(" Found:", match) } ``` ## 4. Enable calls to the API for suggestions Once the user has entered the first letter of the final word of a what3words address, your app should call the what3words API to provide intelligent what3words address suggestions, using our API’s AutoSuggest endpoint. These results will be updated as the user continues entering the what3words address. A highly important step in optimising the user experience is in contextualising the address suggestions to where the user is located. This can be done by supplying the API with the user’s device location, enabling the returned suggestions to be tailored to the user’s current location using an API call parameter called `focus`. Similarly, if your service operates in a fixed country, you can use the `clip-to-country` parameter to restrict the returned suggestions to geographically relevant results. AutoSuggest API Call Example: **Java** ```java import com.what3words.javawrapper.request.Coordinates // Create optional options to fine-tune the autosuggest request AutosuggestOptions options = AutosuggestOptions() Coordinates focus = Coordinates(/*latitude:*/51.502,/*longitude:*/-0.12345) options.setFocus(focus) Autosuggest result = wrapper.autosuggest("filled.count.so").options(options).execute() if (result.isSuccessful) { System.out.println(result.suggestions.size) } else { System.out.println(resut.error.message) } ``` **Kotlin** ```kotlin import com.what3words.javawrapper.request.Coordinates // Create optional options to fine-tune the autosuggest request val options = AutosuggestOptions() options.focus = Coordinates(/*latitude:*/51.502,/*longitude:*/-0.12345) val result: Autosuggest= wrapper.autosuggest("filled.count.so").options(options).execute() if (result.isSuccessful) { println(result.suggestions.size) } else { println(result.error.message) } ``` **Swift** ```swift import W3WSwiftApi import CoreLocation let api = What3WordsV3(apiKey: "YourApiKey") let coords = CLLocationCoordinate2D(latitude: 51.4243877, longitude: -0.34745) api.autosuggest(text: "index.raft.ho", options: W3WOptions().focus(coords)) { (suggestions, error) in print(suggestions ?? []) } ``` ## 5. Displaying AutoSuggest results As the user types the final word of the what3words address, you can show 3 AutoSuggest results with each keystroke; offering intelligent address suggestions to the user, and expediting the entry of the correct address. There are three components to effectively displaying a what3words address suggestion: - three slashes preceding the what3words address (e.g. `///filled.count.soap`) - the nearest place listed alongside the address suggestion (given as `nearestPlace` in the API response) - distance from the user to the suggested address location (this is given by the `distanceToFocusKm` result in the API AutoSuggest response) Collectively, the final two points help provide the suggested address’ location context to the user, and the first signifies that the suggested address is a what3words address, not a traditional street address. ![suggestions in navigation app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d8752f5266c25e133969bcf14ae55adbdafb6242dc7dfb7671b60717ab4cb8e2.w1600.webp) ## 6. Validate what3words and get coordinates Once the user has selected the desired what3words address from the list of suggestions, it needs to be converted into standard GPS coordinates to then plot the point on the map using your standard POI marker, enable route calculation, or display travel options. ![Validate what3words and get coordinates](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/42ff30f351b619f2517064d5ed82307eda5d3f920be61c1ca77e25d7393311fa.w1600.webp) To do this, use the `convertToCoordinates` wrapper function. An example of doing this using our mobile wrappers is given below: **Java** ```java String selectedSuggestion = "filled.count.soap" ConvertToCoordinates result = wrapper.convertToCoordinates(selectedSuggestion) if (result.isSuccessful) { System.out.println("Coordinates: ${result.coordinates.lat}, ${result.coordinates.lng}") } else { System.out.println(result.error.message) } ``` **Kotlin** ```kotlin String selectedSuggestion = "filled.count.soap" ConvertToCoordinates result = wrapper.convertToCoordinates(selectedSuggestion) if (result.isSuccessful) { System.out.println("Coordinates: ${result.coordinates.lat}, ${result.coordinates.lng}") } else { System.out.println(result.error.message) } ``` **Swift** ```swift val selectedSuggestion = "filled.count.soap" val result: ConvertToCoordinates = wrapper.convertToCoordinates(selectedSuggestion).execute() if (result.isSuccessful) { println("Coordinates: ${result.coordinates.lat}, ${result.coordinates.lng}") } else { println(result.error.message) } ``` ### Development Checklist ### API Sign Up & Library Installation - Created an API key for the what3words API; - The packages have been loaded correctly, and the API initialised according to the relevant wrapper guidance. ### Address Search - Placeholder text in the search bar educates the user on the ability to enter what3words addresses; - The keyboard displays the full stop on the first screen shown to the user; - Check if the keyboard supports all enabled languages; - Up until the final word of the what3words address is entered, traditional destination options are returned; - Once the final word begins to be entered, what3words results are shown. ### AutoSuggest ### API Parameters - Focus is enabled; - Other parameters, such as clipping, or language settings, are enabled (if applicable). ### Front End - Results update live with each keystroke; - Three what3words address suggestions are displayed per keystroke; - Nearest place information (either ours or via an alternative source) is displayed alongside distance from the user; - /// is affixed to the address (e.g. ///filled.count.soap vs. filled.count.soap); - If there is use of what3words brand assets, they must be the current versions; - Correct localisation of copy for non-English languages (e.g. distances stated in kilometers or miles). ### Contact Support ### Have any questions? We’re here to support you! If you have any questions while using what3words for Excel, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Objective-C Getting started with the what3words Objective-C API wrapper. Topics: Objective-C, Mobile App, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/objective-c Updated: 2026-11-27 The Objective-C wrapper is useful for Objective-C developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their Objective-C applications, without the hassle of having to manage the low level API calls themselves. Full sample apps for the wrapper can be found in our Github repo [iOS Sample Apps](https://github.com/what3words/w3w-swift-samples) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation You can install the [what3Words API V3 Objective-C Wrapper](https://github.com/what3words/w3w-objectivec-wrapper) into your project using CocoaPods, or Carthage (see the package manager code below). Find out more on this repository [Objective-C Wrapper](https://github.com/what3words/w3w-objectivec-wrapper) **Objective-C** ```objective-c platform :ios, '9.0' use_frameworks! target 'MyApp' do pod 'what3words', :git => 'https://github.com/what3words/w3w-objectivec-wrapper.git' end ``` Carthage: **Objective-C** ```objective-c github "what3words/w3w-objectivec-wrapper" ``` For manual installation, `Drop the [W3wGeocoder.m](https://github.com/what3words/w3w-objectivec-wrapper/blob/master/Sources/W3wGeocoder.m) and [W3wGeocoder.h](https://github.com/what3words/w3w-objectivec-wrapper/blob/master/Sources/W3wGeocoder.h) file into your project.` ## 3. Setup Use these header files: **Objective-C** ```objective-c #import "W3wGeocoder.h" #import ``` Or, if you are using Carthage: **Objective-C** ```objective-c #import #import ``` ## 4. Initialise First create a W3wGeocoder object: **Objective-C** ```objective-c W3wGeocoder *api = [[W3wGeocoder alloc] initWithApiKey:@""]; ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. It takes the latitude and longitude as a [CLLocationCoordinate2D](https://developer.apple.com/documentation/corelocation/cllocationcoordinate2d?language=swift) object. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.520847, -0.195521`): **Objective-C** ```objective-c CLLocationCoordinate2D coordinates = CLLocationCoordinate2DMake(51.520847, -0.195521); [api convertTo3wa:coordinates completion:^(W3wPlace *place, W3wError *error) { NSLog(@"%@", place.words); }]; ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Objective-C** ```objective-c [api convertToCoordinates:@"filled.count.soap" format:JSON completion:^(W3wPlace *place, W3wError *error) { NSLog(@"Coordinates are: (%f, %f)", place.coordinates.latitude, place.coordinates.longitude); }]; ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location.  This returns an `Array?` of `W3wSuggestion` objects. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Objective-C** ```objective-c [api autosuggest:@"geschaft.planter.carciofi" completion:^(NSArray *suggestions, W3wError *error) { W3wSuggestion *first_match = suggestions[0]; NSLog(@"%@", first_match.words); }]; ``` **Code example** AutoSuggest, clipping the results returned to Germany: **Objective-C** ```objective-c [api autosuggest:@"geschaft.planter.carciofi" parameters:@[[AutoSuggestOption clipToCountry:@"DE"], [AutoSuggestOption numberResults:4]] completion:^(NSArray *suggestions, W3wError *error) { W3wSuggestion *first_match = suggestions[0]; NSLog(@"%@", first_match.words); }]; ``` **Code example** Focus on (51.4243877,-0.34745) **Objective-C** ```objective-c [api autosuggest:@"fun.with.code" parameters:@[[AutoSuggestOption focus:CLLocationCoordinate2DMake(51.4243877, -0.3474524)], [AutoSuggestOption numberResults:6]] completion:^(NSArray *suggestions, W3wError *error) { W3wSuggestion *first_match = suggestions[0]; NSLog(@"%@", first_match.words); }]; ``` **Code example** AutoSuggest, with Generic Voice input type. **Objective-C** ```objective-c [api autosuggest:@"fun with code" parameters:@[[AutoSuggestOption fallBackLanguage:@"EN"], [AutoSuggestOption inputType:GENERIC_VOICE]] completion:^(NSArray *suggestions, W3wError *error) { W3wSuggestion *first_match = suggestions[0]; NSLog(@"%@", first_match.words); }]; ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Objective-C** ```objective-c [api gridSection:52.208867 west_lng:0.117540 north_lat:52.207988 east_lng:0.116126 format:JSON completion:^(NSArray *grid, W3wError *error) { W3wLine *first_line = grid[0]; NSLog(@"First line goes from (%.5f,%.5f) to (%.5f,%.5f)", first_line.start.latitude, first_line.start.longitude, first_line.end.latitude, first_line.end.longitude); }]; ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Objective-C** ```objective-c [api availableLanguages:^(NSArray *languages, W3wError *error) { W3wLanguage *language = languages[0]; NSLog(@"First language returned: %@", language.name); }]; ``` ### Handling errors All functions call the completion block with error as the second parameter. Be sure to check it for possible problems. **Objective-C** ```objective-c [api convertToCoordinates:@"aaaa.bbbb.cccc" format:JSON completion:^(W3wPlace *result, W3wError *error) { if (error) NSLog(@"There was an %@ error: %@", error.code, error.message); }]; ``` ## 6. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 7. Full example Complete example using AutoSuggest to find a location. **Objective-C** ```objective-c #import "W3wGeocoder.h" #import W3wGeocoder *api = [[W3wGeocoder alloc] initWithApiKey:@""]; AutoSuggestOption *france = [AutoSuggestOption clipToCountry:@"FR"]; AutoSuggestOption *place = [AutoSuggestOption focus:CLLocationCoordinate2DMake(48.856618, 2.3522411)]; AutoSuggestOption *count = [AutoSuggestOption numberResults:10]; [api autosuggest:@"hangry.selfie.x" parameters:@[france, place, count] completion:^(NSArray *suggestions, W3wError *error) { if (error) NSLog(@"There was an %@ error: %@", error.code, error.message); else { NSLog(@"Suggestions Returned:"); for (W3wSuggestion *suggestion in suggestions) { NSLog(@"%@ is near %@", suggestion.words, suggestion.nearestPlace); } } }]; ``` --- # Partner API Docs The what3words Partner API allows Partners to create and manage what3words API keys programmatically. Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) Source: https://developer.what3words.com/tutorial/partner-api-docs-what3words Updated: 2025-11-14 The what3words Partner API allows Partners to create and manage what3words API keys programmatically. The following tasks can be performed using the Partner API 1. Create an API key 2. Get a list of all of an accounts API keys 3. Change status of an API key (disable/enable) ## 1. Get Started - Create a what3words account by signing up to a plan You will need a what3words API key to complete this tutorial [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). - Contact your account manager to request access to the Partner API - Once enabled, obtain your Partner API key from your account manager - Use your Partner API key in requests to the API ### Tips 1. Use HTTPS GET, POST and PATCH methods only 2. Remember to always URL encode your parameters 3. Always include a valid Partner API key in the key=\[YOUR\_API\_KEY\] parameter ### Authentication The what3words Partner API uses [API keys](https://accounts.what3words.com/overview) to authenticate requests. Partner API Keys differ from keys for our main API with keys being 12 characters and prefixed “PK”.  All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). Calls made over HTTP will fail. API requests without authentication will also fail. ### Error handling If all went well, you will get a **200 HTTP** status code. If something went wrong, such as trying `application` POST without a key you will get the appropriate HTTP error status (403 in this case). Also, the body will contain a `message_code` which can be used programmatically so you can respond appropriately. `message` is intended as a helpful message to help you understand how to fix what went wrong. ### Response Codes 1. **200 OK**: The client application has been successfully linked with the partner application. 2. **400 Bad Request**: There was an issue with the request, typically due to: - Missing partner api key `key` in the request query - The provided `key` is not a partner application or it has been suspended - Missing client api key `client_api_key` in the request body - The provided `client_api_key` has already been linked. **Response** ```json { "message_code": 894, "message": "Client key not provided" } ``` ## 2. POST application Create a what3words API key for use in an application. The key can then be used to make requests to the what3words Main API. A key can be created for each end client and can be used as a way to segment usage. When creating a new key the request must specify a name and description to identify the key. **cURL** ```shellscript curl --location --request POST 'https://accountsapi.what3words.com/partner/v1/application?key=PK2D3j230291' \ --header 'Content-Type: application/json' \ --data-raw '{"name": "name of app", "description": "description of app"}' ``` ### Resource URL [https://accountsapi.what3words.com/partner/v1/application](https://accountsapi.what3words.com/partner/v1/application) ### Parameters | Parameters | Required/Optional | Description | Example | | --- | --- | --- | --- | | key | Required | Partner API key | key=PK2D3J230291 | ### Request body | Request Body | Required/Optional | Description | Example | | --- | --- | --- | --- | | name | Required | Name of API key. Could be the account name or an ID. | "name": "My app" | | description | Required | Description of API key. Could be the account name or an ID or type of account | "description": "My test app" | ### Example Request #### POST - [https://accountsapi.what3words.com/partner/v1/application?key=PK2D3J230291](https://accountsapi.what3words.com/partner/v1/application?key=PK2D3j230291) - `{"name": "name of app", "description": "description of app"}` ### Example Result **JSON** ```json { "api_key": "PG122LFC4W98", "name": "name of app", "description": "description of app", "suspended": false } ``` ## 3. GET application Obtain either one or all of the API keys connected to your partner account. Pass in a key to the request to return just a specific key details. The response will return the name and description of the key, along with it’s status (enabled/disabled). **cURL** ```shellscript curl --location --request GET 'https://accountsapi.what3words.com/partner/v1/application?key=PK2D3j230291&page=1&per_page=10' ``` ### Resource URL [https://accountsapi.what3words.com/partner/v1/application](https://accountsapi.what3words.com/partner/v1/application) ### Parameters | Parameters | Required/Optional | Description | Example | | --- | --- | --- | --- | | key | Required | Partner API key | key=PK2D3J230291 | | api\_key | Optional | API key | api\_key=LFC4W98R | ### Example Request #### GET - [https://accountsapi.what3words.com/partner/v1/application?key=PK2D3J230291&page=1&per\_page=10](https://accountsapi.what3words.com/partner/v1/application?key=PK2D3j230291&page=1&per_page=10) ### Example Result **JSON** ```json { "message": "OK", "page": 1, "per_page": 10, "total": 3, "applications": [ { "api_key": "D0O8DQAR", "name": "app1", "description": "desc1", "suspended": false }, { "api_key": "U8KB3NZR", "name": "app2", "description": "desc2", "suspended": false }, { "api_key": "LFC4W98R", "name": "app3", "description": "desc3", "suspended": false } ] } ``` ## 4. PATCH application Enable or disable an API key. Disabling a key prevents the application from being able to make requests to the what3words Main API. **cURL** ```shellscript curl --location --request PATCH 'https://accountsapi.what3words.com/partner/v1/application?key=PK2D3j230291' \ --header 'Content-Type: application/json' \ --data-raw '{"suspended": false, "api_key": "PGLFC4W98R"}' ``` ### Resource URL [https://accountsapi.what3words.com/partner/v1/application](https://accountsapi.what3words.com/partner/v1/application) ### Parameters | Parameters | Required/Optional | Description | Example | | --- | --- | --- | --- | | key | Required | Partner API key | key=PK2D3J230291 | ### Request body | Request Body | Required/Optional | Description | Example | | --- | --- | --- | --- | | api\_key | Required | Key to be changed | "api\_key": "PGLFC4W98R" | | suspended | Required | Suspended - true/false | "suspended": false | ### Example Request #### PATCH - https://accountsapi.what3words.com/partner/v1/application?key=PK2D3J230291 ### Example Result **JSON** ```json { "api_key": "PGLFC4W98R", "name": "name of app", "description": "description of app", "suspended": false } ``` ## 5. POST application/link Link an API key that was created “manually” (outside of the Partner API through accounts.what3words.com) to a Partner account for revenue share agreements. **cURL** ```shellscript curl --location --request POST 'https://accountsapi.what3words.com/partner/v1/application/link?key=PK2D3J230291' \ --header 'Content-Type: application/json' \ --data-raw '{"client_api_key": ""}' ``` ### Resource URL [https://accountsapi.what3words.com/partner/v1/application/link](https://accountsapi.what3words.com/partner/v1/application/link) ### Parameters | Parameters | Required/Optional | Description | Example | | --- | --- | --- | --- | | key | Required | Partner API key | key=PK2D3J230291 | ### Request body | Request Body | Required/Optional | Description | Example | | --- | --- | --- | --- | | client\_api\_key | Required | API key created through accounts.what3words.com | { "client\_api\_key": "" } | ### Example Request #### POST - https://accountsapi.what3words.com/partner/v1/application/link?key= Content-Type: application/json { “client\_api\_key”: “” } --- # PHP Getting started with the what3words PHP API wrapper. Topics: PHP, Server and Scripting, Website Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/php Updated: 2026-11-27 The PHP wrapper is useful for PHP developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their PHP applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words PHP wrapper is available in our [PHP Github repository](https://github.com/what3words/w3w-php-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation Use [Composer](https://getcomposer.org/) to integrate this library into your project, or do it manually. Composer: **PHP** ```php { “require”: { “what3words/w3w-php-wrapper”: "3.*" } } ``` Manually: Add this file to your project: `[Geocoder.php](https://github.com/what3words/w3w-php-wrapper/blob/master/src/Geocoder.php).` ## 3. Setup If you manually dropped in the file then use `require_once("Geocoder.php")` instead of `require_once("vendor/autoload.php")` **PHP** ```php require_once("vendor/autoload.php"); use What3words\Geocoder\Geocoder; use What3words\Geocoder\AutoSuggestOption; ``` ## 4. Initialise Initialise the what3words API client in your PHP script. **PHP** ```php require_once("vendor/autoload.php"); use What3words\Geocoder\Geocoder; use What3words\Geocoder\AutoSuggestOption; $api = new Geocoder(""); ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.484463, -0.195405`): **PHP** ```php $result = $api->convertTo3wa(51.484463, -0.195405); print_r($result); ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **PHP** ```php $result = $api->convertToCoordinates("filled.count.soap"); print_r($result); ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **PHP** ```php $result = $api->autosuggest("fun.with.code"); print_r($result); ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **PHP** ```php $result = $api->autosuggest("fun.with.code", [AutoSuggestOption::clipToCountry("GB","BE")]); print_r($result); ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **PHP** ```php $result = $api->autosuggest("fun.with.code", [AutoSuggestOption::focus(51.4243877,-0.34745)); print_r($result); ``` **Code example** AutoSuggest, with Generic Voice input type. **PHP** ```php $result = $api->autosuggest("fun.with.code", [AutoSuggestOption::fallbackLanguage("EN"), AutoSuggestOption::inputType("generic-voice")]); print_r($result); ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **PHP** ```php $result = $api->gridSection(52.207988,0.116126, 52.208867,0.117540); print_r($result); ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **PHP** ```php $result = $api->availableLanguages(); print_r($result); ``` ### Handling errors Errors returned from the API can be caught with the wrapper through the use of a `catch` function. Within the `catch` function, `code` and `message` values which represent the error, are accessible from the `error` object parameter. **PHP** ```php $result = $api->convertToCoordinates("garbage.input"); if ($result == false) { $error = $api->getError(); print "Error with code " . $error["code"] . ": "; print $error["message"] . ":\n"; exit(); } ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **PHP** ```php isPossible3wa($address); echo "Is '{$address}' a possible what3words address? " . ($isPossible ? "true" : "false") . "\n"; } } main(); ?> ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **PHP** ```php isValid3wa($address); echo "Is '$address' a valid what3words address? " . ($isValid ? 'True' : 'False') . "\n"; } } main(); ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also, make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example Complete Composer convert to 3 word address example: **PHP** ```php "); $options = [ AutoSuggestOption::clipToCountry("FR"), AutoSuggestOption::focus(48.856618, 2.3522411), AutoSuggestOption::numberResults(1) ]; $result = $api->autosuggest("inder.dweii.coo", $options); if ($result) { print "Top 3 word address match: " . $result["suggestions"][0]["words"]; print " in " . $result["suggestions"][0]["nearest-place"] . "\n"; } else print "Error with code " . $error["code"] . ": " . $error["message"] . ":\n"; ?> ``` --- # Python Getting started with the what3words Python API wrapper. Topics: Python, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/python Updated: 2026-11-27 The Python wrapper is useful for Python developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their Python applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words Python wrapper is available in our [Python Github repository](https://github.com/what3words/w3w-python-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The library is available through [PyPi](https://pypi.org/project/what3words/). To install what3words, simply: **Python** ```python pip install what3words ``` ## 3. Setup You need to import the library **Python** ```python import what3words ``` ## 4. Initialise By default, the wrapper will point to the public version of the what3words API. However, if required, the wrapper can be configured to point to a custom endpoint, for example a locally running version of the API. In this case an optional `end_point` parameter can be passed to the `what3words.Geocoder` constructor. **Python** ```python # Using the Public API: geocoder = what3words.Geocoder("what3words-api-key") ``` **Python** ```python # Using the API Server: geocoder = what3words.Geocoder("what3words-api-key", end_point='http://localhost:8080/v3') ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.484463, -0.195405`): **Python** ```python res = geocoder.convert_to_3wa(what3words.Coordinates(51.484463, -0.195405)) print(res) ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///prom.cape.pump`: **Python** ```python res = geocoder.convert_to_coordinates('prom.cape.pump') print(res) ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Python** ```python res = geocoder.autosuggest('filled.count.soap') print(res) ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Python** ```python res = geocoder.autosuggest('filled.count.soap', clip_to_country="GB,BE") print(res) ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Python** ```python res = geocoder.autosuggest('filled.count.soap', \ focus=what3words.Coordinates(51.4243877,-0.34745)) print(res) ``` **Code example** AutoSuggest, with Generic Voice input type. **Python** ```python res = geocoder.autosuggest('fun with code', input_type='generic-voice', language='en') print(res) ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Python** ```python sw = what3words.Coordinates(52.207988,0.116126) ne = what3words.Coordinates(52.208867,0.117540) bb = what3words.BoundingBox(sw, ne) res = geocoder.grid_section(bb) print(res) ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Python** ```python res = geocoder.available_languages() print(res) ``` ### Handling errors Errors returned from the API can be caught with the wrapper through the use of a `catch` function. Within the `catch` function, `code` and `message` values which represent the error, are accessible from the `error` object parameter **Python** ```python autosuggest = geocoder.autosuggest('freshen.overlook.clo', clip_to_country="FR") if 'error' in autosuggest: # An error has been returned from the API code = autosuggest['error']['code'] message = autosuggest['error']['message'] print (code, message) ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `is_possible_3wa` – Match what3words address format; - `is_valid_3wa` – Verify a what3words address with the API; ### is\_possible\_3wa Our API wrapper RegEx function “`is_possible_3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `is_valid_3wa` to verify validity. **Python** ```python import what3words def main(): # Initialize the What3Words API with your API key api_key = 'YOUR_API_KEY' w3w = what3words.Geocoder(api_key) # Example what3words addresses addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] # Check if the addresses are possible what3words addresses for address in addresses: is_possible = w3w.is_possible_3wa(address) print(f"Is '{address}' a possible what3words address? {is_possible}") if __name__ == "__main__": main() ``` #### Expected Output - is\_possible\_3wa(“filled.count.soap”) returns `true` - is\_possible\_3wa(“not a 3wa”) returns `false` - is\_possible\_3wa(“not.3wa address”)returns `false` ### is\_valid\_3wa Our API wrapper RegEx function “`is_valid_3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Python** ```python import what3words def main(): # Initialize the what3words API with your API key api_key = 'YOUR_API_KEY' w3w = what3words.Geocoder(api_key) # Example addresses addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] # Check if the addresses are valid what3words addresses for address in addresses: is_valid = w3w.is_valid_3wa(address) print(f"Is '{address}' a valid what3words address? {is_valid}") if __name__ == "__main__": main() ``` #### Expected Outputs - is\_valid\_3wa(“filled.count.soap”) returns `True` - is\_valid\_3wa(“filled.count.”) returns `False` - is\_valid\_3wa(“coding.is.cool”) returns `False` Also, make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example The example below takes the concepts described above, and turns some of them into a complete example. Here we take a partial 3 word address and pass it into AutoSuggest – clipping the results to consider only addresses in France, setting a focus of Paris, and returning a single result We then take the result and convert the 3 word address to coordinates, and find the nearest place. **Python** ```python import what3words from os import environ geocoder = what3words.Geocoder("what3words-api-key") autosuggest = geocoder.autosuggest('freshen.overlook.clo', \ clip_to_country="FR", \ focus=what3words.Coordinates(48.856618, 2.3522411), \ n_results=1, \ ) if 'error' in autosuggest: # An error has been returned from the API code = autosuggest['error']['code'] message = autosuggest['error']['message'] print (code, message) else: # Obtains the one, and only result from the returned list of suggestions words = autosuggest['suggestions'][0]['words'] print("Top 3 word address match: {}".format(words)) # Use the `convert_to_coordinates` API to convert the returned 3 word address into coordinates convert_to_coordinates = geocoder.convert_to_coordinates(words) print("WGS84 Coordinates: {}, {}".format( \ convert_to_coordinates['coordinates']['lat'], \ convert_to_coordinates['coordinates']['lng'])) print("Nearest Place: {}".format(convert_to_coordinates['nearestPlace'])) ``` --- # Ride-hailing Integration How to add what3words to a Ride-hailing integration. Topics: Android, Java, Swift, Mobile App Section: [Search Box](https://developer.what3words.com/docs/search-box.md) > [Enable Existing Search Box](https://developer.what3words.com/docs/search-box/enable-existing-search-box.md) Source: https://developer.what3words.com/tutorial/ride-hailing Updated: 2026-11-27 ### Step by Step The easiest way to add what3words to your ride-hailing, web booking, and call booking applications is to use one of what3words API wrapper libraries in [**Java**](https://developer.what3words.com/tutorial/android#get-an-api-key) and [**Kotlin**](https://developer.what3words.com/tutorial/android#get-an-api-key) for your Android apps or in [**Swift**](https://developer.what3words.com/tutorial/swift) for your iOS apps. Follow our [UX guidelines](https://developer.what3words.com/tutorial/ux-guidelines) and these easy self-explanatory steps on how to integrate what3words into a ride-hailing app. ## 1. Get API Key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Install API wrapper To utilise our wrappers, you will first need to download the packages, from either [**Maven Central**](https://central.sonatype.com/artifact/com.what3words/w3w-android-wrapper) (or this [**GitHub page**](https://github.com/what3words/w3w-android-wrapper)) or through the [**Swift Package Manager**](https://swift.org/package-manager). For full details on how to install and initialise the what3words wrappers, see the [**Swift**](https://developer.what3words.com/tutorial/swift) and [**Android**](https://developer.what3words.com/tutorial/android) wrapper tutorials. **Note:** For Android integrations, we recommend using exclusively—either the what3words Android wrapper or the what3words Java wrapper. The What3words Android wrapper essentially encompasses the functionality of the Java wrapper, offering additional features such as **voice capabilities** and the ability to manage **API key restrictions**. The code snippets that we have added in this tutorial assume that you will be using the [what3words Android wrapper](https://developer.what3words.com/tutorial/android). ## 3. Add suggestions to the search bar To offer the best user experience, enable users to enter a what3words address into an existing address search bar. The ability to do this is best communicated by placeholder text in the search bar prompting a user to enter a what3words address. ![An example of placeholder text](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/08e2c82e3843e05184b0bcaa897be7fc9f98123d71eb4d1423b41035e76076c4.w1600.webp) what3words address entry encompasses: - copy and paste a what3words address into the search bar (with or without the preceding `///`); - detect when a user is typing in a what3words address and display intelligent suggestions to the user using the what3words API’s AutoSuggest functionality (this will be covered in more detail at a later step) To add this functionality to an existing search bar, your app will first need to detect if a full or partial input string is in the format of a what3words address. This can be achieved using the RegEx function of the API wrapper. what3words Address Detection Example: **Java** ```java import com.what3words.javawrapper.What3WordsV3 String text = "index.home.raft" if(What3WordsV3.isPossible3wa(text)){ System.out.println("Input is in the form of a three word address") } else { System.out.println("Input is NOT in the form of a three word address") } ``` **Kotlin** ```kotlin import com.what3words.javawrapper.What3WordsV3 val text = "index.home.raft" if(What3WordsV3.isPossible3wa(text)){ println("Input is in the form of a three word address") } else { println("Input is NOT in the form of a three word address") } ``` **Swift** ```swift import W3WSwiftApi import CoreLocation let text = "filled.count.s xxx.xxx.xxx index.home.raft" let matches = api.findPossible3wa(text: text) for match in matches { print(" Found:", match) } ``` ## 4. Enable calls to the API for suggestions Once the user has entered the first letter of the final word of a what3words address, your app should call the what3words API to provide intelligent what3words address suggestions to the user, using our API’s AutoSuggest endpoint. These results will be updated as the user continues entering the what3words address. A highly important step in optimising the user experience is in contextualising the address suggestions to where the user is located. This can be done by supplying the API with the user’s device location, enabling the returned suggestions to be tailored to the user’s current location using an API call parameter called `focus`. Similarly, if your service operates in a fixed country, you can use the `clip-to-country` parameter to restrict the returned suggestions to geographically relevant results. AutoSuggest API Call Example: **Java** ```java import com.what3words.javawrapper.request.Coordinates // Create optional options to fine-tune the autosuggest request AutosuggestOptions options = AutosuggestOptions() Coordinates focus = Coordinates(/*latitude:*/51.502,/*longitude:*/-0.12345) options.setFocus(focus) Autosuggest result = wrapper.autosuggest("filled.count.so").options(options).execute() if (result.isSuccessful) { System.out.println(result.suggestions.size) } else { System.out.println(resut.error.message) } ``` **Kotlin** ```kotlin import com.what3words.javawrapper.request.Coordinates // Create optional options to fine-tune the autosuggest request val options = AutosuggestOptions() options.focus = Coordinates(/*latitude:*/51.502,/*longitude:*/-0.12345) val result: Autosuggest= wrapper.autosuggest("filled.count.so").options(options).execute() if (result.isSuccessful) { println(result.suggestions.size) } else { println(result.error.message) } ``` **Swift** ```swift import W3WSwiftApi import CoreLocation let api = What3WordsV3(apiKey: "YourApiKey") let coords = CLLocationCoordinate2D(latitude: 51.4243877, longitude: -0.34745) api.autosuggest(text: "index.raft.ho", options: W3WOptions().focus(coords)) { (suggestions, error) in print(suggestions ?? []) } ``` ## 5. Displaying AutoSuggest results You can configure the number of AutoSuggest results using the n-focus-results parameter. To display the results, we recommend using our what3words address search component with the following key attributes: 1. 3 slashes (“///”) before each what3words address suggestion; 2. A nearest place; 3. Distance from the user to each of the what3words address suggestions (`distanceToFocusKm` for each suggestion in the API response). Location context for eachwhat3words address suggestion (we return this as `nearestPlace` for each suggestion in the API response). ![ride-hailing-suggestions](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ae4f27c4b81bc9968728ed0f93fa3afb71032acc9810c84b7714c07663b69a94.w1600.webp) ## 6. Validate what3words and get coordinates Once the user has selected the desired what3words address from the list of suggestions, it needs to be converted into standard GPS coordinates to then enable route calculation and pricing. To do this, use the `convertToCoordinates` wrapper function. An example of doing this using our mobile wrappers is given below: **Java** ```java String selectedSuggestion = "filled.count.soap" ConvertToCoordinates result = wrapper.convertToCoordinates(selectedSuggestion) if (result.isSuccessful) { System.out.println("Coordinates: ${result.coordinates.lat}, ${result.coordinates.lng}") } else { System.out.println(result.error.message) } ``` **Kotlin** ```kotlin val selectedSuggestion = "filled.count.soap" val result: ConvertToCoordinates = wrapper.convertToCoordinates(selectedSuggestion).execute() if (result.isSuccessful) { println("Coordinates: ${result.coordinates.lat}, ${result.coordinates.lng}") } else { println(result.error.message) } ``` **Swift** ```swift import W3WSwiftApi import CoreLocation let api = What3WordsV3(apiKey: "YourApiKey") api.convertToCoordinates(words: "filled.count.soap") { square, error in print(square?.coordinates ?? "") } ``` ## 7. Displaying the what3words on the map Once the user has selected a what3words address from the AutoSuggest-generated list, the point should be displayed on the route by appending a label with the what3words address on it to the map marker, allowing the user to see the location of the what3words address before confirming the ride. ![Coordinates Used For User Confirmation](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8b99a9e5e7d912371d0dcc085b04a3debc0c282f3e4ae1dec77d1287ebbb052c.w1600.webp) ## 8. Full Example The example below takes the concepts described earlier and demonstrates how a what3words integration could look on your ride-hailing apps. ![ride hailing demo app](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ee408435634e87fdf44f5b3d9ad29622b21108e75da9aea8d411efcc196bb3e4.gif) ### Development Checklist ### API Sign Up & Library Installation - Created an API key for the what3words API; - The packages have been loaded correctly, and the API initialised according to the relevant wrapper guidance. ### Address Search - Placeholder text in the search bar educates the user on the ability to enter what3words addresses; - The keyboard displays the full stop on the first screen shown to the user; - Check if the keyboard supports all enabled languages; - Up until the final word of the what3words address is entered, traditional destination options are returned; - Once the final word begins to be entered, what3words results are shown. ### AutoSuggest ### API Parameters - Focus is enabled; - Other parameters, such as clipping, or language settings, are enabled (if applicable). ### Front End - Results update live with each keystroke; - Three what3words address suggestions are displayed per keystroke; - Nearest place information (either ours or via an alternative source) is displayed alongside distance from the user; - /// is affixed to the address (e.g. ///filled.count.soap vs. filled.count.soap); - If there is use of what3words brand assets, they must be the current versions; - Correct localisation of copy for non-English languages (e.g. distances stated in kilometers or miles). ### Ride Confirmation - Upon selection of a suggested address, the selected option is highlighted to indicate it is chosen; - The selected address is successfully converted to coordinates; - The resulting coordinates are used to display the destination location on the map and sent for route/price calculation; - The map destination marker has the correct what3words address attached via a label. ### Contact Support ### Have any questions****? We’re here to support you! If you have any questions while using what3words for Excel, get in touch with us by writing us an email at [support@what3words.com](mailto:support@what3words.com). --- # Ruby Getting started with the what3words Ruby API wrapper. Topics: Ruby, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/ruby Updated: 2026-11-27 The Ruby wrapper is useful for Ruby developers who wish to seamlessly integrate the [what3words Public API](https://developer.what3words.com/public-api) into their Ruby applications, without the hassle of having to manage the low level API calls themselves. A full example of how to integrate the what3words Ruby wrapper is available in our **[GitHub repository](https://github.com/what3words/w3w-ruby-wrapper).** ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation The library is available through [RubyGems](https://rubygems.org/gems/what3words). You can simply add this line to your application’s Gemfile: **Ruby** ```ruby gem 'what3words', '~> 3.4' ``` And then execute: **Ruby** ```ruby bundle ``` Or install it yourself as: **Ruby** ```ruby gem install what3words ``` ## 3. Setup If not using Bundler, require it: **Ruby** ```ruby require 'what3words' ``` ## 4. Initialise The wrapper will point to the public version of the what3words API, to initialise it simply: **Ruby** ```ruby what3words = What3Words::API.new(:key => "YOURAPIKEY") ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`29.567041, 106.587875`): **Ruby** ```ruby what3words.convert_to_3wa [29.567041, 106.587875] # Expected Output # => {:country=>"CN", :square=>{:southwest=>{:lng=>106.58786, :lat=>29.567028}, :northeast=>{:lng=>106.587891, :lat=>29.567055}}, :nearestPlace=>"Chongqing", :coordinates=>{:lng=>106.587875, :lat=>29.567041}, :words=>"disclose.strain.redefined", :language=>"en", :map=>"https://w3w.co/disclose.strain.redefined"} ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///prom.cape.pump`: **Ruby** ```ruby what3words.convert_to_coordinates "prom.cape.pump" # Expected Output # => {:country=>"GB", :square=>{:southwest=>{:lng=>-0.195426, :lat=>51.484449}, :northeast=>{:lng=>-0.195383, :lat=>51.484476}}, :nearestPlace=>"Kensington, London", :coordinates=>{:lng=>-0.195405, :lat=>51.484463}, :words=>"prom.cape.pump", :language=>"en", :map=>"https://w3w.co/prom.cape.pump"} ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Ruby** ```ruby what3words.autosuggest 'trop.caler.perdre', language: 'fr' # Expected Output # => {:suggestions=>[{:country=>"FR", :nearestPlace=>"Saint-Lary-Soulan, Hautes-Pyrénées", :words=>"trier.caler.perdre", :rank=>1, :language=>"fr"}, {:country=>"ET", :nearestPlace=>"Asbe Teferi, Oromiya", :words=>"trôler.caler.perdre", :rank=>2, :language=>"fr"}, {:country=>"CN", :nearestPlace=>"Ulanhot, Inner Mongolia", :words=>"froc.caler.perdre", :rank=>3, :language=>"fr"}]} ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Ruby** ```ruby what3words.autosuggest 'disclose.strain.redefin', 'clip-to-country': 'GB,BE' # Expected Output # => {:suggestions=>[{:country=>"GB", :nearestPlace=>"Nether Stowey, Somerset", :words=>"disclose.retrain.redefined", :rank=>1, :language=>"en"}, {:country=>"BE", :nearestPlace=>"Zemst, Flanders", :words=>"disclose.strain.reckon", :rank=>2, :language=>"en"}, {:country=>"GB", :nearestPlace=>"Waddington, Lincolnshire", :words=>"discloses.trains.redefined", :rank=>3, :language=>"en"}]} ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Ruby** ```ruby what3words.autosuggest 'filled.count.soap', focus: [51.4243877,-0.34745] # Expected Output # => {:suggestions=>[{:country=>"GB", :nearestPlace=>"Bayswater, London", :words=>"filled.count.soap", :rank=>1, :distanceToFocusKm=>15, :language=>"en"}, {:country=>"GB", :nearestPlace=>"Orsett, Essex", :words=>"fills.count.slap", :rank=>2, :distanceToFocusKm=>48, :language=>"en"}, {:country=>"GB", :nearestPlace=>"Cobham, Surrey", :words=>"field.count.slap", :rank=>3, :distanceToFocusKm=>14, :language=>"en"}]} ``` **Code example** AutoSuggest, with Generic Voice input type. **Ruby** ```ruby what3words.autosuggest 'fun with code', 'input-type': 'generic-voice', language: 'en' # Expected Output # => {:suggestions=>[{:country=>"US", :nearestPlace=>"Homer, Alaska", :words=>"fund.with.code", :rank=>1, :language=>"en"}, {:country=>"AU", :nearestPlace=>"Kumpupintil, Western Australia", :words=>"funk.with.code", :rank=>2, :language=>"en"}, {:country=>"US", :nearestPlace=>"Charleston, West Virginia", :words=>"fund.with.cove", :rank=>3, :language=>"en"}]} ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Ruby** ```ruby what3words.grid_section '52.208867,0.117540,52.207988,0.116126' # Expected Output # => {:lines=>[{:start=>{:lng=>0.116126, :lat=>52.20801}, :end=>{:lng=>0.11754, :lat=>52.20801}}, {:start=>{:lng=>0.116126, :lat=>52.208037}, :end=>{:lng=>0.11754, :lat=>52.208037}}, {:start=>{:lng=>0.116126, :lat=>52.208064}, :end=>{:lng=>0.11754, :lat=>52.208064}}, ___...___ ]} ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Ruby** ```ruby what3words.available_languages # Expected Output # => {:languages=>[{:nativeName=>"Deutsch", :code=>"de", :name=>"German"}, {:nativeName=>"हिन्दी", :code=>"hi", :name=>"Hindi"}, {:nativeName=>"Português", :code=>"pt", :name=>"Portuguese"}, {:nativeName=>"Magyar", :code=>"hu", :name=>"Hungarian"}, {:nativeName=>"Українська", :code=>"uk", :name=>"Ukrainian"}, {:nativeName=>"Bahasa Indonesia", :code=>"id", :name=>"Bahasa Indonesia"}, {:nativeName=>"اردو", :code=>"ur", :name=>"Urdu"}, ___...___]} ``` ### Handling errors Errors returned from the API can be caught with the wrapper through the use of a `raise` function. Within the `raise` function, `code` and `message` values which represent the error, are accessible from the `error` object parameter **Ruby** ```ruby if response['error'].to_s.strip != '' raise ResponseError, "#{response['code']}: #{response['message']}" end ``` ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Ruby** ```ruby require 'what3words' def main # Initialize the What3Words API with your API key api_key = 'YOUR_API_KEY' w3w = What3Words::API.new(:key => api_key) # Example what3words addresses addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] # Check if the addresses are possible what3words addresses addresses.each do |address| is_possible = w3w.isPossible3wa(address) puts "Is '#{address}' a possible what3words address? #{is_possible}" end end if __FILE__ == $0 main end ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Ruby** ```ruby require 'what3words' def main # Initialize the what3words API with your API key api_key = 'YOUR_API_KEY' w3w = What3Words::API.new(:key => api_key) # Example addresses addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] # Check if the addresses are valid what3words addresses addresses.each do |address| is_valid = w3w.isValid3wa(address) puts "Is '#{address}' a valid what3words address? #{is_valid}" end end if __FILE__ == $0 main end ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example The example below takes the concepts described above, and turns some of them into a complete example. Here we take a partial 3 word address and pass it into AutoSuggest – clipping the results to consider only addresses in Great Britain and Belgium, setting a focus, and returning a single result We then take the result and convert the 3 word address to coordinates, and vice-versa. **Ruby** ```ruby # frozen_string_literal: true #!/usr/bin/env require 'what3words' require 'json' api_key = ENV['W3W_API_KEY'] what3words = What3Words::API.new(:key => api_key, :format => 'json') # ## convert_to_coordinates ######### res = what3words.convert_to_coordinates 'prom.cape.pump' puts '######### convert_to_coordinate #########' puts res # ## convert_to_3wa ######### res = what3words.convert_to_3wa [29.567041, 106.587875] puts '######### convert_to_3wa #########' puts res # ## grid_section ######### res = what3words.grid_section '52.208867,0.117540,52.207988,0.116126' puts '######### grid_section #########' puts res # ## available_languages ######### res = what3words.available_languages puts '######### available_languages #########' puts res # ## Vanilla autosuggest, limiting the number of results to three ######### res = what3words.autosuggest 'disclose.strain.redefin', language: 'en', 'n-results': 10 puts '######### autosuggest n-results #########' puts res # ## autosuggest demonstrating clipping to polygon, circle, bounding box, and country ######### res_polygon = what3words.autosuggest 'disclose.strain.redefin', 'clip-to-polygon': [51.521, -0.343, 52.6, 2.3324, 54.234, 8.343, 51.521, -0.343] res_circle = what3words.autosuggest 'disclose.strain.redefin', 'clip-to-circle': [51.521, -0.343, 142] res_bbox = what3words.autosuggest 'disclose.strain.redefin', 'clip-to-bounding-box': [51.521, -0.343, 52.6, 2.3324] res_country = what3words.autosuggest 'disclose.strain.redefin', 'clip-to-country': 'GB,BE' puts '######### autosuggest clipping options #########' puts res_polygon puts res_circle puts res_bbox puts res_country # ## autosuggest with a focus, with that focus only applied to the first result ######### res = what3words.autosuggest 'filled.count.soap', focus: [51.4243877, -0.34745], 'n-focus-results': 3, 'n-results': 10 puts '######### autosuggest with a focus ######### ' puts res # ## autosuggest with an input type of Generic Voice ######### res = what3words.autosuggest 'fun with code', 'input-type': 'generic-voice', language: 'en' puts '######### autosuggest with Generic Voice as input type ######### ' puts res # ## isPossible3wa ######### addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] addresses.each do |address| is_possible = what3words.isPossible3wa(address) puts "Is '#{address}' a possible what3words address? #{is_possible}" end # ## isValid3wa ######### addresses = ["filled.count.soap", "filled.count.", "coding.is.cool"] addresses.each do |address| is_valid = what3words.isValid3wa(address) puts "Is '#{address}' a valid what3words address? #{is_valid}" end ``` --- # Rust Getting started with the what3words Rust API wrapper. Topics: Rust, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/rust Updated: 2026-11-27 The Rust wrapper is useful for Rust developers who wish to seamlessly integrate the [what3words Public API](https://docs.what3words.com/api/v3/) into their Rust applications, without the hassle of managing the low-level API calls themselves. A full example of how to integrate the what3words Rust wrapper is available in our [Rust Github repository](https://github.com/what3words/w3w-rust-wrapper) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation To install what3words, simply: **Rust** ```rust $ cargo add what3words-api ``` ## 3. Setup The functions are asynchronous by default, but this crate supports synchronous functions as well, simply enable `sync` feature when adding the crate to your project. **Rust** ```rust cargo add what3words-api --features=sync ``` > [!NOTE] > **Note:** Ensure that you have an async runtime installed such as `tokio` except when `sync` feature is enabled. ## 4. Initialise Once you have the API Key, you can initialise the wrapper like this: **Rust** ```rust let wrapper = what3words_api::What3words::new("YOUR_API_KEY_HERE"); ``` You can also pass a different hostname if you have your own self-hosted what3words API. **Rust** ```rust let wrapper = what3words_api::What3words::new("YOUR_API_KEY_HERE").hostname("https://your.what3words.api/v3"); ``` You can also set configure your own headers: **Rust** ```rust let wrapper = what3words_api::What3words::new("YOUR_API_KEY_HERE").header("X-Foo", "Bar"); ``` ## 5. Usage ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.520847, -0.195405`): **Rust** ```rust let convert_to_3wa = what3words_api::ConvertTo3wa::new(51.520847, -0.195521).language("oo").locale("oo_cy"); ``` Here is an example: **Rust** ```rust use what3words_api::{Address, AddressGeoJson, ConvertTo3wa, What3words}; let w3w = What3words::new("YOUR_API_KEY_HERE"); let convert_to_3wa = ConvertTo3wa::new(51.520847, -0.195521).language("mn").locale("mn_la"); let address_json: Address = w3w.convert_to_3wa::
(&convert_to_3wa); println!("{:?}", address_json.words); // "seruuhen.zemseg.dagaldah" let convert_to_3wa = ConvertTo3wa::new(51.520847, -0.195521); let address_geojson: Address = w3w.convert_to_3wa::
(&convert_to_3wa); println!("{:?}", address_geojson.features); // [Feature { bbox: Some[-0.195543, 51.520833], ..., }] ``` > [!NOTE] > **Note:** It is required to specify the type annotation for this function which will allow you to choose between `json` and `geojson` format. Using `Address` will use `json` (default) and `AddressGeoJson` will use `geojson`. ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///filled.count.soap`: **Rust** ```rust let convert_to_coordinates = what3words_api::ConvertToCoordinates::new("filled.count.soap").locale("zh_tr"); ``` Here is an example: **Rust** ```rust use what3words_api::{Address, AddressGeoJson, ConvertToCoordinates, What3words}; let w3w = What3words::new("YOUR_API_KEY_HERE"); let convert_to_coordinates = ConvertToCoordinates::new("產權.絕緣.墨鏡").locale("zh_tr"); let address_json: Address = w3w.convert_to_coordinates::
(&convert_to_coordinates); println!("{:?}", address_json.coordinates); // Coordinates { lat: 51.520847, lng: -0.195521 } let convert_to_coordinates = ConvertToCoordinates::new("filled.count.soap"); let address_geojson: AddressGeoJson = w3w.convert_to_coordinates::(&convert_to_coordinates); println!("{:?}", address_geojson.features); // [Feature { bbox: Some[-0.195543, 51.520833], ..., }] ``` > [!NOTE] > **Note:** It is required to specify the type annotation for this function which will allow you to choose between `json` and `geojson` format. Using `Address` will use `json` (default) and `AddressGeoJson` will use `geojson`. ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** Simple basic call: **Rust** ```rust let autosuggest = what3words_api::Autosuggest::new("filled.count.so"); ``` **Code example** AutoSuggest, clipping the results returned to the United Kingdom and Belgium: **Rust** ```rust let autosuggest = what3words_api::Autosuggest::new("filled.count.so").clip_to_country(&["GB","BE"]) ``` **Code example** AutoSuggest, Focus on (`51.4243877,-0.34745`). **Rust** ```rust let autosuggest = what3words_api::Autosuggest::new("filled.count.so").focus(&Coordinates::new(51.4243877, -0.34745)); ``` **Code example** AutoSuggest, with Generic Voice input type. **Rust** ```rust use std::env; use what3words_api::{Autosuggest, What3words}; fn main() { let api_key = env::var("W3W_API_KEY").expect( "Please ensure that W3W_API_KEY is added to your environment variables.\nRun `W3W_API_KEY= cargo run --example wrapper-demo` from bash/zsh or `$Env:W3W_API_KEY=; cargo run --example wrapper-demo` from PowerShell.", ); let w3w = What3words::new(&api_key); let autosuggest_option = Autosuggest::new("filled.count.soa") .input_type("generic-voice") .language("en"); let result = w3w.autosuggest(&autosuggest_option); print!("Result: {:?}", result); } ``` Here is a full AutoSuggest example: **Rust** ```rust use what3words_api::{Autosuggest, AutosuggestResult, What3words}; let w3w = What3words::new("YOUR_API_KEY_HERE"); let autosuggest_option = Autosuggest::new("filled.count.so").focus(&Coordinates::new(51.520847, -0.195521)); let autosuggest: AutosuggestResult = w3w.autosuggest(&autosuggest_option); println!("{:?}", autosuggest.suggestions); // [Suggestion { words: "filled.count.soap", ..., ... }, ..., ...] ``` ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Rust** ```rust use what3words_api::{BoundingBox, GridSection, GridSectionGeoJson, What3words}; let w3w: What3words = What3words::new("YOUR_API_KEY_HERE"); // json format let grid_section_json: GridSection = w3w.grid_section::(&BoundingBox::new(52.207988,0.116126,52.208867,0.117540)); println!("{:?}", &grid_section_json.lines[0]); // Line { start: Coordinates { lat: 52.20801, lng: 0.116126 }, end: Coordinates { lat: 52.20801, lng: 0.11754 } } // geojson format let grid_section_geojson: GridSectionGeoJson = w3w.grid_section::(&BoundingBox::new(52.207988,0.116126,52.208867,0.117540)); println!("{:?}", &grid_section_geojson.features); // [Features { geometry: ..., }, ..., ..., kind: "Feature"] ``` > [!NOTE] > **Note:** It is required to specify the type annotation for this function which will allow you to choose between `json` and `geojson` format. Using `GridSection` will use `json` (default) and `GridSectionGeoJson` will use `geojson`. ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Rust** ```rust use what3words_api::{AvailableLanguages, What3words}; let w3w: What3words = What3words::new("YOUR_API_KEY_HERE"); let available_languages: AvailableLanguages = w3w.available_languages(); println!("{:?}", available_languages.languages); // [Language { code: "en", ..., ... }, ..., ... ] ``` ### Handling errors In Rust, error handling is managed using the Result and Option types, which encapsulate potential success (Ok or Some) and failure (Err or None) outcomes. The `what3words-api` Rust crate adheres to this convention, returning a Result type for operations that may fail. To handle errors effectively using this crate, you can utilize pattern matching to differentiate between successful and erroneous outcomes. Here’s an example demonstrating how to handle errors when converting a what3words address to coordinates: **Rust** ```rust use what3words_api::What3words; fn main() { // Initialize the what3words API with your API key let api_key = "YOUR_API_KEY_HERE"; let w3w = What3words::new(api_key); // Example 3-word address let address = "filled.count.soap"; // Attempt to convert the 3-word address to coordinates match w3w.convert_to_coordinates(address) { Ok(coordinates) => { println!("Coordinates for '{}': {:?}", address, coordinates); } Err(e) => { eprintln!("Error converting '{}': {}", address, e); } } } ``` **Explanation:** **Initialisation:** The what3words struct is initialised with your API key. Ensure you replace “YOUR\_API\_KEY\_HERE” with your actual what3words API key. **Conversion Attempt:** The convert\_to\_coordinates method is called with the what3words address. This method returns a Result, which can be either: - Ok(coordinates): Contains the coordinates if the conversion is successful. - Err(e): Contains the error if the conversion fails. **Error Handling:** The match statement is used to handle both success and error cases: - On success, the coordinates are printed. - On error, the error’s code and message are accessed and printed to the standard error output. This approach ensures that your application can handle potential errors gracefully, such as network issues, invalid API keys, or incorrect what3words addresses. For more detailed information on error handling in Rust, you can refer to the official Rust documentation on [Error Handling](https://doc.rust-lang.org/book/ch09-00-error-handling.html). ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `is_possible_3wa` – Match what3words address format; - `is_valid_3wa` – Verify a what3words address with the API; ### is\_possible\_3wa Our API wrapper RegEx function “`is_possible_3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `is_valid_3wa` to verify validity. **Rust** ```rust use what3words_api::What3words; fn main() { // Initialize the what3words API with your API key let api_key = "YOUR_API_KEY_HERE"; let w3w = What3words::new(api_key); // Example what3words addresses let addresses = [ "filled.count.soap", "not a 3wa", "not.3wa address", ]; // Check if the addresses are possible what3words addresses for address in &addresses { let is_possible = w3w.is_possible_3wa(address); println!("Is '{}' a possible what3words address? {}", address, is_possible); } } ``` #### Expected Output - `is_possible_3wa`(“filled.count.soap”) returns `true` - `is_possible_3wa`(“not a 3wa”) returns `false` - `is_possible_3wa`(“not.3wa address”) returns `false` ### is\_valid\_3wa Our API wrapper RegEx function “`is_valid_3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Rust** ```rust use what3words_api::What3words; fn main() { // Initialize the what3words API with your API key let api_key = "YOUR_API_KEY_HERE"; let w3w = What3words::new(api_key); // Example addresses let addresses = vec![ "filled.count.soap", "filled.count.", "coding.is.cool", ]; // Check if each address is a valid what3words address for address in addresses { let is_valid = w3w.is_valid_3wa(address); println!("Is '{}' a valid what3words address? {}", address, is_valid); } } ``` #### Expected Outputs - `is_valid_3wa`(“filled.count.soap”) returns `True` - `is_valid_3wa`(“filled.count.”) returns `False` - `is_valid_3wa`(“coding.is.cool”) returns `False` Also, make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example Examples can be found in `/examples` directory of our , simply run the following to try it out: [Rust Github repository](https://github.com/what3words/w3w-rust-wrapper) **Rust (sync)** ```rust # Blocking $ W3W_API_KEY= cargo run --example sync --features="sync" ``` **Rust (async)** ```rust # Non-blocking $ W3W_API_KEY= cargo run --example async --features="async" ``` **Rust (sync)** ```rust use std::env; use what3words_api::{ Address, AddressGeoJson, Autosuggest, AutosuggestSelection, BoundingBox, ConvertTo3wa, ConvertToCoordinates, Coordinates, Error, GridSection, GridSectionGeoJson, What3words, }; fn main() -> Result<(), Error> { let api_key = env::var("W3W_API_KEY").expect( "Please ensure that W3W_API_KEY is added to your environment variables.\nRun `W3W_API_KEY= cargo run --example wrapper-demo` from bash/zsh or `$Env:W3W_API_KEY=; cargo run --example wrapper-demo` from PowerShell.", ); let w3w = What3words::new(&api_key).header("X-Foo", "Bar"); let words = "filled.count.soap"; // ------ CONVERT TO COORDINATES/3WA ------ // ------ Error ------ let address = w3w.convert_to_coordinates::
(&ConvertToCoordinates::new("filled.count")); match address { Ok(address) => println!("Address {:?}", address), Err(error) => println!("Error {:?}", error), } // ------------------- let convert_to_coordinates = ConvertToCoordinates::new(words); let address: Address = w3w.convert_to_coordinates(&convert_to_coordinates)?; println!("Convert to Coordinates Json Format"); println!("{:?}", address); let convert_to_coordinates = ConvertToCoordinates::new(words); let address: AddressGeoJson = w3w.convert_to_coordinates(&convert_to_coordinates)?; println!("Convert to Coordinates GeoJson Format"); println!("{:?}", address); let convert_to_3wa = ConvertTo3wa::new(51.520847, -0.195521); let address: Address = w3w.convert_to_3wa(&convert_to_3wa)?; println!("Convert to 3WA Json Format"); println!("{:?}", address); let convert_to_3wa = ConvertTo3wa::new(51.520847, -0.195521); let address: AddressGeoJson = w3w.convert_to_3wa(&convert_to_3wa)?; println!("Convert to 3WA GeoJson Format"); println!("{:?}", address); // ------ ALL AVAILABLE LANGUAGES ------ let languages = w3w.available_languages()?; println!("Available Languages"); println!("{:?}", languages.languages); // ------ GRID SECTION ------ let grid_section_json: GridSection = w3w.grid_section(&BoundingBox::new(52.207988, 0.116126, 52.208867, 0.117540))?; println!("Grid Section Json Format"); println!("{:?}", grid_section_json); let grid_section_geojson: GridSectionGeoJson = w3w.grid_section(&BoundingBox::new(52.207988, 0.116126, 52.208867, 0.117540))?; println!("Grid Section GeoJson Format"); println!("{:?}", grid_section_geojson); // ------ AUTOSUGGEST ------ let autosuggest_option = Autosuggest::new("filled.count.so").focus(&Coordinates::new(51.520847, -0.195521)); let autosuggest = w3w.autosuggest(&autosuggest_option)?; println!("Autosuggest"); println!("{:?} ", autosuggest); // ------ AUTOSUGGEST WITH COORDINATES ------ let autosuggest_with_coordinates = w3w.autosuggest_with_coordinates(&autosuggest_option); println!("Autosuggest with Coordinates"); match autosuggest_with_coordinates { Ok(autosuggest_with_coordinates) => println!("{:?}", autosuggest_with_coordinates), Err(err) => println!("{:?}", err), } // ------ AUTOSUGGEST SELECTION ------ let selected = autosuggest.suggestions.first().expect("Not found"); match w3w.autosuggest_selection( &AutosuggestSelection::new("f.f.f", selected).options(&autosuggest_option), ) { Ok(_) => println!("Suggested selection sent"), Err(err) => println!("{:?}", err), }; // ------ HELPER FUNCTIONS ------ let is_valid_3wa: bool = w3w.is_valid_3wa("filled.count.soap"); println!("is_valid_3wa [1]: {}", is_valid_3wa); let is_valid_3wa: bool = w3w.is_valid_3wa("filled.count"); println!("is_valid_3wa [2]: {}", is_valid_3wa); let is_valid_3wa: bool = w3w.is_valid_3wa("rust.is.cool"); println!("is_valid_3wa [3]: {}", is_valid_3wa); let did_you_mean: bool = w3w.did_you_mean("filled count soap"); println!("did_you_mean [1]: {}", did_you_mean); let did_you_mean: bool = w3w.did_you_mean("filled-count-soap"); println!("did_you_mean [2]: {}", did_you_mean); let did_you_mean: bool = w3w.did_you_mean("filledcountsoap"); println!("did_you_mean [3]: {}", did_you_mean); let is_possible_3wa: bool = w3w.is_possible_3wa("filled.count.soap"); println!("is_possible_3wa [1]: {}", is_possible_3wa); let is_possible_3wa: bool = w3w.is_possible_3wa("not a 3wa"); println!("is_possible_3wa [2]: {}", is_possible_3wa); let is_possible_3wa: bool = w3w.is_possible_3wa("not.a 3wa"); println!("is_possible_3wa [3]: {}", is_possible_3wa); Ok(()) } ``` --- # Search for 3 word addresses in ArcGIS Online Search for a 3 word address within ArcGIS Online and publish in a web application. Topics: ArcGIS, GIS Section: [GIS & Spreadsheet Tools](https://developer.what3words.com/docs/gis-spreadsheet-tools.md) > [ArcGIS](https://developer.what3words.com/docs/gis-spreadsheet-tools/arcgis.md) Source: https://developer.what3words.com/tutorial/search-for-3-word-addresses-in-arcgis-online Updated: 2026-11-27 This tutorial will take you through how to search for a 3 word address within ArcGIS Online and to publish in a web application. ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the what3words Locator to ArcGIS Online Follow this [**tutorial**](https://developer.what3words.com/tutorial/how-to-setup-the-what3words-locator-for-arcgis-online) or watch this video to set up the what3words ArcGIS Locator within ArcGIS Online and add it as a Utility Service. Getting started with Dazi, GIS Technical Account Manager at what3words, showing how to add the what3words ArcGIS Locator in ArcGIS Online in [this video](https://youtu.be/iYp4g9sWNhU) ## 3. Select the locator ![ArcGIS Online - w3w locator](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/af141c9e307ceade01915faedce3412a89614cebebdda17aa0398757847150ed.png) On the ArcGIS Online Map Viewer, click on the search icon on the right-hand sidebar, and the search box should appear at the top right of the map. The what3words address search should appear in the search box within the ArcGIS Online Map. Selecting “All” will allow a user to search for a 3 word address or a traditional address within the ArcGIS World Geocoding Service. Selecting “what3words” searches only for 3 word addresses. ## 4. Search on ArcGIS Online Map Viewer Classic ![ArcGIS Online - w3w locator autosuggest](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0bb7186468f32a95e12b1ed848fa337534a3fbb79399d5580124db1c6536271e.png) On the ArcGIS Map Viewer, search for a 3 word address and hit enter. The user will be shown suggestions using what3words AutoSuggest. ## 5. Publishing in a Web App ![ArcGIS search screen using a what 3 words address](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b99e55a88ade03e1eb978b063ee2096fb26a527ee58e19337cd8b19e8bd35f20.png) The Locator can be used within published web applications and configured to meet users needs. An example of the search in action within a web application can be found here. --- # Swift Getting started with the what3words Swift API wrapper. Topics: Swift, Mobile App, Server and Scripting Section: [API & SDK Reference](https://developer.what3words.com/docs/api-sdk-reference.md) > [API Wrappers](https://developer.what3words.com/docs/api-sdk-reference/api-wrappers.md) Source: https://developer.what3words.com/tutorial/swift Updated: 2026-11-27 This what3words Swift wrapper gives you programmatic access to the what3Words public API v3. The what3words API is a fast, simple interface which allows you to convert 3 word addresses such as ///filled.count.soap to latitude and longitude coordinates such as (`-0.203586, 51.521251`) and vice versa. It features a powerful AutoSuggest function, which can validate and autocorrect user input and limit it to certain geographic areas (this powers the search box on our map site). It allows you to request a section of the what3words grid (which can be requested as GeoJSON for easy display on online maps), and to request the list of all languages supported by what3words. For advanced users, AutoSuggest can be used to post-process voice output. See links on the left to navigate. All coordinates are latitude,longitude pairs in standard WGS-84 (as commonly used worldwide in GPS systems). All latitudes must be in the range of -90 to 90 (inclusive). Full sample apps for the wrapper can be found in our Github repo [iOS Sample Apps](https://github.com/what3words/w3w-swift-samples) ## 1. Get API key You will need this API key for your installation. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ### Swift Package Manager You can install this with [Swift Package Manager](https://swift.org/package-manager) by adding the URL below under **Swift Packages** under your project settings: **Swift** ```swift Swift Package Manager ``` ### CocoaPods (iOS 9+, OS X 10.10+) You can use CocoaPods to install w3w-swift-wrapper by adding it to the target in your Podfile: **Swift** ```swift pod 'what3words', :git => 'https://github.com/what3words/w3w-swift-wrapper.git' ``` ![plist screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9eb285ebcc897dba07e39f4b70aebe44cbbaa298312c88868e05dcee5ae8eea8.png) Don’t forget, if you are running on a device you need to set the `App Transport Security Settings` in your `Info.plist` as you would any app communicating with a server ![plist2 screenshot](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/0fa33cfc4f0d912366638c07872d09300b2fb9b00af3e5d4ac790004440b7a96.png) Also, if you are using the Voice API on device, you should include Microphone permissions ## 3. Setup In any swift file you use the what3words API, import the following: **Swift** ```swift import W3WSwiftApi import CoreLocation ``` ## 4. Initialise Use the following code with your API key to initialize the API: **Swift** ```swift # Using the Public API: let api = What3WordsV4(apiKey: "YourApiKey") ``` **Swift** ```swift # Using the API Server: let api = What3WordsV4(apiKey: "YourApiKey", apiUrl: "https://api.yourserver.com") ``` Additionally, if you run the Enterprise Suite API Server there is another optional `setup()` parameter: `customHeaders`. Use this if you need to send custom headers to your own server: **Swift** ```swift let api = What3WordsV4(apiKey: "YourApiKey", apiUrl: "https://api.yourserver.com", customHeaders: ["x-header-1":"value-1", "x-header-2":"value-2"]) ``` ## 5. Usage Each call takes a completion block as the last parameter. This allows Swift’s trailing closure syntax to be used. The closure’s parameters contain the results. If there is a problem with any call, it will be indicated by the [error object](https://github.com/what3words/w3w-swift-wrapper/tree/v4#errors). ### Convert to what3words address This function converts coordinates (expressed as latitude and longitude) to a what3words address. More information about `ConvertTo3wa`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-3wa). Find the words for (`51.484463, -0.195405`): **Swift** ```swift let coords = CLLocationCoordinate2D(latitude: 51.484463, longitude: -0.195405) api.convertTo3wa(coordinates: coords, language: W3WApiLanguage(locale: "en")) { square, error in print(square?.words ?? "") } ``` ### Convert to coordinates This function converts a what3words address to a position, expressed as coordinates of latitude and longitude. It takes the words parameter as a string of a what3words `'table.book.chair'` More information about `ConvertToCoordinates`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#convert-to-coordinates). Find the words for `///prom.cape.pump`: **Swift** ```swift api.convertToCoordinates(words: "prom.cape.pump") { square, error in print(square?.coordinates ?? "") } ``` ### AutoSuggest When presented with a what3words address which may be incorrectly entered, AutoSuggest returns a list of potential correct 3 word addresses. It needs the first two words plus at least the first character of the third word to produce suggestions. This method provides corrections for mis-typed words (including plural VS singular), and words being in the wrong order. Optionally, clipping can narrow down the possibilities, and limit results to: - One or more countries - A geographic area (a circle, box or polygon) This dramatically improves results, so we recommend that you use clipping if possible. To improve results even further, set the `Focus` to user’s current location. This will make `AutoSuggest` return results which are closer to the user. More information about `AutoSuggest`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#autosuggest). **Code example** for an AutoSuggest basic call, the first parameter is the partial three words, or voice data. The second optional parameter is the options for the autosuggest function. The last parameter is the completion block. **Swift** ```swift api.autosuggest(text: "filled.count.soa") { (suggestions, error) in for suggestion in suggestions ?? [] { print("\(suggestion.words ?? "") is near \(suggestion.nearestPlace ?? "")") } } ``` **Code example** an AutoSuggest Focus on one particular place: **Swift** ```swift let coords = CLLocationCoordinate2D(latitude: 51.4243877, longitude: -0.34745) api.autosuggest(text: "flottons.annulons.garço", options: W3WOption.focus(coords)) { (suggestions, error) in print(suggestions ?? "") } ``` **Code example** AutoSuggest, Focus on (51.4243877,-0.34745) and ask for suggestions from a French three word fragment: **Swift** ```swift let coords = CLLocationCoordinate2D(latitude: 51.4243877, longitude: -0.34745) let options = W3WOptions().focus(coords).clip(to: W3WApiCountry(code: "GB")) api.autosuggest(text: "flottons.annulons.garço", options: options) { (suggestions, error) in print(suggestions ?? "") } ``` **Code example** AutoSuggest, Voice API example. The what3words Voice API allows a user to say three words into any application or service, with it returning a configurable list of what3words address suggestions, all through a single API call. For this to work, you must add a Voice API plan to [your account](https://accounts.what3words.com/billing). This example instantiates a `W3WMicrophone` which provides an audio stream to `autosuggest(audio:)` which begins recording when `autosuggest` is called. For information on `W3WMicrophone` and customizing your own `W3WAudioStream` for `autosuggest(audio:)` see the [Voice API readme file](https://github.com/what3words/w3w-swift-wrapper/blob/v4/Documentation/README.voiceAPI.md). **Swift** ```swift // make a microphone let microphone = W3WMicrophone() // call autosuggest api.autosuggest(audio: microphone, options: .voiceLanguage(W3WApiLanguage(locale: "en"))) { suggestions, error in for suggestion in suggestions ?? [] { print(suggestion.words ?? "no suggestions") } } ``` Also, `W3WMicrophone` has a callback closure `W3WMicrophone.volumeUpdate: (Double) -> ()` that provides amplitude information useful for animating user feedback. See the [Voice API example](https://github.com/what3words/w3w-swift-wrapper/blob/v4/Examples/VoiceAPI/VoiceAPI.xcodeproj), and more information is available in the [Voice API readme file](https://github.com/what3words/w3w-swift-wrapper/blob/v4/Documentation/README.voiceAPI.md). ### Grid section Grid section returns a section of the what3words 3m x 3m grid as a set of horizontal and vertical lines covering the requested area, which can then be drawn onto a map. The requested box must not exceed 4km from corner to corner, or a `BadBoundingBoxTooBig` error will be returned. More information about `GridSection`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#grid-section). Get a grid for `52.207988,0.116126`) in the south west, and `52.208867,0.117540` in the north east: **Swift** ```swift let southWest = CLLocationCoordinate2D(latitude: 52.208867, longitude: 0.117540) let northEast = CLLocationCoordinate2D(latitude: 52.207988, longitude: 0.116126) api.gridSection(southWest: southWest, northEast: northEast) { (lines, error) in print("Line count: ", lines?.count ?? "zero") } ``` ### Available languages This function returns the currently supported languages. It will return the two letter code, and the name of the language both in that language and in English. More information about `AvailableLanguages`, including returned results is available in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages). **Swift** ```swift api.availableLanguages() { (languages, error) in for language in languages ?? [] { print(language.code) } } ``` ### Handling errors All functions call the completion block with `error` as the second parameter. All Swift what3words `error` types are of `enum` type and conform to [CustomStringConvertible](https://developer.apple.com/documentation/swift/customstringconvertible), so they can be used with `String(describing: error)`: **Swift** ```swift api.convertTo3wa(coordinates: CLLocationCoordinate2D(latitude: 51.4243877, longitude: -0.34745)) { square, error in if let e = error { print(String(describing: e)) } else { print(square?.words ?? "") } } ``` Api call errors are of type `W3WError` enum and the voice `autosuggest` call returns a `W3WVoiceError` enum. ## 6. RegEx Functions This section introduces RegEx functions that can assist with checking and finding possible what3words addresses in strings. The three main functions covered are: - `isPossible3wa` – Match what3words address format; - `isValid3wa` – Verify a what3words address with the API; ### isPossible3wa Our API wrapper RegEx function “`isPossible3wa`” can be used to detect if a text string (like “`filled.count.soap`“) in the format of a what3words address without having to ask the API. This functionality checks if a given string could be a what3words address. It returns **true** if it could be, otherwise **false**. **Note**: This function checks the text format but not the validity of a what3words address. Use `isValid3wa` to verify validity. **Swift** ```swift import W3WSwiftApi import CoreLocation func main() { // Initialize the What3Words API with your API key let api = What3WordsV4(apiKey: "YOUR_API_KEY") // Example what3words addresses let addresses = ["filled.count.soap", "not a 3wa", "not.3wa address"] // Check if the addresses are possible what3words addresses for address in addresses { let isPossible = api.isPossible3wa(text: address) print("Is '\(address)' a possible what3words address? \(isPossible)") } } main() ``` #### Expected Output - isPossible3wa(“filled.count.soap”) returns `true` - isPossible3wa(“not a 3wa”) returns `false` - isPossible3wa(“not.3wa address”)returns `false` ### isValid3wa Our API wrapper RegEx function “`isValid3wa`” can be used to determine if a string is a valid what3words address by checking it against the what3words RegEx filter and verifying it with the what3words API. **Swift** ```swift import W3WSwiftApi import CoreLocation func main() { // Initialize the what3words API with your API key let apiKey = "YOUR_API_KEY" let api = What3WordsV4(apiKey: apiKey) // Example addresses let addresses = [ "filled.count.soap", "filled.count.", "coding.is.cool" ] // Check if the addresses are valid what3words addresses for address in addresses { api.isValid3wa(words: address) { result in if result == true { print("'\(address)' is a valid what3words address") } else { print("'\(address)' is NOT a valid what3words address") } } } } main() ``` #### Expected Outputs - isValid3wa(“filled.count.soap”) returns `True` - isValid3wa(“filled.count.”) returns `False` - isValid3wa(“coding.is.cool”) returns `False` Also make sure to replace `` with your actual API key. These functionalities provide different levels of validation for what3words addresses, from simply identifying potential addresses to verifying their existence on Earth. ## 7. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ## 8. Full example A complete example using AutoSuggest to find a place and `convertToCoordinates` to get its coordinates: **Swift** ```swift W3wGeocoder.setup(with: "") let france = ClipToCountry(country: "FR") let place = Focus(focus: CLLocationCoordinate2D(latitude: 48.856618, longitude: 2.3522411)) let count = NumberResults(numberOfResults: 4) // Find some suggestions for a partial address W3wGeocoder.shared.autosuggest(input: "freshen.overlook.clo", options: france, place, count) { (suggestions, error) in // if there was an error, print it if let e = error { print(e.code, e.message) // on success print the results } else { for suggestion in suggestions ?? [] { print("\(suggestion.words) is near \(suggestion.nearestPlace) - Country Code:\(suggestion.country)") } } // Find coordinates for the first suggestion if let suggestion = suggestions?.first { print("\nFinding the coordinates for: \(suggestion.words)") W3wGeocoder.shared.convertToCoordinates(words: suggestion.words) { (place, error) in // if there was an error, print it if let e = error { print(e.code, e.message) // on success print the result } else if let p = place { print("The coordinates for \(p.words) are (\(p.coordinates.latitude),\(p.coordinates.longitude))") } } } } ``` --- # Swiftcomplete Address Autocomplete API Suggest addresses as users type a street, postcode or full address, then retrieve the structured address they select. Topics: SwiftComplete, Server and Scripting Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-api Updated: 2026-11-30 > [!TIP] > For support getting set up, contact us via the [Swiftcomplete webpage](https://what3words.com/swiftcomplete). ## 1. Overview Send the user's search text to Swiftcomplete and display the suggestions it returns. If the user picks an individual address, retrieve its full details. If they pick a container, such as a postcode or street, open it and let them choose an address from the results. A populated result includes address lines and a display label. It can also include structured address components and coordinates. ## 2. Base endpoint **Endpoint** ```http https://api.swiftcomplete.com/v1/swiftlookup/ ``` Use HTTPS `GET` requests with the parameters in the query string. ## 3. Request parameters | Query parameter | Description | | --- | --- | | `key` | Your Swiftcomplete API key. | | `text` | The search text entered by the user. | | `biasTowards` | Optional coordinates in `lat,lon` format. Favours results near that location. | | `populateIndex` | The selected item's zero-based index in the response array. Requests the full address for that item. | | `countries` | Comma-separated country codes that limit where the API searches. | | `container` | The value returned with a container suggestion. Send it to fetch the addresses it contains. | | `maxResults` | The maximum number of child results to return in a container request, up to 100. | | `pageFrom` | The offset at which to start the next page of child results. | ## 4. Standard autocomplete flow ### Search on every keystroke As the user types, send the current contents of the address field in `text`. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERT_KEY_HERE&text=what3 ``` The example response below shows the first two suggestions. **Response** ```json [ { "primary": { "text": "What3words, Alfred Rd", "highlights": [0, 4] }, "secondary": { "text": "London", "highlights": [] }, "type": "address.business", "isContainer": false, "countryCode": "GB" }, { "primary": { "text": "Sew What, 34 Caledonian Rd", "highlights": [4, 7, 10, 10] }, "secondary": { "text": "Wishaw", "highlights": [] }, "type": "address.business", "isContainer": false, "countryCode": "GB" } ] ``` ### Display the suggestion list | Response field | How to use it | | --- | --- | | `primary.text` | Display as the main text for the suggestion. | | `secondary.text` | Display as supporting text. | | `primary.highlights`, `secondary.highlights` | Highlight the matching character ranges in each display string. | | `type` | Identify the kind of result. | | `isContainer` | Decide whether to open a container or populate the selected result directly. | | `countryCode` | Identify the country associated with the suggestion. | ### Populate a selected result When the user chooses a suggestion with `isContainer` set to `false`, repeat the exact request that returned it and add `populateIndex` with its position in the array. The first result has index `0`. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERT_KEY_HERE&text=what3&populateIndex=0 ``` **Response** ```json [ { "primary": { "text": "What3words, Alfred Rd", "highlights": [0, 4] }, "secondary": { "text": "London", "highlights": [] }, "isContainer": false, "geometry": { "centre": { "lat": 51.521198, "lon": -0.196334 } }, "populatedRecord": { "lines": [ "What3words Ltd", "65 Alfred Road", "LONDON", "W2 5EU", "United Kingdom" ], "label": "What3words Ltd\n65 Alfred Road\nLONDON\nW2 5EU\nUnited Kingdom" } } ] ``` ### Use the populated record - Use `populatedRecord.lines` for the individual address lines. - Use `populatedRecord.label` for a display label with line breaks. - Read structured address components from `populatedRecord.data` when present. - Read latitude and longitude from `geometry.centre.lat` and `geometry.centre.lon` when available. ## 5. Container flow If a suggestion has `isContainer` set to `true`, open it first. Apply `populateIndex` to the request that returned the chosen child address. ### Search for a container In this example, a postcode search returns one suggestion with a `container` value. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERT_KEY_HERE&text=ng97bs ``` **Response** ```json [ { "primary": { "text": "NG9 7BS", "highlights": [0, 2, 4, 6] }, "secondary": { "text": "Brookhill St", "highlights": [] }, "type": "place.area.postcode", "isContainer": true, "container": "V1;NG9 7BS;52.923435;-1.279735", "countryCode": "GB" } ] ``` ### Open the container Start a new request using the returned `container` value. This example uses `maxResults=100` and encodes the space in the postcode as `%20`. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERT_KEY_HERE&container=V1;NG9%207BS;52.923435;-1.279735&maxResults=100 ``` The example response below shows the first two child results. **Response** ```json [ { "primary": { "text": "2 Brookhill St" }, "secondary": { "text": "Stapleford, NG9 7BS" }, "isContainer": false }, { "primary": { "text": "2a Brookhill St" }, "secondary": { "text": "Stapleford, NG9 7BS" }, "isContainer": false } ] ``` ### Let the user choose a child result Display the child addresses as a second list of suggestions. ### Populate the selected child result Repeat the container request that returned the chosen address. Keep its existing parameters, including `pageFrom` if the result came from a later page, and add `populateIndex` with the child's index in that response. ## 6. Container pagination If the response contains exactly `maxResults` items, another page may be available. Use `pageFrom` to fetch it. For example, to fetch the next page after the first 10 results, set `pageFrom=10`. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERT_KEY_HERE&container=V1;NG9%207BS;52.923435;-1.279735&maxResults=10&pageFrom=10 ``` Advance `pageFrom` by the page size after each full page. Stop when the response contains fewer items than `maxResults`. ## 7. Recommended UI flow ### Typing Call `swiftlookup` with the current `text` after each keystroke and display the results as suggestions. ### Selecting a non-container result Repeat the search request with the selected index in `populateIndex`. Use the returned `populatedRecord` to fill the address fields. ### Selecting a container result Open the container and show its child addresses. When the user picks one, repeat the request for that list or page with the chosen index in `populateIndex`. ## 8. Important implementation rules - Send the current search text after each keystroke. - For a population request, keep the original query parameters and add only `populateIndex`. - Open a container before populating any of its child addresses. - Use `pageFrom` for container pagination and stop after a response with fewer than `maxResults` items. ## 9. Integration logic **Pseudocode** ``` suggestions = lookup(key, text) When the user selects a suggestion: If isContainer is false: Repeat the search request with populateIndex set to the selected index Use populatedRecord If isContainer is true: Request the child results with key, container and maxResults If a page is full, fetch the next page with pageFrom as needed When the user selects a child, repeat the request for its page with populateIndex set to the child's index on that page Use populatedRecord ``` ## 10. Response fields to store | Field | Value | | --- | --- | | `populatedRecord.label` | Address formatted as a multiline label. | | `populatedRecord.lines` | Individual address lines in an array. | | `populatedRecord.data` | Structured address components, when present. | | `geometry.centre.lat` | Latitude, when available. | | `geometry.centre.lon` | Longitude, when available. | | `countryCode` | Country code. | ## 11. Summary Search with `text` as the user types. To retrieve a direct address, repeat the search with `populateIndex`. For a container, fetch its child results, page through them with `pageFrom` if needed, and use `populateIndex` on the request that returned the chosen child. ### Find out more [Explore the Swiftcomplete website](https://what3words.com/swiftcomplete) Can’t find what you’re looking for, or want to report an issue? [Get in touch here](https://share.hsforms.com/1gonG2sDNQhWIqB3BhKVK7A1p3ix). --- # Swiftcomplete BigCommerce Integration: Add Address Autocomplete to Checkout Add Address Autocomplete to Checkout using Swiftcomplete BigCommerce Integration. Topics: BigCommerce, SwiftComplete, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Plugins](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/plugins.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-bigcommerce Updated: 2026-11-27 The [Swiftcomplete](https://what3words.com/swiftcomplete/) Plugin for BigCommerce adds address lookup fields to the billing and shipping fields in your checkout to capture accurate addresses and improve conversion rates. ## 1. Get a Swiftcomplete API key Create a Swiftcomplete account (or sign in) if you’re already registered. [GET API KEY](https://www.swiftcomplete.com/account/register) ## 2. Add Swiftcomplete to your checkout page ### Step 1 – Find Script Manager To integrate the Swiftcomplete script, log in to BigCommerce and go to `Script Manager`. You can access this by clicking on the `Storefront > Script Manager` link in your sidebar. ![swiftcomplete-bigcommerce-find-script-manager](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7e8b990c1496c11016578d75901a406cdaf9caac1bc8d4cb995291f644facc3a.w1600.webp) ### Step 2 – Create a Script Once in this section you want to click on `Create a Script` : ![swiftcomplete-bigcommerce-create-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/930707620e13b4a1533a8d3da056915756d864d7647c0e0e1b67c4227f2f3dc8.w1600.webp) ### Step 3 – Fill out the Script form Fill out the checkboxes as follows: In `Placement` choose `header` In `Location` choose `Checkout` In `Script category` choose `Essential` In `Script type` choose `Script` ![swiftcomplete-bigcommerce-fill-out-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/56d453e0aec46aa796167cdd081bfbb46a2e02d6db0234b0466c76f556842e9d.w1600.webp) ### Step 4 – Paste the code snippet into the Script Contents In the `Script Contents` Paste this code snippet: **JavaScript** ```javascript ``` ### Step 5 – Add a what3words field to the checkout page To add a what3words address as a custom field to the checkout page, you can select **`Settings > Advanced > Account sign up form > Address Fields > Create a New Field > Text Field`** Make sure that in **`Field Name`**, you write `what3words Address` or `what3words` Then this field too will be populated by the Swiftcomplete if you search for a what3words address. ![swiftcomplete-bigcommerce-plus-what3words](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4d77ded149e56645c2bfb76b35a4992d1a996377b426ed1b3de02091fbb55f32.w1600.webp) ## 3. Swiftcomplete is now active on your checkout page Once this has been done, go to your BigCommerce checkout. Swiftcomplete should now appear in the billing and shipping address sections. Try searching for an address, what3words or postcode. Click the address, and it should be filled into your form correctly. ![swiftcomplete-bigcommerce-at-checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b2481a8183b7d539c8802bccb7fd08bf7cc675603633dad0c90d31c879634df4.w1600.webp) ## 4. Customisation and extra features ### Country setting Set the country by changing the script by comma-separated ISO codes, e.g. gb,de `control.setCountries('gb,de');` ![Swiftcomplete Bigcommerce Country](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/fd8b4d9eafb741a8b47ce1de1b7c73f6b3666d9491a76f3699670f4c15070c98.w1600.webp) ### Troubleshooting **Need help, or have any questions?** Get in touch with our customer support team at [support@swiftcomplete.com](mailto:support@swiftcomplete.com), and we’ll help you get started with the Swiftcomplete Script Integration. --- # Swiftcomplete Ecwid Integration: Add Address Autocomplete to Checkout Add Address Autocomplete to Checkout using Swiftcomplete Ecwid Integration. Topics: Ecwid, SwiftComplete, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Plugins](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/plugins.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-ecwid Updated: 2026-11-27 The [Swiftcomplete](https://what3words.com/swiftcomplete/) Plugin for Ecwid adds address lookup fields to the billing and shipping fields in your checkout to capture accurate addresses and improve conversion rates. ## 1. Get a Swiftcomplete API key Create a Swiftcomplete account (or sign in) if you’re already registered. [GET API KEY](https://www.swiftcomplete.com/account/register) ## 2. Add Swiftcomplete to your checkout page ### Step 1 – Add script to the Ecwid store 1. **Log in** to your Ecwid admin. 2. Go to **Website → Overview → Advanced website settings → Add custom code**. 3. In the **“Custom JavaScript code”** box 4. Paste the entire script below. *Save*. ![swifcomplete-ecwid-add-script](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b5abda454337644098992a8ea22f4058918bdeed11971662f2470081bdd6f668.w1600.webp) Here is the script that you need to use: **JavaScript** ```javascript ``` > **Tip:** Replace the API key with your own; everything else can stay as‑is. ### Step 2 – Add a what3words custom checkout field 1. Go to **Settings → Cart & Checkout → Checkout Fields**. 2. Click **Add Field → Text**. 3. Configure: - **Field name:** what3words - **Label (shown to shopper):** what3words - **Checkout step:** *Shipping & Payment Details* (or whichever step you want). - **Show on invoices & e‑mails:** enable both toggles. Ecwid will create the input inside the checkout form; the script locates it automatically and fills it when the customer selects an address. ![swifcomplete-ecwid-create-field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/29a6eeff5f280652f2bafee017ce3699e875fb50409b31b0fd56599cd17c19b0.w1600.webp) ## 3. Swiftcomplete is now active on your checkout page 1. Open your storefront checkout in a private window. 2. In **Street address**, start typing “SW1A 1AA” or ///filled.count.soap. 3. Select a suggestion – Ecwid should auto‑fill: - address lines - city, postcode, country - **what3words field** (exact what3words address) ![swifcomplete-ecwid-at-checkout](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3cb7a1556d84eab3b57ef9c6df2c98dcba6d5d8e10d00a6e23eded22c64e4fb7.w1600.webp) Displayed what3words in the orders, if it is searched in the Swiftcomplete: ![swifcomplete-ecwid-at-orders](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/653a08308c1892794a1e6b744a08acc7cf0c89aa6f7ef039f983138db068ee2d.w1600.webp) ## 4. Troubleshooting **Need help, or have any questions?** Get in touch with our customer support team at [support@swiftcomplete.com](mailto:support@swiftcomplete.com), and we’ll help you get started with the Swiftcomplete Script Integration. --- # MCP Address Validation: Integrate Swiftcomplete with Your AI Agent Learn how to connect your AI agent to Swiftcomplete’s MCP API using OpenAPI, enabling real-time address validation with just an API key and a single endpoint. Topics: .NET, Android, Dart, Flutter, Go, Java, JavaScript, NodeJS, PHP, Python, Ruby, Rust, Swift, SwiftComplete, Server and Scripting Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-mcp Updated: 2026-11-27 [Swiftcomplete](https://what3words.com/swiftcomplete/)’s **Model Context Protocol (MCP) server** lets any LLM-powered agent call one endpoint and return a verified, fully-formatted address in milliseconds. This tutorial shows you how to plug it in with just an API key and a couple of lines of code. #### See it in action Watch **Jen** from the what3words team demonstrate how an AI customer service agent uses the Swiftcomplete MCP to instantly validate an address. [Watch this walkthrough on YouTube](https://www.youtube.com/watch?v=FlhekJFJuBI) ## 1. Get a Swiftcomplete API key Create a Swiftcomplete account (or sign in) if you’re already registered. [GET API KEY](https://www.swiftcomplete.com/account/register) ## 2. Access the MCP server The Swiftcomplete MCP base URL is: https://mcp.swiftcomplete.com/sse You can import it into Postman, Swagger UI, or your favourite client for auto-generated docs and test calls. ## 3. Add MCP server to your AI agent You can use the OpenAPI spec directly to integrate the Swiftcomplete MCP endpoint into any AI agent framework that supports OpenAPI tool definitions. **Example request and response** - **********Initialisation (Agent connects to our MCP)********** **Request** `{"jsonrpc": "2.0","id": 1,"method": "server/initialize","params": {}}` **Response** `{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","serverInfo":{"name":"Swiftcomplete MCP Server","version":"0.1.0"},"capabilities":{"tools":{"listChanged":false}}}}` - ******Tools/List (Agent finds out what our MCP can do)****** ****Request**** `{"jsonrpc": "2.0","id": 2,"method": "tools/list","params": {}}` **Response** ```json { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "validate_address_lines", "title": "Validate Address Lines", "description": "Validates and standardises an address provided as structured fields: addressLine1, locality, postalCode, country. Use this when the address is split into fields. If you only have a single free-form string, use validate_full_address instead.", "inputSchema": { "type": "object", "properties": { "key": { "type": "string", "description": "Swiftcomplete API key." }, "company": { "type": "string", "description": "Optional company name (e.g. 'Tesco Ltd')." }, "addressLine1": { "type": "string", "description": "Building and street (e.g. '10 Downing Street')." }, "addressLine2": { "type": "string", "description": "Optional flat/suite/apartment (e.g. 'Flat 2')." }, "city": { "type": "string", "description": "All locality information (e.g. suburb, town, city, district), separated by commas. (e.g. 'Westminster, London')." }, "postalCode": { "type": "string", "description": "Postal/ZIP code (e.g. 'SW1A 1AA')." }, "administrativeArea": { "type": "string", "description": "Optional state/province/county (e.g. 'Nottinghamshire')." }, "country": { "type": "string", "description": "ISO 3166-1 alpha-2 country code (e.g. 'GB')." } }, "required": ["key", "addressLine1", "country"] }, "outputSchema": { "type": "object", "description": "Validation result for a postal address.", "properties": { "nextStep": { "type": "string", "description": "Recommended handling step for the result.", "enum": ["AUTO_ACCEPT", "AUTO_ACCEPT_WITH_CHANGES", "MANUAL_REVIEW", "REJECT"] }, "type": { "type": "string", "description": "Result classification (e.g., 'MATCH' for a valid match, 'NONE' when no match was found)." }, "address": { "type": ["string", "null"], "description": "Standardised, formatted address, split into address lines by newline characters (\\n). Null when not available." }, "latitude": { "type": "number", "description": "Latitude in decimal degrees." }, "longitude": { "type": "number", "description": "Longitude in decimal degrees." }, "coordinateGranularity": { "type": "string", "description": "Coordinate granularity (e.g. 'postcode', 'building')." } }, "required": ["nextStep"] } }, { "name": "validate_full_address", "title": "Validate Full Address", "description": "Validates and standardises a full free-form address string. Use this if you only have a single string (e.g. '10 Downing Street London SW1A'). If your address is already split into structured components, use validate_address_lines instead for more accurate results.", "inputSchema": { "type": "object", "properties": { "key": { "type": "string", "description": "Swiftcomplete API key." }, "address": { "type": "string", "description": "Full address to validate (e.g. '10 Downing Street London SW1A')." }, "country": { "type": "string", "description": "ISO 3166-1 alpha-2 country code (e.g. 'GB')." } }, "required": ["key", "address", "country"] }, "outputSchema": { "type": "object", "description": "Validation result for a postal address.", "properties": { "nextStep": { "type": "string", "description": "Recommended handling step for the result.", "enum": ["AUTO_ACCEPT", "AUTO_ACCEPT_WITH_CHANGES", "MANUAL_REVIEW", "REJECT"] }, "type": { "type": "string", "description": "Result classification (e.g., 'MATCH' for a valid match, 'NONE' when no match was found)." }, "address": { "type": ["string", "null"], "description": "Standardised, formatted address, split into address lines by newline characters (\\n). Null when not available." }, "latitude": { "type": "number", "description": "Latitude in decimal degrees." }, "longitude": { "type": "number", "description": "Longitude in decimal degrees." }, "coordinateGranularity": { "type": "string", "description": "Coordinate granularity (e.g., 'postcode', 'building')." } }, "required": ["nextStep"] } } ] } } ``` - **Tools/Call (Agent picks one of our available tools, and calls it)** **Recommended approach** **Request** (address already split into individual fields) `{"jsonrpc": "2.0","id": 3,"method": "tools/call","params": {"name": "validate_address_lines","arguments": {"key": "Swiftcomplete API key","addressLine1": "10 downing st","city": "london","postalCode": "sw1a","country": "GB"}}}` **Response** ```json { "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "{\"nextStep\":\"AUTO_ACCEPT_WITH_CHANGES\",\"type\":\"MATCH\",\"address\":\"10 Downing Street\\nLONDON\\nSW1A 2AA\\nUnited Kingdom\",\"latitude\":51.491318,\"longitude\":-0.14165,\"coordinateGranularity\":\"postcode\"}" } ], "structuredContent": { "nextStep": "AUTO_ACCEPT_WITH_CHANGES", "type": "MATCH", "address": "10 Downing Street\nLONDON\nSW1A 2AA\nUnited Kingdom", "latitude": 51.491318, "longitude": -0.14165, "coordinateGranularity": "postcode" } } } ``` **Request** (full address on one line) `{"jsonrpc": "2.0","id": 3,"method": "tools/call","params": {"name": "validate_full_address","arguments": {"key": "Swiftcomplete API key","address": "what3words alfred road london","country": "GB"}}}` **Response** ```json { "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "{\"nextStep\":\"AUTO_ACCEPT_WITH_CHANGES\",\"type\":\"MATCH\",\"address\":\"What3words Ltd\\n65 Alfred Road\\nLONDON\\nW2 5EU\\nUnited Kingdom\",\"latitude\":51.521198,\"longitude\":-0.196334,\"coordinateGranularity\":\"postcode\"}" } ], "structuredContent": { "nextStep": "AUTO_ACCEPT_WITH_CHANGES", "type": "MATCH", "address": "What3words Ltd\n65 Alfred Road\nLONDON\nW2 5EU\nUnited Kingdom", "latitude": 51.521198, "longitude": -0.196334, "coordinateGranularity": "postcode" } } } ``` **Response:** Validated address: Great Western Studios 65 Alfred Road LONDON W2 5EU United Kingdom > **Note:** Make sure you replace “`YOUR-SWIFTCOMPLETE-API-KEY`” with your Swiftcomplete API key #### How your AI agent might benefit from Swiftcomplete: - **Customer service assistants:** Ensuring address info in chats is accurate before updating CRMs - **Travel planners:** Validating pick-up/drop-off points for smoother journeys - **e-Commerce agents:** Confirming customer shipping info at checkout in real-time - **Voice-based assistants:** Transcribing and resolving spoken address input into verified location data - **CRM assistants:** Sales and support teams can rely on AI agents to maintain clean, validated address data across customer records - **Personal shopping assistants:** validating delivery addresses to prevent fulfilment issues ![mcp-integration](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/568dff88f41d4fe81a45811fdffc257d9ab761c280c6ee57bc8b4869cce971a1.w1600.webp) > **Note:** To find out more our the benefits of our MCP server, you can [read our blog](https://what3words.com/news/blog/make-sure-your-ai-agent-can-validate-addresses-with-swiftcompletes-mcp-server) and to learn about Swiftcomplete, [visit our webpage](https://what3words.com/swiftcomplete). ## 4. Troubleshooting **Need help, or have any questions?** If your AI agents handle addresses, don’t leave accuracy to chance. Swiftcomplete’s MCP server makes it effortless to deliver reliable, instant validation, all with a single, powerful integration. If you need any help getting started or to learn more about Swiftcomplete and our MCP, reach out to our customer support team at [support@swiftcomplete.com](mailto:support@swiftcomplete.com). --- # Swiftcomplete Shopify Plus Integration: Add Address Autocomplete to Checkout Swiftcomplete for Shopify Plus adds real-time address lookup to your checkout, improving accuracy, conversion rates, and delivery success. Topics: Shopify, SwiftComplete, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Plugins](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/plugins.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-shopify Updated: 2026-11-27 [Swiftcomplete](http://what3words.com/swiftcomplete) for Shopify Plus adds real-time address lookup to your checkout, improving accuracy, conversion rates, and delivery success. Shopify Plus merchants (as well as Basic/Grow/Advanced merchants) can also [enable address validation at Post purchase page](https://developer.what3words.com/tutorial/swiftcomplete-address-validation-shopify#add-swiftcomplete-to-your-shopify-store), helping customers confirm or correct their shipping address after purchase. ## What you need - A Shopify Plus store. - Access to the Shopify admin and checkout editor. ## 1. Add Swiftcomplete to your Shopify Plus Store Install the Swiftcomplete app on your Shopify Plus store by clicking the button below [INSTALL](https://apps.shopify.com/swiftcomplete) ## 2. Add Swiftcomplete autocomplete to your checkout page ### Step 1 – Complete the onboarding flow - Go to **Admin > Apps > Swiftcomplete** - Click **Enable** button in **Checkout** section to navigate to **Checkout Editor** page ![Swiftcomplete - Shopify Plus onboarding flow](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d4e83030cfaacf1a333053dd3bf08232f69294ff8269bfd2a76287aeb8d569ed.w1600.webp) ### Step 2 – Add App Block - Under **Main,** select **Add App Block** - Choose **Swiftcomplete** - Click **Save** ![Adding Swiftcomplete autocomplete to Checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/8f1cef593614a8f7e718ff43045befe591c49adf0b6857fa090375b9977befd0.w1600.webp) ### Step 3 – Disable Address Autocompletion - Go to the **Settings** page of your **Checkout Editor** page, - Scroll down to the **Address Autocompletion** section, - Confirm that **Address autocompletion** is **disabled**. This prevents conflicts from Shopify’s standard address validation. ![Disable address autocomplete in Checkout editor](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/7721f83d9aa3d9946d63137d8bb236ca397409cff904f8ea848cc8519df8e4d3.w1600.webp) ### Step 4 – Enable the Company field (Recommended) - Go to the **Settings** page of your store, - Click on the **Checkout** tab on the sidebar, - Scroll down to the **Customer information** and enable the optional field for **Company name**. This prevents business names provided by shoppers from being lost ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/07ec0266de1c885dc25e98b57c7e066bbf1af8b5569567ffb0401d66132e6f79.w1600.webp) ### Step 5 – Test It Out - Go to checkout and enter an address, postcode, or what3words (e.g. ///zones.mixer.scales) - Select a suggestion from the dropdown, and the address fields will auto-fill ![Swiftcomplete address autocomplete in Checkout page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/d66ec25e7f1cef446ba8a5892549bdf99d3a8c59245d4edd5fb02315083458f6.w1600.webp) - If a what3words address is entered as the input for autocomplete, it will be saved against an order within the **Order notes** section of the order page as a dedicated line: `what3words: ///zones.mixer.scales` This can then be printed on order summaries or exported with orders to pass on to delivery companies. ![what3words address in Order notes](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/be9af4d1243ee17a332b29f74847e30da724762f935a484d3eec4d7bf5d49b7a.w1600.webp) ### Troubleshooting If you are stuck with the installation of our plugin or are using a custom theme, you can give our support team collaborator access to your Shopify admin directly through your own Partner Dashboard or using the Shopify app. These collaborator permissions give our support team access to only the sections of your store that you want us to see. Only the store owner or staff with **Manage collaborator requests** permission can view collaborator access requests or grant collaborator access to a store. Otherwise, contact our [support team](mailto:support@swiftcomplete.com), and they will be able to submit a request to access your store, and you will receive an email about the request and a notification on your Shopify Home. Please make sure you mentioned your store website. Alternatively, if you have a collaborator request code enabled, then you need to provide the collaborator request code to our [support team](mailto:support@swiftcomplete.com). --- # Swiftcomplete WooCommerce Integration: Add Address Autocomplete to Checkout Adding and configuring the Swiftcomplete WooCommerce. Topics: SwiftComplete, Wix, WooCommerce, WordPress, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Autocomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete.md) > [Plugins](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-autocomplete/plugins.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-woocommerce Updated: 2026-11-30 The [Swiftcomplete](https://what3words.com/news/blog/how-to-reduce-checkout-churn-speed-up-address-entry-by-up-to-90-with-swiftcomplete/) Plugin for WooCommerce adds address lookup fields to your checkout’s billing and shipping fields to capture accurate addresses and improve conversion rates. ## 1. WordPress Installation (recommended) You can install Swiftcomplete plugin through the WordPress plugins page in your WordPress admin panel. 1. Navigate to the *Plugins > Add New* page 2. Search for “Swiftcomplete” 3. Click the *Install Now* button. 4. Once installed, you can activate the plugin on the *Plugins* page. ## 2. Manual Installation Don’t unzip the plugin – you’ll need this in the next step. [Download Plugin](https://www.swiftcomplete.com/woocommerce/download/) ## 3. Add the plugin to your WordPress Dashboard **Step 1:** Go to your **WordPress Dashboard**, click **Plugins** and then **Add New.** ![swiftcomplete-woocommerce-add-plugin](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/246bed367fbc14249dd1d5e815ca23e4e8ed74777a8d85dab045afd82ad7d31b.w1600.webp) > **NOTE:** To install the plugin, you’ll need access to your WordPress Dashboard. If you don’t have access, send this guide to your developer, who will be able to install the plugin on your behalf. **Step 2:** Click **Upload Plugin**, then **Choose File.** **Step 3:** Select the Swiftcomplete ZIP file and click **Install Now**. ![swiftcomplete-woocommerce-upload-plugins](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/397fcc327eeeff2cb8d9822a1df48555905e4671d1d8dbadce0adfeb06c3f7af.w1600.webp) **Step 4:** Once the plugin has been installed, click **Activate Plugin**. ![swiftcomplete-woocommerce-upload-plugins2](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/17c17864a051f6983792e4b2c717a80944ed98a0dd57a54dfa8717114105a170.w1600.webp) ## 4. Swiftcomplete is now active on your checkout page Go to your WooCommerce checkout. Swiftcomplete should now appear in the billing and shipping address sections. Try searching for a postcode or address. Click the address, and it should be filled into your form correctly. ### Troubleshooting **Need help, or have any questions?** Get in touch with our customer support team at [support@swiftcomplete.com](mailto:support@swiftcomplete.com), and we’ll help you get started with the Swiftcomplete plugin. --- # Swiftcomplete Shopify Integration: Address Validation Topics: SwiftComplete, E-Commerce Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Validation](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-validation.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-address-validation-shopify Updated: 2026-11-27 Help customers confirm or correct their shipping address after purchase with [Swiftcomplete](https://what3words.com/swiftcomplete) for Shopify, available on all Shopify plans. On the Thank you page, customers can confirm a validated address or choose from suggested matches. Their confirmed selection automatically updates the order’s shipping address, with no action needed from the merchant. Shopify Plus merchants can also [enable address autocomplete at checkout](https://developer.what3words.com/tutorial/swiftcomplete-address-autocomplete-shopify#add-swiftcomplete-to-your-shopify-plus-store), helping customers find a validated address using an address, postcode or what3words address. ## What you need - A Shopify Basic store or higher. - Access to the Shopify admin and checkout editor. ## 1. Add Swiftcomplete to your Shopify Store Install the Swiftcomplete app on your Shopify store by clicking the button below [INSTALL](https://apps.shopify.com/swiftcomplete) ## 2. Add Address Validation to the post-purchase page ### Step 2 – Complete the onboarding flow - Go to **Admin > Apps > Swiftcomplete** - Click **Enable** button in **Post Purchase** section to navigate to **Post Purchase Editor** page ![](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/9d32e8f8d82a15f2ed54d15de9db798a665068ba4cf5524a65393423986b44eb.w1600.webp) ### Step 3 – Add App Block - Under **Main,** select **Add App Block** - Choose **Swiftcomplete** - Click **Save** ![Add Address validation app block to Post purchase page](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1dc0a9753d973f9888a59a409595965c20d8b648b064d246a4094e837afcf615.w1600.webp) ### Step 4 – Test It Out - Place a test order using a delivery address. - Open the Thank you/post-purchase page shown after the order is placed. - Test both a valid address and one that needs correcting to check that confirmation and suggested matches appear as expected. ![Address validation suggested a better match](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/4ba5bb6d6d09d2d10da6fdc653d77237c571f3706738d532f872465d9fa48367.w1600.webp) - Also confirm if the optional ‘what3words address’ field is correctly displayed to allow customers to enter a what3words address for additional precision ![what3words address field in address validation](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/937c749905665d6752ed7fbc4a7dea83c6eddd358250a8ec0908dfbd8c0ace24.w1600.webp) - Confirm that any accepted correction is reflected in the order’s delivery details before fulfillment. ## 3. Troubleshooting If you are stuck with the installation of our plugin or are using a custom theme, you can give our support team collaborator access to your Shopify admin directly through your own Partner Dashboard or using the Shopify app. These collaborator permissions give our support team access to only the sections of your store that you want us to see. Only the store owner or staff with **Manage collaborator requests** permission can view collaborator access requests or grant collaborator access to a store. Otherwise, contact our [support team](mailto:support@swiftcomplete.com), and they will be able to submit a request to access your store, and you will receive an email about the request and a notification on your Shopify Home. Please make sure you mentioned your store website. Alternatively, if you have a collaborator request code enabled, then you need to provide the collaborator request code to our [support team](mailto:support@swiftcomplete.com). --- # AI Voice Address Capture: Resolve Spoken Addresses with Swiftcomplete Resolve spoken UK addresses into validated postal addresses using Swiftcomplete’s voice address API over a WebSocket. Topics: SwiftComplete Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Voice](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/voice.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-ai-voice-address-capture Updated: 2026-11-24 ## 1. Overview Use Swiftcomplete’s streaming address API to resolve a spoken postal address during a live call. It’s designed for voice agents, contact centres and IVR systems. Stream audio for one spoken address over a WebSocket. You receive interim transcripts as the caller speaks. When the caller finishes, send `commit_utterance` to get the final result. If the API identifies an address, the `response` field contains the validated postal address in single-line and multiline formats. The API returns postcode-level coordinates by default, or property-level coordinates if you request them and they’re available. If the API can’t identify the address confidently, it returns a result with `type` set to `not_resolved`. If you already have a recording, use the [recorded address API](https://developer.what3words.com/tutorial/swiftcomplete-ai-voice-capture-recorded-addresses). Both APIs use the same format for the final result. #### See it in action Try the voice demo at [demo.what3words.com](https://demo.what3words.com/). ## 2. How it works 1. Your server opens a WebSocket for one address and sends `start_utterance`. 2. You stream the caller’s audio as it arrives. Transcripts of what we hear come back while the caller speaks. 3. When the caller has finished, you send `commit_utterance`. 4. You receive exactly one result, and the connection closes. Each connection handles one address. To capture another address, or to try again, open a new connection. ## 3. Authentication All requests require an API key passed in the `x-api-key` header. [Get an API key here](https://www.swiftcomplete.com/account/register/) Keep your key on your server. Browsers can’t add custom headers to a WebSocket connection, so always connect from your backend, never from a web page or mobile app. If you capture the caller’s audio in a browser or app, relay it through your server. ## 4. Prepare your audio Send raw mono audio (no file header or container) in one of these formats, at its original sample rate. There’s no need to resample it. | encoding | sampleRateHz | Typical source | | --- | --- | --- | | pcm\_s16le | 48000 | Browser and app microphones | | pcm\_s16le | 16000 | Wideband (HD) voice and many voice AI platforms | | pcm\_s16le | 8000 | Telephone audio decoded to 16-bit PCM | | mulaw | 8000 | Telephone audio (G.711 μ-law), common in North America and Japan | | alaw | 8000 | Telephone audio (G.711 A-law), common in Europe | `pcm_s16le` is signed 16-bit little-endian PCM. `mulaw` and `alaw` are G.711, one byte per sample. Always tell us which format you’re sending, in `start_utterance` (step 6). Send frames of up to four seconds of audio. We recommend 20 ms per frame, for example 160 bytes of 8 kHz `mulaw`, 640 bytes of 16 kHz `pcm_s16le` or 1,920 bytes of 48 kHz `pcm_s16le`. To convert a recording for testing, you can use [FFmpeg](https://ffmpeg.org/): **Shell** ```shellscript ffmpeg -i input.wav -ac 1 -ar 16000 -c:a pcm_s16le address.wav ``` ## 5. Connect Open a WebSocket to: **Endpoint** ``` wss://voice.swiftcomplete.com/v1/address/stream ``` Send your key in the `x-api-key` header: **Header** ```http x-api-key: YOUR_API_KEY ``` You can open the connection before the caller starts speaking, for example while your agent asks for their address. You must send `start_utterance` within 15 seconds of connecting. If we can’t accept the connection, the WebSocket upgrade fails with an HTTP status: | Status | Meaning | What to do | | --- | --- | --- | | 401 | The key is missing or malformed, or Swiftcomplete doesn't recognise it. | Check that the key is copied exactly and sent in x-api-key. | | 403 | Swiftcomplete recognises the key but won't accept it, for example because its free trial has ended or it is restricted to URLs or IP addresses. | Read the description, then check your account or use an unrestricted key. | | 429 | The key already has four connections open, or the service has too many connections waiting to start. | Retry after the number of seconds in Retry-After. | | 503 | The service is temporarily unavailable. | Retry with backoff. | A `401` or `403` for a key in the right format comes with a JSON body from Swiftcomplete that explains why, the same as the Validate API’s: **JSON** ```json { "parameter": "key", "description": "Your credits have expired. Please sign in to your account and purchase credits to continue using the service.", "resolutionExamples": [] } ``` Show or log the `description`. Its wording comes from Swiftcomplete and may change, so don’t match on it. A missing or malformed key gets a `401` with no body. ## 6. Stream the address ### Start Send one `start_utterance` message as JSON text: **JSON** ```json { "type": "start_utterance", "audioFormat": { "encoding": "mulaw", "sampleRateHz": 8000 }, "idempotencyKey": "5f0c2a8e-7d1b-4c3e-9a2f-1b6d8e4c0a7f" } ``` | Field | Type | Required | Description | | --- | --- | --- | --- | | type | string | Yes | "start\_utterance" | | audioFormat | object | Yes | The format you'll send: encoding and sampleRateHz, as in step 4. Without it, the request ends with protocol\_error. | | idempotencyKey | string | No | Identifies this address across retries, for example a UUID: 1 to 128 printable ASCII characters, without spaces. See Retries in step 8. | | coordinateResolution | string | No | "postcode", the default, or "premise" for coordinates at the property. Any other value ends the request with protocol\_error. See Coordinates in step 7. | | clipToCountry | string | No | Return only addresses in these countries: comma-separated ISO 3166-1 alpha-2 codes, GB, GG, IM or JE. See Limit the area below. | | clipToCircle | string | No | Return only addresses within a circle: "lat,lng,km", for example "51.520847,-0.195521,1". | | clipToBoundingBox | string | No | Return only addresses within a box: "south\_lat,west\_lng,north\_lat,east\_lng", for example "51.52,-0.2,51.53,-0.19". | | clipToPolygon | string | No | Return only addresses within a polygon: 4 to 25 "lat,lng" pairs, the last the same as the first. | | language | string | No | The language the caller speaks, as a BCP 47 tag. "en-GB", the default, or "en" for the same. See Language below. | | mode | string | No | The level of confidence required to return an address: "strict", "flexible" (the default) or "top\_rank". See Choose a mode below. | We ignore fields we don’t recognise, so a client that sends extra fields keeps working. ### Limit the area If you know where the address should be, for example within your delivery area, you can limit the addresses we return with the same clip options as the [what3words AutoSuggest API](https://developer.what3words.com/public-api/docs#autosuggest), sent as fields of `start_utterance`: **JSON** ```json { "type": "start_utterance", "audioFormat": { "encoding": "mulaw", "sampleRateHz": 8000 }, "clipToCountry": "GB", "clipToCircle": "51.520847,-0.195521,20" } ``` - **Inside means the postcode.** An address is inside an area when its postcode’s location is, so an address near the edge may fall on either side of it. - **Countries are alternatives, options must all hold.** `"GB,JE"` returns addresses in either country. With `clipToCountry` and `clipToCircle`, an address must be in one of the countries and inside the circle. - **GB is the United Kingdom without the Crown Dependencies.** For Jersey, Guernsey or the Isle of Man, add JE, GG or IM. Use GB, not UK, and GG, not GY. Without `clipToCountry`, all four are included. - **We return only addresses inside the area, in every mode.** We choose the best match among the addresses inside it. If none of them can be returned under your mode and the address we identify is outside it, you receive `not_resolved` with the reason `outside_clip` (step 7). - **Each option can be given once.** An option that can’t be read, a country we don’t cover, or an option given twice ends the request with `invalid_parameter` before any work is done (step 7). ### Language `language` is the language the caller speaks. We currently support English as spoken in the UK, `en-GB`, which is the default; `en` means the same. It doesn’t change the address returned or its format. Other languages are refused with `invalid_parameter`. To see what’s supported, see Coverage (step 10). ### Choose a mode `mode` determines the level of confidence required to return an address. The result looks the same in every mode, and every address returned is charged once. | mode | An address is returned when it is | | --- | --- | | strict (most strict) | identified with confidence and the speaker included a locality or postcode that is confidently matched to the rest of the address. | | flexible (default - medium strictness) | identified with confidence, without requiring the strong confidence level for the locality or postcode that is required in strict mode. | | top\_rank (least strict) | the top ranked address that matches what was heard. The best match is returned even when confidence isn’t high; it is still possible to have no result returned (although in almost all cases a result is expected to be returned). | - **Any other value** ends the request with `invalid_parameter` before any work is done (step 7). - Note: `top_rank` may be helpful when using a narrow clipping area and it is desirable to return results based on partial addresses. For example, in the use case of a local taxi service in a village (which doesn’t contain duplicate street names), a speaker may omit locality and postcode from the address in the belief that they are not required. For any cases for which clipping is not applied or is only applied at country level, flexible or strict modes are strongly recommended. ### Send audio Send the caller’s audio as binary WebSocket messages, in order, as it arrives. Each address can be up to 60 seconds of audio. ### Commit When the caller has finished saying their address, send: **JSON** ```json { "type": "commit_utterance" } ``` Commit as soon as you’re confident the caller has finished, for example when your voice activity detection hears them stop. Callers often pause part-way through an address, for example before the postcode, so don’t commit at the first short pause: anything said after the commit is lost. This matters most on phone audio, where pauses are harder to tell from quiet speech. The result follows the commit. Don’t send any more audio afterwards. ### Transcripts You receive transcripts while the caller speaks: **JSON** ```json {"type":"transcript_interim","transcript":"ten downing"} {"type":"transcript_interim","transcript":"ten downing street"} {"type":"transcript_final","transcript":"ten downing street london"} ``` - Each interim transcript holds everything heard so far and replaces the one before it. - There is at most one final transcript, sent after you commit. Don’t rely on receiving it. - They are raw speech-to-text output, unformatted and possibly with recognition errors. Use them for display, such as live captions or context for your agent, or ignore them. Never use them as the address: the result carries the address. ## 7. Handle the result After you commit, you receive exactly one of these three events, and then the connection closes. We recommend a client timeout of 15 seconds after the commit. ### `validation_completed`: an address was found **JSON** ```json { "type": "validation_completed", "turnId": "9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90", "appliedOptions": { "clipToCountry": "GB,GG,IM,JE", "language": "en-GB", "mode": "flexible" }, "response": { "validation": { "result": "match", "resolution": "premise" }, "address": { "singleLine": "65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "line1": "65 Alfred Road", "primaryLocality": "London", "postalCode": "W2 5EU" } }, "associatedRecords": null } } ``` `response` is exactly what the Swiftcomplete Validate API returns for this address, so you can handle it with the same code. - `validation.result` is `match`, `suggestion` or `none`. - `validation.resolution` is the level the address was matched to, for example `premise` or `street`. - `address` holds the formatted address, both on a single line and split into lines. `turnId` identifies this request. Include it if you contact support. `appliedOptions` lists the clip, language and mode options the request used, including the defaults, so you can confirm they were applied. ### Coordinates By default, an address’s coordinates are its postcode’s. To ask for coordinates at the property itself, send `coordinateResolution` set to `premise` in `start_utterance`. `response` is still exactly what the Validate API returns when asked for premise coordinates: where Swiftcomplete has no point for the property, the coordinates stay at the postcode. See the [Validate API documentation](https://developer.what3words.com/tutorial/swiftcomplete-validate) for how coordinates are returned. Each address is charged once, after you receive it, at Validate’s price for the coordinates it returns: an address returned with premise coordinates is charged at the premise price, and one with postcode coordinates at the standard price. ### `not_resolved`: no address could be identified **JSON** ```json {"type":"not_resolved","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90"} ``` We couldn’t identify an address that your mode returns (see Choose a mode in step 6), so we don’t return a guess. With `top_rank`, this means we found no address at all. Ask the caller again on a new connection, for example asking them to say the postcode clearly. If you limited the area and we could only identify an address outside it, the result says so, and isn’t charged: **JSON** ```json {"type":"not_resolved","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","reason":"outside_clip","appliedOptions":{"clipToCountry":"GB,GG,IM,JE","clipToCircle":"51.520847,-0.195521,20","language":"en-GB","mode":"flexible"}} ``` Tell the caller you can’t accept that address, rather than asking them to repeat it. ### `error`: the request failed **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"service_busy","retryAfterMs":1000} ``` | code | Meaning | What to do | | --- | --- | --- | | invalid\_audio | The audio wasn't in the required format, or you committed without sending any. | Check your audio against step 4. | | utterance\_limit\_exceeded | A frame held more than 4 seconds of audio, or the address more than 60 seconds. | Send smaller frames, and capture only the address. | | no\_speech | We heard no speech. | Ask the caller to say their address again. | | protocol\_error | Messages arrived out of order or couldn't be read, for example audio before start\_utterance, a second start\_utterance or an unknown coordinateResolution. | Fix your client. | | invalid\_parameter | A clip, language or mode option couldn't be read or isn't supported, or was given twice. parameter names it and message says why. No work was done. | Fix the option. | | service\_busy | The service is at capacity. No work was done. | Retry after retryAfterMs milliseconds. | | api\_key\_rejected | Swiftcomplete stopped accepting your key during the request, for example because your credits ran out or your free trial ended. The address isn't returned. | Read the description and check your account. Retrying won't help until it's fixed. | | service\_unavailable | A temporary failure on our side. | Retry once (see below). If it keeps happening, contact us with the turnId and errorRef. | An `api_key_rejected` error also has a `description` from Swiftcomplete, for example: **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"api_key_rejected","description":"Your free trial has expired. Please sign in to your account and purchase credits to continue using the service."} ``` An `invalid_parameter` error names the option and says what’s wrong, for example: **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"invalid_parameter","parameter":"clipToCountry","message":"UK is not an ISO 3166-1 country code: use GB for England, Scotland, Wales and Northern Ireland. Supported: GB, GG, IM, JE"} ``` A `service_unavailable` error also has an `errorRef`, such as `"errorRef":"E954"`, which helps our support team find the cause. New values may be added, so don’t write code that depends on particular ones. ## 8. Retries If a network failure or timeout prevents you from receiving a result, you can ask the caller to repeat their address or open a new connection and resend the captured audio at its original pace. Use a new `idempotencyKey` if the caller repeats their address, or reuse the original key if resending the same audio. For 120 seconds after a result, the same key returns the original result and `turnId` without reprocessing the audio. Keys for requests that end in an error aren’t retained, so retries are processed again. Retries while the original request is still processing return `service_busy`. Use a new key for each address capture. Within the 120-second window, reusing a key returns the original result, even if the audio or other fields in `start_utterance` have changed. ## 9. Limits | Limit | Value | | --- | --- | | Addresses per connection | 1 | | Time to send start\_utterance after connecting | 15 seconds | | Audio per address | 60 seconds | | Time from start\_utterance to commit\_utterance | 120 seconds | | Frame size | 4 seconds of audio | | Simultaneous connections per key | 4\. Contact us if you need more. | While a request is active, the server sends a WebSocket ping every 20 seconds. Standard WebSocket libraries answer automatically. ## 10. Coverage The API resolves postal addresses in the United Kingdom (GB), Guernsey (GG), the Isle of Man (IM) and Jersey (JE), spoken in English, one address per connection. To check what's supported from your code, send a `GET` with your key in the `x-api-key` header to: - `https://voice.swiftcomplete.com/v1/address/available-countries` - `https://voice.swiftcomplete.com/v1/address/available-languages` **JSON** ```json {"countries":[{"code":"GB","languages":["en-GB"],"name":"United Kingdom"},{"code":"GG","languages":["en-GB"],"name":"Guernsey"},{"code":"IM","languages":["en-GB"],"name":"Isle of Man"},{"code":"JE","languages":["en-GB"],"name":"Jersey"}]} {"languages":[{"code":"en-GB","name":"English (UK)","nativeName":"English (UK)"}]} ``` These requests aren't charged. ## 11. Example code Both examples stream a WAV file at real-time pace, as a live call would, and print the result. The WAV file must be 16-bit mono PCM at 8, 16 or 48 kHz (see step 4). ### Python **Python** ```python """Resolve a spoken UK address from a WAV file with Swiftcomplete. Usage: pip install "websockets>=14" export SWIFTCOMPLETE_API_KEY=your-key python resolve_address.py address.wav """ import asyncio import json import os import sys import uuid import wave import websockets URL = "wss://voice.swiftcomplete.com/v1/address/stream" SAMPLE_RATES = (8_000, 16_000, 48_000) FRAME_MS = 20 RESULT_TIMEOUT_S = 15 def read_pcm(path): with wave.open(path, "rb") as wav: rate = wav.getframerate() if wav.getnchannels() != 1 or wav.getsampwidth() != 2 or rate not in SAMPLE_RATES: sys.exit("The WAV file must be 16-bit mono PCM at 8, 16 or 48 kHz") return wav.readframes(wav.getnframes()), rate async def stream_audio(ws, pcm, rate): """Send the audio at real-time pace, as a live call would, then commit.""" frame_bytes = rate * 2 * FRAME_MS // 1000 # 20 ms of 16-bit mono audio try: for offset in range(0, len(pcm), frame_bytes): await ws.send(pcm[offset:offset + frame_bytes]) await asyncio.sleep(FRAME_MS / 1000) await ws.send(json.dumps({"type": "commit_utterance"})) except websockets.ConnectionClosed: pass # The server ended the request early; its result explains why. async def resolve(pcm, rate): headers = {"x-api-key": os.environ["SWIFTCOMPLETE_API_KEY"]} async with websockets.connect(URL, additional_headers=headers) as ws: await ws.send(json.dumps({ "type": "start_utterance", "idempotencyKey": str(uuid.uuid4()), "audioFormat": {"encoding": "pcm_s16le", "sampleRateHz": rate}, })) sender = asyncio.create_task(stream_audio(ws, pcm, rate)) try: async for message in ws: event = json.loads(message) if event["type"] == "transcript_interim": print("Heard so far:", event["transcript"]) elif event["type"] == "transcript_final": print("Heard:", event["transcript"]) else: return event # The one result; the server then closes the connection. finally: sender.cancel() return None def describe(result): if result is None: return "The connection closed without a result" if result["type"] == "validation_completed": response = result["response"] address = (response.get("address") or {}).get("singleLine") return f"{response['validation']['result']}: {address}" if result["type"] == "not_resolved": return "No address identified; ask the caller again" detail = "" if "retryAfterMs" in result: detail += f", retry after {result['retryAfterMs']} ms" if "errorRef" in result: detail += f", ref {result['errorRef']}" if "description" in result: detail += f": {result['description']}" return f"Error: {result['code']}{detail} (turn {result['turnId']})" def refusal(error): """Why the connection was refused, with Swiftcomplete's description when it gave one.""" try: description = json.loads(error.response.body)["description"] except (TypeError, ValueError, KeyError): description = None status = error.response.status_code return f"Connection refused: HTTP {status}" + (f": {description}" if description else "") def main(): pcm, rate = read_pcm(sys.argv[1]) audio_seconds = len(pcm) / (rate * 2) try: result = asyncio.run(asyncio.wait_for(resolve(pcm, rate), audio_seconds + RESULT_TIMEOUT_S)) except websockets.InvalidStatus as error: sys.exit(refusal(error)) except asyncio.TimeoutError: sys.exit("No result in time") print(describe(result)) if __name__ == "__main__": main() ``` ### Node.js **JavaScript** ```javascript // Resolve a spoken UK address from a WAV file with Swiftcomplete. // // Usage (Node.js 18 or later): // npm install ws // SWIFTCOMPLETE_API_KEY=your-key node resolve-address.mjs address.wav import { randomUUID } from "node:crypto"; import { readFileSync } from "node:fs"; import { setTimeout as sleep } from "node:timers/promises"; import WebSocket from "ws"; const URL = "wss://voice.swiftcomplete.com/v1/address/stream"; const SAMPLE_RATES = [8000, 16000, 48000]; const FRAME_MS = 20; const RESULT_TIMEOUT_MS = 15000; function readPcm(path) { const wav = readFileSync(path); if (wav.toString("ascii", 0, 4) !== "RIFF" || wav.toString("ascii", 8, 12) !== "WAVE") { throw new Error("Not a WAV file"); } let format; for (let offset = 12; offset + 8 <= wav.length; ) { const id = wav.toString("ascii", offset, offset + 4); const size = wav.readUInt32LE(offset + 4); const body = wav.subarray(offset + 8, offset + 8 + size); if (id === "fmt ") { format = { encoding: body.readUInt16LE(0), channels: body.readUInt16LE(2), sampleRate: body.readUInt32LE(4), bits: body.readUInt16LE(14), }; } else if (id === "data") { const ok = format?.encoding === 1 && format.channels === 1 && SAMPLE_RATES.includes(format.sampleRate) && format.bits === 16; if (!ok) throw new Error("The WAV file must be 16-bit mono PCM at 8, 16 or 48 kHz"); return { pcm: body, rate: format.sampleRate }; } offset += 8 + size + (size % 2); } throw new Error("The WAV file has no audio data"); } function describe(result) { if (!result) return "The connection closed without a result"; if (result.type === "validation_completed") { const { validation, address } = result.response; return `${validation.result}: ${address?.singleLine}`; } if (result.type === "not_resolved") return "No address identified; ask the caller again"; const retry = result.retryAfterMs ? `, retry after ${result.retryAfterMs} ms` : ""; const ref = result.errorRef ? `, ref ${result.errorRef}` : ""; const why = result.description ? `: ${result.description}` : ""; return `Error: ${result.code}${retry}${ref}${why} (turn ${result.turnId})`; } const { pcm, rate } = readPcm(process.argv[2]); const frameBytes = (rate * 2 * FRAME_MS) / 1000; // 20 ms of 16-bit mono audio const audioMs = (pcm.length / (rate * 2)) * 1000; const ws = new WebSocket(URL, { headers: { "x-api-key": process.env.SWIFTCOMPLETE_API_KEY } }); const timer = setTimeout(() => ws.terminate(), audioMs + RESULT_TIMEOUT_MS); let result; ws.on("open", async () => { ws.send(JSON.stringify({ type: "start_utterance", idempotencyKey: randomUUID(), audioFormat: { encoding: "pcm_s16le", sampleRateHz: rate }, })); // Send the audio at real-time pace, as a live call would, then commit. for (let offset = 0; offset < pcm.length; offset += frameBytes) { if (ws.readyState !== WebSocket.OPEN) return; // The server ended the request early. ws.send(pcm.subarray(offset, offset + frameBytes)); await sleep(FRAME_MS); } if (ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify({ type: "commit_utterance" })); }); ws.on("message", (data, isBinary) => { if (isBinary) return; const event = JSON.parse(data.toString()); if (event.type === "transcript_interim") console.log("Heard so far:", event.transcript); else if (event.type === "transcript_final") console.log("Heard:", event.transcript); else result = event; // The one result; the server then closes the connection. }); // A refused connection: the HTTP status, with Swiftcomplete's description when it gave one. ws.on("unexpected-response", (_request, response) => { let body = ""; response.on("data", (chunk) => { body += chunk; }); response.on("end", () => { let description; try { description = JSON.parse(body).description; } catch { /* no JSON body */ } console.error(`Connection refused: HTTP ${response.statusCode}${description ? `: ${description}` : ""}`); clearTimeout(timer); process.exit(1); }); }); ws.on("error", (error) => console.error(error.message)); ws.on("close", () => { clearTimeout(timer); console.log(describe(result)); }); ``` ## 12. Best practices - **Ask for the whole address at once,** including the postcode, for example: “Please tell me your full address, including the postcode.” - **Open the connection early,** while your agent is still asking the question, so it’s ready when the caller starts speaking. - **Commit promptly** once the caller has finished. - **Read the address back** to the caller to confirm it when you can. - **If the address isn’t resolved,** ask again on a new connection, for example asking for the postcode first. - **Keep your API key on your server.** ## 13. Troubleshooting - **`401` when connecting:** check that the key is copied exactly and is sent in the `x-api-key` header. - **`403` when connecting:** read the `description`. Check that your account has credits and that the key has no URL or IP address restrictions. - **`api_key_rejected`:** your key stopped being accepted during the request. Read the `description` and check your account. - **`protocol_error` straight after `start_utterance`:** check that you sent `audioFormat`. - **`invalid_parameter`:** read the `message`. Check the option’s format against step 6, and use GB, GG, IM or JE as country codes. - **`invalid_audio`:** check that `audioFormat` matches the audio you send (step 4). Raw audio must have no WAV header. - **Frequent `not_resolved` or `no_speech`:** check that the audio is the caller’s voice at the right sample rate, isn’t clipped or very quiet, and contains the full address. If you need help, contact us at [support@swiftcomplete.com](mailto:support@swiftcomplete.com) and include the `turnId`, and the `errorRef` if you received one. #### How your voice agent might benefit from Swiftcomplete - **Contact centres:** capture a caller’s address without spelling it out letter by letter. - **Voice AI agents:** give your agent a validated address it can confirm and act on. - **IVR systems:** take addresses in self-service flows without an agent. - **Deliveries and bookings:** collect a delivery or appointment address over the phone. - **Insurance and claims:** record the address of a property or incident accurately. - **Utilities and telecoms:** check addresses during sign-up, moves and engineer bookings. --- # AI Voice Address Capture: Resolve Recorded Addresses with Swiftcomplete Resolve recorded UK addresses into validated postal addresses with Swiftcomplete’s voice address API using a single HTTPS request. Topics: SwiftComplete Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Voice](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/voice.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-ai-voice-capture-recorded-addresses Updated: 2026-11-24 ## 1. Overview Use Swiftcomplete’s recorded address API to resolve a spoken postal address from a voicemail, recorded call or voice message. Send a recording containing one spoken address in a single HTTPS `POST`. If the API identifies an address, the `response` field contains the validated postal address in single-line and multiline formats. The API returns postcode-level coordinates by default, or property-level coordinates if you request them and they’re available. If the API can’t identify the address confidently, it returns a result with `type` set to `not_resolved`. For live calls, use the [streaming API](https://developer.what3words.com/tutorial/swiftcomplete-ai-voice-address-capture) to send audio and receive transcripts as the caller speaks. Both APIs use the same format for the final result. ## 2. How it works 1. Your server sends one recording, holding one spoken address, in a single HTTPS `POST`. 2. We transcribe the recording and identify the address. 3. The response holds exactly one result: the validated address, `not_resolved` or an error. There’s no job to poll and no callback: the result is in the response. The response holds only the result, with no transcripts. To resolve another address, send another request. ## 3. Authentication All requests require an API key passed in the `x-api-key` header. [Get an API key here](https://www.swiftcomplete.com/account/register/) Keep your key on your server. Always send recordings from your backend, never from a web page or mobile app, where your key could be read. If you record the caller in a browser or app, upload the recording through your server. ## 4. Prepare your recording Send a WAV file, or raw audio with its format in the query string (step 5). Send the audio at its original sample rate. There’s no need to resample it. | Audio | encoding | sampleRateHz | Typical source | | --- | --- | --- | --- | | 16-bit PCM | pcm\_s16le | 48000 | Browser and app microphones | | 16-bit PCM | pcm\_s16le | 16000 | Wideband (HD) voice and many voice AI platforms | | 16-bit PCM | pcm\_s16le | 8000 | Telephone audio decoded to 16-bit PCM | | G.711 μ-law | mulaw | 8000 | Telephone recordings, common in North America and Japan | | G.711 A-law | alaw | 8000 | Telephone recordings, common in Europe | The audio must be mono. `pcm_s16le` is signed 16-bit little-endian PCM. `mulaw` and `alaw` are G.711, one byte per sample. - **WAV files** declare their own format, so there’s nothing else to send. Standard and extensible WAV files both work. - **Raw audio** has no header, so you must tell us its format with `encoding` and `sampleRateHz` (step 5). Without them, the request ends with `protocol_error`. - **Compressed formats,** such as MP3, M4A, Ogg or Opus, aren’t accepted. Convert them first. Each recording can hold up to 60 seconds of audio. It works best when it holds just the caller saying their address. To convert a recording, you can use [FFmpeg](https://ffmpeg.org/): **Shell** ```shellscript ffmpeg -i input.m4a -ac 1 -ar 16000 -c:a pcm_s16le address.wav ``` If your call recordings are stereo, with the caller on one channel, send only the caller’s channel. For example, `-af "pan=mono|c0=c1"` in place of `-ac 1` keeps the right-hand channel. ## 5. Send the recording Send the recording as the body of a `POST` to: **Endpoint** ``` https://voice.swiftcomplete.com/v1/address/recording ``` | Header | Required | Description | | --- | --- | --- | | x-api-key | Yes | Your Swiftcomplete API key. | | Content-Type | No | audio/wav for a WAV file. A body that starts with a WAV header is read as a WAV file whatever its Content-Type. | | Idempotency-Key | No | Identifies this address across retries, for example a UUID: 1 to 128 printable ASCII characters, without spaces. See Retries in step 7. | For example, with [curl](https://curl.se/): **Shell** ```shellscript curl https://voice.swiftcomplete.com/v1/address/recording \ -H "x-api-key: $SWIFTCOMPLETE_API_KEY" \ -H "Content-Type: audio/wav" \ -H "Idempotency-Key: $(uuidgen)" \ --data-binary @address.wav ``` For raw audio, add its format to the query string: **Shell** ```shellscript curl "https://voice.swiftcomplete.com/v1/address/recording?encoding=mulaw&sampleRateHz=8000" \ -H "x-api-key: $SWIFTCOMPLETE_API_KEY" \ -H "Content-Type: application/octet-stream" \ --data-binary @address.ulaw ``` | Query parameter | Required | Description | | --- | --- | --- | | encoding | For raw audio | pcm\_s16le, mulaw or alaw, as in step 4. | | sampleRateHz | For raw audio | 8000, 16000 or 48000, as in step 4. | | channels | No | 1, the default. | | coordinateResolution | No | postcode, the default, or premise for coordinates at the property, for any recording. Any other value is refused with 400 and protocol\_error. See Coordinates in step 6. | | clipToCountry | No | Return only addresses in these countries: comma-separated codes, GB, GG, IM or JE. See Limit the area below. | | clipToCircle | No | Return only addresses within a circle: lat,lng,km, for example 51.520847,-0.195521,1. | | clipToBoundingBox | No | Return only addresses within a box: south\_lat,west\_lng,north\_lat,east\_lng. | | clipToPolygon | No | Return only addresses within a polygon: 4 to 25 lat,lng pairs, the last the same as the first. | | language | No | The language the caller speaks: en-GB, the default, or en for the same. | | mode | No | The level of confidence required to return an address: strict, flexible (the default) or top\_rank. See Choose a mode below. | For a WAV file, we ignore the query string’s format and read the file’s own. We ignore parameters we don’t recognise, so a client that sends extra ones keeps working. The whole recording must arrive within 30 seconds. We recommend a client timeout of 60 seconds after your upload completes. ### Limit the area If you know where the address should be, for example within your delivery area, you can limit the addresses we return with the same clip options as the [what3words AutoSuggest API](https://developer.what3words.com/public-api/docs#autosuggest), in the query string. Commas may be sent as they are or as %2C: **Shell** ```shellscript curl "https://voice.swiftcomplete.com/v1/address/recording?clipToCountry=GB&clipToCircle=51.520847,-0.195521,20" \ -H "x-api-key: $SWIFTCOMPLETE_API_KEY" \ -H "Content-Type: audio/wav" \ --data-binary @address.wav ``` - **Inside means the postcode.** An address is inside an area when its postcode’s location is, so an address near the edge may fall on either side of it. - **Countries are alternatives, options must all hold.** `GB,JE` returns addresses in either country. With `clipToCountry` and `clipToCircle`, an address must be in one of the countries and inside the circle. - **GB is the United Kingdom without the Crown Dependencies.** For Jersey, Guernsey or the Isle of Man, add JE, GG or IM. Use GB, not UK, and GG, not GY. Without `clipToCountry`, all four are included. - **We return only addresses inside the area, in every mode.** We choose the best match among the addresses inside it. If none of them can be returned under your mode and the address we identify is outside it, you receive `not_resolved` with the reason `outside_clip` (step 6). - **Each option can be given once.** An option that can’t be read, a country we don’t cover, or an option given twice is refused with 400 and `invalid_parameter` before any work is done (step 6). `language` is the language the caller speaks. We currently support English as spoken in the UK, `en-GB`, which is the default; `en` means the same. It doesn’t change the address returned or its format. ### Choose a mode `mode` determines the level of confidence required to return an address. The result looks the same in every mode, and every address returned is charged once. | mode | An address is returned when it is | | --- | --- | | strict (most strict) | identified with confidence and the speaker included a locality or postcode that is confidently matched to the rest of the address. | | flexible (default - medium strictness) | identified with confidence, without requiring the strong confidence level for the locality or postcode that is required in strict mode. | | top\_rank (least strict) | the top ranked address that matches what was heard. The best match is returned even when confidence isn’t high; it is still possible to have no result returned (although in almost all cases a result is expected to be returned). | - **Any other value,** or `mode` given twice, is refused with 400 and `invalid_parameter` before any work is done (step 6). - Note: `top_rank` may be helpful when using a narrow clipping area and it is desirable to return results based on partial addresses. For example, in the use case of a local taxi service in a village (which doesn’t contain duplicate street names), a speaker may omit locality and postcode from the address in the belief that they are not required. For any cases for which clipping is not applied or is only applied at country level, flexible or strict modes are strongly recommended. ## 6. Handle the response ### Refused before processing If we can’t accept the request, you receive an HTTP status without a result: | Status | Meaning | What to do | | --- | --- | --- | | 401 | The key is missing or malformed, or Swiftcomplete doesn't recognise it. | Check that the key is copied exactly and sent in x-api-key. | | 403 | Swiftcomplete recognises the key but won't accept it, for example because its free trial has ended or it is restricted to URLs or IP addresses. | Read the description, then check your account or use an unrestricted key. | | 429 | The key already has four requests or streaming connections open, or the service has too many requests waiting to start. | Retry after the number of seconds in Retry-After. | | 503 | The service is temporarily unavailable. | Retry with backoff. | A `401` or `403` for a key in the right format comes with a JSON body from Swiftcomplete that explains why, the same as the Validate API’s: **JSON** ```json { "parameter": "key", "description": "Your credits have expired. Please sign in to your account and purchase credits to continue using the service.", "resolutionExamples": [] } ``` Show or log the `description`. Its wording comes from Swiftcomplete and may change, so don’t match on it. A missing or malformed key gets a `401` with no body. Otherwise, the response body is one of the three results below, as JSON. Read its `type`, and use the HTTP status only to tell success from failure. ### `validation_completed`: an address was found HTTP `200`: **JSON** ```json { "type": "validation_completed", "turnId": "9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90", "appliedOptions": { "clipToCountry": "GB,GG,IM,JE", "language": "en-GB", "mode": "flexible" }, "response": { "validation": { "result": "match", "resolution": "premise" }, "address": { "singleLine": "65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "line1": "65 Alfred Road", "primaryLocality": "London", "postalCode": "W2 5EU" } }, "associatedRecords": null } } ``` `response` is exactly what the Swiftcomplete Validate API returns for this address, so you can handle it with the same code. - `validation.result` is `match`, `suggestion` or `none`. - `validation.resolution` is the level the address was matched to, for example `premise` or `street`. - `address` holds the formatted address, both on a single line and split into lines. `turnId` identifies this request. Include it if you contact support. `appliedOptions` lists the clip, language and mode options the request used, including the defaults, so you can confirm they were applied. ### Coordinates By default, coordinates are returned at postcode level. To request property-level coordinates, set the `coordinateResolution` query parameter to `premise`. If property-level coordinates are unavailable, postcode coordinates are returned instead. See the [Validate API documentation](https://developer.what3words.com/tutorial/swiftcomplete-validate) for the response format. Each address is charged once, based on the coordinates returned. Premise coordinates are charged at the premise price; postcode coordinates, including when premise coordinates were requested but unavailable, are charged at the standard price. ### `not_resolved`: no address could be identified HTTP `200`: **JSON** ```json {"type":"not_resolved","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90"} ``` We couldn’t identify an address that your mode returns (see Choose a mode in step 5), so we don’t return a guess. With `top_rank`, this means we found no address at all. Ask the caller again if you can, for example asking them to say the postcode clearly. If you limited the area and we could only identify an address outside it, the result says so, with HTTP `200`, and isn’t charged: **JSON** ```json {"type":"not_resolved","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","reason":"outside_clip","appliedOptions":{"clipToCountry":"GB,GG,IM,JE","clipToCircle":"51.520847,-0.195521,20","language":"en-GB","mode":"flexible"}} ``` ### `error`: the request failed **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"service_busy","retryAfterMs":1000} ``` | HTTP | code | Meaning | What to do | | --- | --- | --- | --- | | 400 | invalid\_audio | The recording isn't in a supported format (step 4) or holds no audio, or the Content-Type says WAV but the body isn't a WAV file. | Check your recording against step 4. | | 400 | protocol\_error | The request couldn't be read, for example raw audio without encoding and sampleRateHz, an invalid Idempotency-Key or query parameter, or an upload that took more than 30 seconds. | Fix your request. | | 400 | invalid\_parameter | A clip, language or mode option couldn't be read or isn't supported, or was given twice. parameter names it and message says why. No work was done. | Fix the option. | | 403 | api\_key\_rejected | Swiftcomplete stopped accepting your key during the request, for example because your credits ran out or your free trial ended. The address isn't returned. | Read the description and check your account. Retrying won't help until it's fixed. | | 413 | utterance\_limit\_exceeded | The recording holds more than 60 seconds of audio, or the request is too large. | Send only the address. | | 422 | no\_speech | We heard no speech. | Ask the caller to say their address again. | | 429 | service\_busy | The service is at capacity, or a request with the same Idempotency-Key is still in progress. This request was not processed. | Retry after retryAfterMs milliseconds. The Retry-After header gives the same wait in seconds. | | 503 or 500 | service\_unavailable | A temporary failure on our side. | Retry once (see below). If it keeps happening, contact us with the turnId and errorRef. | An `api_key_rejected` error also has a `description` from Swiftcomplete, for example: **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"api_key_rejected","description":"Your free trial has expired. Please sign in to your account and purchase credits to continue using the service."} ``` An `invalid_parameter` error names the option and says what’s wrong, for example: **JSON** ```json {"type":"error","turnId":"9fb7c1e2-4d0a-4c55-a0f3-2b8e6d1f7a90","code":"invalid_parameter","parameter":"clipToPolygon","message":"clipToPolygon must be closed: repeat the first lat,lng pair as the last"} ``` A `service_unavailable` error also has an `errorRef`, such as `"errorRef":"E954"`, which helps our support team find the cause. New values may be added, so don’t write code that depends on particular ones. ## 7. Retries If a network failure or timeout prevents you from receiving a result, retry with the same recording and `Idempotency-Key`. For 120 seconds after a result, the same key returns the original result and `turnId` without reprocessing the audio. Keys for requests that end in an error aren’t retained, so retries are processed again. Retries while the original request is still processing return `service_busy`. Use a new key for each recording. Within the 120-second window, reusing a key returns the original result, even if the audio or valid query parameters have changed. ## 8. Limits | Limit | Value | | --- | --- | | Addresses per request | 1 | | Audio per recording | 60 seconds | | Request size | 5.8 MB, enough for 60 seconds of 48 kHz audio | | Time to upload the recording | 30 seconds | | Simultaneous requests per key | 4, shared with streaming connections. Contact us if you need more. | ## 9. Coverage The API resolves postal addresses in the United Kingdom (GB), Guernsey (GG), the Isle of Man (IM) and Jersey (JE), spoken in English, one address per recording. To check what's supported from your code, send a `GET` with your key in the `x-api-key` header to: - `https://voice.swiftcomplete.com/v1/address/available-countries` - `https://voice.swiftcomplete.com/v1/address/available-languages` **JSON** ```json {"countries":[{"code":"GB","languages":["en-GB"],"name":"United Kingdom"},{"code":"GG","languages":["en-GB"],"name":"Guernsey"},{"code":"IM","languages":["en-GB"],"name":"Isle of Man"},{"code":"JE","languages":["en-GB"],"name":"Jersey"}]} {"languages":[{"code":"en-GB","name":"English (UK)","nativeName":"English (UK)"}]} ``` These requests aren't charged. ## 10. Example code Both examples send a WAV file, retry with the same `Idempotency-Key` after a network failure or a `429`, and print the result. ### Python **Python** ```python """Resolve a recorded UK address with Swiftcomplete. Usage: pip install requests export SWIFTCOMPLETE_API_KEY=your-key python resolve_recording.py address.wav """ import os import sys import time import uuid import requests URL = "https://voice.swiftcomplete.com/v1/address/recording" ATTEMPTS = 3 TIMEOUT_S = (10, 90) # To connect, then for the upload and the result. def post(audio, idempotency_key): return requests.post( URL, data=audio, headers={ "x-api-key": os.environ["SWIFTCOMPLETE_API_KEY"], "Content-Type": "audio/wav", "Idempotency-Key": idempotency_key, }, timeout=TIMEOUT_S, ) def describe(response): try: body = response.json() except ValueError: body = {} if body.get("type") == "validation_completed": result = body["response"] address = (result.get("address") or {}).get("singleLine") return f"{result['validation']['result']}: {address}" if body.get("type") == "not_resolved": return "No address identified; ask the caller again" if body.get("type") == "error": detail = "" if "retryAfterMs" in body: detail += f", retry after {body['retryAfterMs']} ms" if "errorRef" in body: detail += f", ref {body['errorRef']}" if "description" in body: detail += f": {body['description']}" return f"Error: {body['code']}{detail} (turn {body['turnId']})" # Refused before processing, with Swiftcomplete's description when it gave one. description = body.get("description") return f"Refused: HTTP {response.status_code}" + (f": {description}" if description else "") def main(): with open(sys.argv[1], "rb") as file: audio = file.read() idempotency_key = str(uuid.uuid4()) # One key for this address, reused if we retry. for attempt in range(1, ATTEMPTS + 1): try: response = post(audio, idempotency_key) except requests.RequestException as error: print(f"Request failed ({error})") continue if response.status_code == 429 and attempt < ATTEMPTS: time.sleep(float(response.headers.get("Retry-After", 1))) continue print(describe(response)) return sys.exit("No result") if __name__ == "__main__": main() ``` ### Node.js **JavaScript** ```javascript // Resolve a recorded UK address with Swiftcomplete. // // Usage (Node.js 18 or later): // SWIFTCOMPLETE_API_KEY=your-key node resolve-recording.mjs address.wav import { randomUUID } from "node:crypto"; import { readFileSync } from "node:fs"; import { setTimeout as sleep } from "node:timers/promises"; const URL = "https://voice.swiftcomplete.com/v1/address/recording"; const ATTEMPTS = 3; const TIMEOUT_MS = 90000; // For the upload and the result. function post(audio, idempotencyKey) { return fetch(URL, { method: "POST", headers: { "x-api-key": process.env.SWIFTCOMPLETE_API_KEY, "Content-Type": "audio/wav", "Idempotency-Key": idempotencyKey, }, body: audio, signal: AbortSignal.timeout(TIMEOUT_MS), }); } function describe(status, body) { if (body.type === "validation_completed") { const { validation, address } = body.response; return `${validation.result}: ${address?.singleLine}`; } if (body.type === "not_resolved") return "No address identified; ask the caller again"; if (body.type === "error") { const retry = body.retryAfterMs ? `, retry after ${body.retryAfterMs} ms` : ""; const ref = body.errorRef ? `, ref ${body.errorRef}` : ""; const why = body.description ? `: ${body.description}` : ""; return `Error: ${body.code}${retry}${ref}${why} (turn ${body.turnId})`; } // Refused before processing, with Swiftcomplete's description when it gave one. return `Refused: HTTP ${status}${body.description ? `: ${body.description}` : ""}`; } async function resolve(audio) { const idempotencyKey = randomUUID(); // One key for this address, reused if we retry. for (let attempt = 1; attempt <= ATTEMPTS; attempt++) { let response; try { response = await post(audio, idempotencyKey); } catch (error) { console.error(`Request failed (${error.message})`); continue; } const text = await response.text(); if (response.status === 429 && attempt < ATTEMPTS) { await sleep(Number(response.headers.get("retry-after") ?? 1) * 1000); continue; } let body = {}; try { body = JSON.parse(text); } catch { /* no JSON body */ } return describe(response.status, body); } return null; } const result = await resolve(readFileSync(process.argv[2])); if (result) { console.log(result); } else { console.error("No result"); process.exitCode = 1; } ``` ## 11. Best practices - **Ask for the whole address at once,** including the postcode, for example: “Please tell me your full address, including the postcode.” - **Record only the caller’s answer,** on the caller’s channel alone if your recordings have one channel per speaker. - **Send the original audio.** Don’t resample telephone audio up to a higher rate, and don’t compress it on the way. - **Read the address back** to the caller to confirm it when you can. - **If the address isn’t resolved,** ask again if you can, for example asking for the postcode first. - **Keep your API key on your server.** ## 12. Troubleshooting - **`401`:** check that the key is copied exactly and is sent in the `x-api-key` header. - **`403` without a `type`:** read the `description`. Check that your account has credits and that the key has no URL or IP address restrictions. - **`api_key_rejected`:** your key stopped being accepted during the request. Read the `description` and check your account. - **`protocol_error` for raw audio:** check that the query string has `encoding` and `sampleRateHz`, or send a WAV file instead. - **`invalid_parameter`:** read the `message`. Check the option’s format against step 5, and use GB, GG, IM or JE as country codes. - **`invalid_audio`:** check that the recording is mono, in a format and sample rate from step 4, and not compressed. For raw audio, check that the query string matches the audio. - **`utterance_limit_exceeded`:** trim the recording to the caller saying their address. - **Frequent `not_resolved` or `no_speech`:** check that the recording is the caller’s voice at its original sample rate, isn’t clipped or very quiet, and contains the full address. - **Timeouts:** allow 60 seconds after your upload completes. If you need help, contact us at [support@swiftcomplete.com](mailto:support@swiftcomplete.com) and include the `turnId`, and the `errorRef` if you received one. #### How your business might benefit from Swiftcomplete - **Voicemail:** turn an address left in a voicemail into a validated address. - **Recorded calls:** pick up a caller’s address after the call, without listening back. - **Voice messages:** take addresses that customers send as voice notes in your app or messaging channel. - **Deliveries and bookings:** collect a delivery or appointment address recorded over the phone. - **Insurance and claims:** record the address of a property or incident accurately. - **Utilities and telecoms:** check addresses recorded during sign-up, moves and engineer bookings. --- # Swiftcomplete Postcode Lookup API Integration Use the Postcode Lookup API to list addresses within a postcode, and receive full address details when a user selects their address. Topics: SwiftComplete, Server and Scripting Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-postcode-lookup-api Updated: 2026-11-29 > [!TIP] > For support getting set up, contact us via the [Swiftcomplete webpage](https://what3words.com/swiftcomplete). ## 1. Check postcode exists Pass the postcode in the `text` parameter: **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERTKEYHERE&text=W2%205EU ``` **Response** ```json [ { "primary": { "text": "W2 5EU", "highlights": [0, 1, 3, 5] }, "secondary": { "text": "Alfred Rd", "highlights": [] }, "type": "place.area.postcode", "isContainer": true, "container": "V1;W2 5EU;51.521198;-0.196334", "countryCode": "GB" } ] ``` ## 2. List addresses in a postcode Take the `container` from the previous request and pass it in as a parameter to list the first 100 addresses in the postcode: **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERTKEYHERE&container=V1;W2%205EU;51.521198;-0.196334&maxResults=100 ``` **Response** ```json [ { "primary": { "text": "Blaiz, 65 Alfred Rd", "highlights": [] }, "secondary": { "text": "W2 5EU", "highlights": [0, 1, 3, 5] }, "type": "address.business", "isContainer": false, "countryCode": "GB" }, { "primary": { "text": "Carnot, 65 Alfred Rd", "highlights": [] }, "secondary": { "text": "W2 5EU", "highlights": [0, 1, 3, 5] }, "type": "address.business", "isContainer": false, "countryCode": "GB" }, { "primary": { "text": "Craster, 65 Alfred Rd", "highlights": [] }, "secondary": { "text": "W2 5EU", "highlights": [0, 1, 3, 5] }, "type": "address.business", "isContainer": false, "countryCode": "GB" }, ... ] ``` ### Need to show more than 100 addresses? There can occasionally be more than 100 addresses in a postcode, and each API request returns a maximum of 100 addresses. If exactly 100 addresses are returned, use `pageFrom` to show the next 100, and so on. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERTKEYHERE&container=V1;W2%205EU;51.521198;-0.196334&maxResults=100&pageFrom=100 ``` ## 3. Retrieve full address details Get the full address by passing `populateIndex=x`, where `x` is the index of the address in the array. So if you’d like to select the first address, pass `populateIndex=0`, or to pick the 5th address, pass `populateIndex=4`, and so on. Optionally pass in `lineFormat` parameters to customise the response format for the address. Make sure you pass the container ID in again from Step 2. **Request** ```http GET https://api.swiftcomplete.com/v1/swiftlookup/?key=INSERTKEYHERE&container=V1;W2%205EU;51.521198;-0.196334&lineFormat0=addressLine1&lineFormat1=addressLine2&lineFormat2=TertiaryLocality,%20SecondaryLocality,%20PrimaryLocality&lineFormat3=POSTCODE&populateIndex=0 ``` The address appears as a new `populatedRecord` object within the address at the index specified by `populateIndex`. You can use `populatedRecord.lines` to obtain the address as specified by `lineFormat` in the request, or use `populatedRecord.label` for the fully formatted postal address. **Response** ```json [ { "primary": { "text": "The Harbour Club, 1 Alfred Rd", "highlights": [] }, "secondary": { "text": "W2 5EU", "highlights": [ 0, 1, 3, 5 ] }, "type": "address.business", "isContainer": false, "geometry": { "centre": { "lat": 51.521198, "lon": -0.196334, "type": "postcode" } }, "populatedRecord": { "lines": [ "The Harbour Club", "1 Alfred Road", "London", "W2 5EU" ], "licenses": [], "label": "The Harbour Club\n1 Alfred Road\nLONDON\nW2 5EU\nUnited Kingdom", "data": { "postalCode": { "text": "W2 5EU", "isFullPostalCode": true, "gb": { "incode": { "text": "5EU" }, "postcodeSector": { "text": "5" }, "postcodeUnit": { "text": "EU" }, "outcode": { "text": "W2" }, "postcodeArea": { "text": "W" }, "postcodeDistrict": { "text": "2" } } }, "business": { "name": { "text": "The Harbour Club" } }, "subBuilding": null, "building": { "name": null, "number": { "text": "1" } }, "road": { "primary": { "text": "Alfred Road" }, "secondary": null }, "poBox": null, "country": { "primary": { "text": "United Kingdom", "iso3166-2": "GB" }, "secondary": null }, "place": { "primary": { "text": "LONDON" }, "secondary": null, "tertiary": null }, "admin": { "stateProvince": null, "stateProvinceAbbreviation": null, "gb": { "county": null, "ceremonialCounty": { "text": "Greater London", "code": null }, "region": { "text": "London", "code": "E12000007" }, "ward": { "text": "Westbourne", "code": "E05013809" }, "district": null, "londonBorough": { "text": "Westminster", "code": "E09000033" }, "innerOuterLondon": { "text": "Inner London", "code": "E13000001" }, "unitaryAuthority": null } } } }, "countryCode": "GB" }, ... ] ``` ### Find out more [Explore the Swiftcomplete website](https://what3words.com/swiftcomplete) Can’t find what you’re looking for, or want to report an issue? [Get in touch here](https://share.hsforms.com/1gonG2sDNQhWIqB3BhKVK7A1p3ix). --- # Swiftcomplete Validate API Section: [Postal Addresses via Swiftcomplete](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete.md) > [Address Validation](https://developer.what3words.com/docs/postal-addresses-via-swiftcomplete/address-validation.md) Source: https://developer.what3words.com/tutorial/swiftcomplete-validate Updated: 2026-11-27 ## 1. Overview The Validate API matches addresses against official address records, normalises formatting, and suggests corrections when the input contains meaningful errors. Detects and validates what3words addresses. If invalid, returns the most likely candidate using proximity to the rest of the address, where available. The response contains three top-level parts: | Part | Description | | --- | --- | | validation | Describes whether the input matched an underlying source record and at which resolution. | | address | The normalised address to use, provided as a single string and split into multiple lines. | | associatedRecords | A list of any records associated with the returned address, such as apartments, suites, departments, or business names. | ## 2. Authentication All requests require an API key passed in the `X-API-Key` header. [Get an API key here](https://www.swiftcomplete.com/account/register/) **Header** ```http X-API-Key: your_api_key_here ``` ## 3. Endpoint **Request** ```http POST https://api.swiftcomplete.com/v1/validate-address/ Content-Type: application/json ``` Request and response bodies are UTF-8 encoded JSON. ## 4. Request Each field is optional, but the request must contain at least one non-empty value in `singleLine`, `companyName`, `line1`, `line2`, `line3`, `tertiaryLocality`, `secondaryLocality`, `primaryLocality`, or `postalCode`. `state`, `stateCode`, `countryName`, and `countryCode` do not satisfy this minimum-input requirement by themselves, but may be included with another qualifying field. If your address data is unstructured, pass the whole address in `singleLine`. If your address data is already structured, pass the components into their respective fields. Do not combine `singleLine` with the structured address fields. When `singleLine` is provided, it takes precedence and the structured fields are ignored. You may still provide `countryCode` to restrict matching to one or more markets. Providing one or more supported country codes restricts matching to those markets and improves accuracy. Separate multiple country codes with commas. It is strongly recommended whenever the relevant market is known. | Field | Type | Description | | --- | --- | --- | | singleLine | string | Freeform, unstructured address string. Example: 10 downing st london sw1a2aa. | | companyName | string | Business or organisation name associated with the address. | | line1 | string | Primary address line. | | line2 | string | Secondary address line. | | line3 | string | Tertiary address line. | | tertiaryLocality | string | Sub-locality, neighbourhood, or village within a larger locality. | | secondaryLocality | string | District, borough, or suburb. | | primaryLocality | string | City or town. | | state | string | State, province, county, region, or other principal administrative area, where applicable. | | stateCode | string | State abbreviation, where applicable. | | postalCode | string | Postal or ZIP code. | | countryName | string | Country name. | | countryCode | string | One or more supported ISO 3166-1 alpha-2 country codes. Separate multiple codes with commas, for example GB,DE. | | what3words | string | A what3words address, eg. ///filled.count.soap | ## 5. Response A response contains validation, address, and associatedRecords. | Field | Type | Description | | --- | --- | --- | | validation | object | The result of matching the input to the underlying source data. | | address | object or null | The normalised address to use. Returned for match and suggestion; null for none. | | associatedRecords | array or null | Records associated with the returned address. null when none exist. | ### `validation` #### `validation.result` `validation.result` is the core result of the operation. Read it first when deciding whether to accept the returned address, ask the user to confirm a suggestion, or ask the user to re-enter the address. | Result | Description | | --- | --- | | match | The input was successfully matched to an official record. | | suggestion | The input matched the underlying source data but changes are large enough to justify seeking user confirmation. | | none | The input could not be matched to an address in the underlying source data. address and validation.resolution will be null. | #### `validation.resolution` `validation.resolution` describes the highest address level matched against the underlying source data. See [**Input preservation**](#input) for how this relates to values returned in `address`. | Resolution | Description | Example of matched source data | | --- | --- | --- | | subPremise | The input matched a specific unit, flat, suite, floor, department, organisation, or other source record within or associated with a building. | HSBC Holdings plc, 8 Canada Square, London, E14 5HQ | | premise | The input matched a specific building or premise. | 10 Downing Street, London, SW1A 2AA | | street | The input matched a street or thoroughfare, but not a specific premise. | Great Russell Street, London, WC1B 3DG | | city | The input matched only a city, town, or locality. | London, United Kingdom | | null | No address level could be matched, or resolution is not applicable. | Returned with validation.result: none. | ### `address` `address` is the normalised address to use when `validation.result` is `match` or `suggestion`. | Field | Type | Description | | --- | --- | --- | | address.singleLine | string | The complete normalised address, formatted as a single display line. | | address.multiLine | object | The same address broken into structured components. | `address.multiLine` contains `companyName`, `line1`, `line2`, `line3`, `tertiaryLocality`, `secondaryLocality`, `primaryLocality`, `state`, `stateCode`, `postalCode`, `countryName`, `countryCode`, and `what3words`. Each field contains the value returned by Swiftcomplete, or `null` where the component does not apply. When `validation.result` is `none`, `address` is `null`. ### `associatedRecords` `associatedRecords` provides a list of any address records associated with the returned address, such as companies, flats, suites, departments. These records can be presented to the end user as optional refinements to the default `address`; they do not change the core validation result. When records are returned, show their `picklistDisplay` values to the user after the base address has been validated or accepted. | Field | Type | Description | | --- | --- | --- | | associatedRecords\[\].picklistDisplay | string | Consumer-facing text to display in a pick list. Do not use this value directly as an address field. | | associatedRecords\[\].overrides | object | The replacement values to apply to the default address if this record is selected. | | associatedRecords\[\].overrides.singleLine | string | The value that should replace address.singleLine if the integration uses the single-line format. | | associatedRecords\[\].overrides.multiLine | object | A partial address object containing each structured field that should replace the corresponding field in address.multiLine. It can contain any multi-line address field. | #### Applying an associated record Do not change the default `address` unless the user selects an associated record. When a record is selected: 1. If your integration uses `address.singleLine`, replace it with `associatedRecords[n].overrides.singleLine`. 2. If your integration uses `address.multiLine`, replace each field present in `associatedRecords[n].overrides.multiLine` with the returned value. 3. Leave every address field not included in `overrides.multiLine` unchanged. When no associated records are available, `associatedRecords` is `null`. ## 6. Input preservation Swiftcomplete validates submitted address data against underlying source records. It may also preserve important input that is not present in the matched record but is still useful for delivery or recipient identification. Examples include: - recipient or attention details, such as `FAO Reception Desk`; - department names; - informal or newly registered business names; and - delivery or entrance instructions, such as `Use side entrance` or `Deliver to loading bay`. Swiftcomplete determines whether input should be preserved and where it should appear in the returned address. Integrations should use `address.singleLine` or `address.multiLine` as returned and should not attempt to identify or reposition preserved input. ### Relationship with `validation.resolution` `validation.resolution` describes the highest address level matched against the underlying source data. It does not describe the resolution of `address`. Preserved input can therefore make the returned address more detailed than the matched source record. A populated field is not evidence that the field itself was validated. Always use: - `validation.resolution` to assess match precision; and - `address` as the normalised address to display, store, or submit. ### Worked example The request and response below show Swiftcomplete matching the university at `subPremise` level while preserving an unvalidated department name: **JSON** ```json { "singleLine": "Department of Geospatial Engineering, King's College London, Strand, London, WC2R 2LS, United Kingdom", "countryCode": "GB" } ``` **Response** ```json { "validation": { "result": "match", "resolution": "subPremise" }, "address": { "singleLine": "Department Of Geospatial Engineering, Kings College London, Strand, London, WC2R 2LS, United Kingdom", "multiLine": { "companyName": "Kings College London", "line1": "Department Of Geospatial Engineering", "line2": "Strand", "line3": null, "tertiaryLocality": null, "secondaryLocality": null, "primaryLocality": "London", "state": "Greater London", "stateCode": null, "postalCode": "WC2R 2LS", "countryName": "United Kingdom", "countryCode": "GB" } }, "associatedRecords": null } ``` `Kings College London` is matched against the underlying source data and returned in `companyName`. `Department Of Geospatial Engineering` is not part of the matched source record, but is preserved in `line1`. The authoritative match level remains `subPremise`. ## 7. Response handling guidance | Result | Associated records | Recommended handling | | --- | --- | --- | | match | null | Use address as the normalised address, subject to your required validation.resolution. | | match | Array | Use address as the default. Optionally show each picklistDisplay as a more specific choice and apply its overrides if selected. | | suggestion | null | Present address as the corrected address and ask the user to confirm it before replacing their original address. | | suggestion | Array | Present address as the corrected default. If accepted, optionally show associated records and apply an override only if selected. | | none | null | Ask the user to review, edit, or re-enter the address. | ## 8. Markets The Validate API currently supports the following markets: | Market | Country code | | --- | --- | | United Kingdom | GB | | Germany | DE | ## 9. Examples ### `match` **JSON** ```json { "singleLine": "40 Sisters Avenue, London, SW11 5SQ, United Kingdom", "countryCode": "GB" } ``` **Response** ```json { "validation": { "result": "match", "resolution": "premise" }, "address": { "singleLine": "40 Sisters Avenue, London, SW11 5SQ, United Kingdom", "multiLine": { "companyName": null, "line1": "40 Sisters Avenue", "line2": null, "line3": null, "tertiaryLocality": null, "secondaryLocality": null, "primaryLocality": "London", "state": "Greater London", "stateCode": null, "postalCode": "SW11 5SQ", "countryName": "United Kingdom", "countryCode": "GB" } }, "associatedRecords": null } ``` ### `match` with `associatedRecords` **JSON** ```json { "singleLine": "242 acklam road w105jj", "countryCode": "GB" } ``` **Response** ```json { "validation": { "result": "match", "resolution": "premise" }, "address": { "singleLine": "242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": null, "line1": "242 Acklam Road", "line2": null, "line3": null, "tertiaryLocality": null, "secondaryLocality": null, "primaryLocality": "London", "state": "Greater London", "stateCode": null, "postalCode": "W10 5JJ", "countryName": "United Kingdom", "countryCode": "GB" } }, "associatedRecords": [ { "picklistDisplay": "A P D A London Ltd", "overrides": { "singleLine": "A P D A London Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "A P D A London Ltd" } } }, { "picklistDisplay": "Barton Engineers", "overrides": { "singleLine": "Barton Engineers, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Barton Engineers" } } }, { "picklistDisplay": "Bloobloom", "overrides": { "singleLine": "Bloobloom, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Bloobloom" } } }, { "picklistDisplay": "Buchanan Advertising (UK) Ltd", "overrides": { "singleLine": "Buchanan Advertising (UK) Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Buchanan Advertising (UK) Ltd" } } }, { "picklistDisplay": "Frescobol", "overrides": { "singleLine": "Frescobol, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Frescobol" } } }, { "picklistDisplay": "Fusion One International Ltd", "overrides": { "singleLine": "Fusion One International Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Fusion One International Ltd" } } }, { "picklistDisplay": "Goodwood Contractors Ltd", "overrides": { "singleLine": "Goodwood Contractors Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Goodwood Contractors Ltd" } } }, { "picklistDisplay": "Indie Bay Snacks", "overrides": { "singleLine": "Indie Bay Snacks, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Indie Bay Snacks" } } }, { "picklistDisplay": "Intelligent Imaging Innovations Ltd", "overrides": { "singleLine": "Intelligent Imaging Innovations Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Intelligent Imaging Innovations Ltd" } } }, { "picklistDisplay": "Ottoman Hands Ltd", "overrides": { "singleLine": "Ottoman Hands Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Ottoman Hands Ltd" } } }, { "picklistDisplay": "Paymentsense", "overrides": { "singleLine": "Paymentsense, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Paymentsense" } } }, { "picklistDisplay": "Perfect Storm Media Ltd", "overrides": { "singleLine": "Perfect Storm Media Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Perfect Storm Media Ltd" } } }, { "picklistDisplay": "Phycobloom Ltd", "overrides": { "singleLine": "Phycobloom Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Phycobloom Ltd" } } }, { "picklistDisplay": "Powder Bowl Trading Ltd", "overrides": { "singleLine": "Powder Bowl Trading Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Powder Bowl Trading Ltd" } } }, { "picklistDisplay": "Rachel Nevin Communications", "overrides": { "singleLine": "Rachel Nevin Communications, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Rachel Nevin Communications" } } }, { "picklistDisplay": "Rigby & Marchant Ltd", "overrides": { "singleLine": "Rigby & Marchant Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Rigby & Marchant Ltd" } } }, { "picklistDisplay": "Sophie Harley London", "overrides": { "singleLine": "Sophie Harley London, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Sophie Harley London" } } }, { "picklistDisplay": "Twotwentyseven", "overrides": { "singleLine": "Twotwentyseven, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Twotwentyseven" } } }, { "picklistDisplay": "V M V Studio", "overrides": { "singleLine": "V M V Studio, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "V M V Studio" } } }, { "picklistDisplay": "Westbourne Studios", "overrides": { "singleLine": "Westbourne Studios, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Westbourne Studios" } } }, { "picklistDisplay": "Workspace Management", "overrides": { "singleLine": "Workspace Management, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Workspace Management" } } }, { "picklistDisplay": "Yousoft Ltd", "overrides": { "singleLine": "Yousoft Ltd, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Yousoft Ltd" } } }, { "picklistDisplay": "Zalacain Wayfinding", "overrides": { "singleLine": "Zalacain Wayfinding, 242 Acklam Road, London, W10 5JJ, United Kingdom", "multiLine": { "companyName": "Zalacain Wayfinding" } } } ] } ``` ### `suggestion` with `associatedRecords` and an attention line The attention line is preserved in `line1`. Each associated-record override adds the selected company while leaving the attention line in place. **JSON** ```json { "singleLine": "FAO Accounts Payable, 65 Alfred Rod, London, W2 5EU, United Kingdom", "countryCode": "GB" } ``` **Response** ```json { "validation": { "result": "suggestion", "resolution": "premise" }, "address": { "singleLine": "FAO Accounts Payable, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": null, "line1": "FAO Accounts Payable", "line2": "65 Alfred Road", "line3": null, "tertiaryLocality": null, "secondaryLocality": null, "primaryLocality": "London", "state": "Greater London", "stateCode": null, "postalCode": "W2 5EU", "countryName": "United Kingdom", "countryCode": "GB" } }, "associatedRecords": [ { "picklistDisplay": "Blaiz Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Blaiz Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Blaiz Ltd" } } }, { "picklistDisplay": "Carnot Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Carnot Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Carnot Ltd" } } }, { "picklistDisplay": "Craster Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Craster Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Craster Ltd" } } }, { "picklistDisplay": "Daisy Global Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Daisy Global Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Daisy Global Ltd" } } }, { "picklistDisplay": "Davina Combe Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Davina Combe Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Davina Combe Ltd" } } }, { "picklistDisplay": "Great Western Studios", "overrides": { "singleLine": "FAO Accounts Payable, Great Western Studios, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Great Western Studios" } } }, { "picklistDisplay": "Italspirits Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Italspirits Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Italspirits Ltd" } } }, { "picklistDisplay": "Moxon Architects Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Moxon Architects Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Moxon Architects Ltd" } } }, { "picklistDisplay": "Nishura Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Nishura Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Nishura Ltd" } } }, { "picklistDisplay": "Obatan Llc", "overrides": { "singleLine": "FAO Accounts Payable, Obatan Llc, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Obatan Llc" } } }, { "picklistDisplay": "R F Gill & Associates", "overrides": { "singleLine": "FAO Accounts Payable, R F Gill & Associates, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "R F Gill & Associates" } } }, { "picklistDisplay": "Run For The Hills", "overrides": { "singleLine": "FAO Accounts Payable, Run For The Hills, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Run For The Hills" } } }, { "picklistDisplay": "Solid Floor Ltd", "overrides": { "singleLine": "FAO Accounts Payable, Solid Floor Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Solid Floor Ltd" } } }, { "picklistDisplay": "Stephen Fletcher Architects", "overrides": { "singleLine": "FAO Accounts Payable, Stephen Fletcher Architects, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "Stephen Fletcher Architects" } } }, { "picklistDisplay": "What3words Ltd", "overrides": { "singleLine": "FAO Accounts Payable, What3words Ltd, 65 Alfred Road, London, W2 5EU, United Kingdom", "multiLine": { "companyName": "What3words Ltd" } } } ] } ``` ### `none` **JSON** ```json { "singleLine": "This is not a real address", "countryCode": "GB" } ``` **Response** ```json { "validation": { "result": "none", "resolution": null }, "address": null, "associatedRecords": null } ``` ## 10. Errors | HTTP code | Meaning | What to do | | --- | --- | --- | | 400 | The request contains malformed JSON or fails request validation, such as when no non-empty address component is provided. | Correct the request. Do not retry it unchanged. | | 401 | The X-API-Key header is missing or contains an invalid key. | Check the key and header name. | | 429 | Too many requests. | Back off and retry after the period indicated in Retry-After. | | 500 | An unexpected error occurred on the server. | Retry with backoff. If the problem persists, contact support. | --- # Using the Android Map Component Displaying the what3words grid and marker on Google Maps or Mapbox new or existing map applications. Topics: Android, Mobile App Section: [Display Map](https://developer.what3words.com/docs/display-map.md) Source: https://developer.what3words.com/tutorial/using-the-android-map-component Updated: 2026-11-27 ### Tutorial ### Introduction The easiest way to add what3words to your technology is to use one of our components. We have several components available for JavaScript, iOS, and Android which require minimal development to integrate. The what3words Android Map Component provides a straightforward way to add a what3words grid on top of Google Maps or Mapbox map, displaying the what3words address and marker on the map for a selected 3 word address. This tutorial steps through how our Android Map Component can be added to a new project that requires creating a map from scratch or to an existing map: - If you are creating a new map from scratch using our Map component then we recommend using our map fragments: [W3WGoogleMapFragment](https://github.com/what3words/w3w-android-map-components/tree/main?tab=readme-ov-file#enable-what3words-features-in-an-new-google-maps-app-using-w3wgooglemapfragment) or [W3WMapboxMapFragment](https://github.com/what3words/w3w-android-map-components/tree/main?tab=readme-ov-file#enable-what3words-features-in-an-new-mapbox-maps-app-using-w3wmapboxmapfragment) if the map provider is respectively Google Maps or MapBox; - If you want to add what3words to an existing map then we recommend using our map wrappers: [W3WGoogleMapsWrapper](https://github.com/what3words/w3w-android-map-components/tree/main?tab=readme-ov-file#enable-what3words-features-in-an-existing-google-maps-app-using-W3WGoogleMapsWrapper) or [W3WMapBoxWrapper](https://github.com/what3words/w3w-android-map-components/tree/main?tab=readme-ov-file#enable-what3words-features-in-an-existing-mapbox-maps-app-using-w3wmapboxwrapper) if the map provider is respectively Google Maps or MapBox. Follow the steps below to select your chosen way to integrate our what3words map component into your project. GitHub repo: [https://github.com/what3words/w3w-android-map-components](https://github.com/what3words/w3w-android-map-components) ### Quickstart The Android Map Component requires just a few lines of code to be added to an android application to create a map with what3words functionality. - Replace `YOUR-API-KEY` with your what3words API key and any `map provider API key` that you would like to use on your project, e.g. GOOGLE MAPS or MAPBOX API keys. - It is compatible with applications that are built using `Android SDK 23 or higher`. Here are listed some sample apps that can be used: - [Google Maps Sample App](https://github.com/what3words/w3w-android-samples/tree/main/maps-googlemaps-sample) - [MapBox Sample App](https://github.com/what3words/w3w-android-samples/tree/main/mapbox-sample) ![android\_map\_component\_final\_result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b8d74fd2e43b389621e08ff4907dc94861569bed3f724919b7d926d93c561170.w1600.webp) **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) // add AutoSuggest Component to the Map Component binding.autosuggest.apiKey("YOUR_API_KEY_HERE") .returnCoordinates(true) .onSuggestionSelected { square -> if (square != null) { map.selectAtSquare(square) } else { map.unselect() } } } override fun onMapReady(map: W3WMap) { // add this to integrate the AutoSuggest Component this.map = map map.addMarkerAtCoordinates(lat: 51.5209894, lng: -0.1956749, markerColor = W3WMarkerColor.YELLOW) map.onSquareSelected( onSuccess = { square, _, _ -> // add this to bind the AutoSuggest Component to the Map Component binding.autosuggest.display(square) Snackbar.make(binding.root, square.words, Snackbar.LENGTH_INDEFINITE).show() } ) } } ``` ### Step by Step ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Get Google API key You also will need to get a [Google API key](https://developers.google.com/maps/documentation/places/web-service/get-api-key#console) or [Mapbox API key](https://docs.mapbox.com/android/maps/guides/install/) for your chosen map provider. ## 3. Add the dependency Open your project in Android Studio Open up your module-level `build.gradle` file. Make sure that your project’s `minSdkVersion` is at API 23 or higher. **Kotlin** ```kotlin android { ... defaultConfig { minSdkVersion 23 } } ``` Under dependencies, add a new build rule for the latest what3words Android Map Component. **Kotlin** ```kotlin dependencies { implementation 'com.what3words:w3w-android-map-components:1.0.1' } ``` Add this snippet to the `build.gradle` file (app level) **Kotlin** ```kotlin compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ``` Add also the following `proguard rules` **Kotlin** ```kotlin -keep class com.what3words.javawrapper.request.* { *; } -keep class com.what3words.javawrapper.response.* { *; } ``` Because you’ve edited your Gradle files, Android Studio will ask you whether you want to sync the Gradle files. You can sync now. To perform network operations in your application, your manifest `AndroidManifest.xml` file must include the following permissions: **Kotlin** ```kotlin ... ``` ## 4. New app with Google Maps If you are starting a new project and you are creating a new app from scratch, we recommend using our `W3WGoogleMapFragment`. The main advantage is that all the required events to draw the grid are done under the hood, resulting in less boilerplate code and still having access to Google Maps to apply standard customisation (i.e. map types, etc.). To use the what3words Google Maps Fragment in your app, first, follow the quick start tutorial on the [Google developer portal here](https://developers.google.com/maps/documentation/android-sdk/start). This ensures that Google Maps can be used with the what3words Map Fragment. After a successful Google Maps run, you can start using our `W3WGoogleMapFragment` following these steps. Add the following line of code to your `activity_main.xml` file within the `res` folder of your application: **Kotlin** ```kotlin ``` Add what3words Google Maps Fragment to your `MapsActivity.kt` file. You will need to add your [what3words API key](https://what3words.com/select-plan?referrer=/tutorial/using-the-web-map-component) here to display the Map Fragment. **Note:** After adding this snippet run your application and you will display Google Maps with the what3words grid on top of it. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { } } ``` ### Customise the Map Component The Map Component can be customised using some what3words properties. Here is shown an example where you can add a simple market to your Map with a specified what3words address ![customise\_map\_component](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/c2c63a3106c0e2de686c01f14f0d55211e61c977974520f57f3b34fd45be5083.w1600.webp) **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { // set a marker with a specified what3words address map.addMarkerAtWords("filled.count.soap") } } ``` You can set a language to get all the 3wa in the desired language (default English) by adding this line of code within the `onMapReady` function: **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { //set language to get all the what3words addresses in the desired language (default english) map.setLanguage("en") map.addMarkerAtWords("filled.count.soap") } } ``` You can make the map marker change color or their zoom level or add a list of specified what3words addresses. **Note:** the default colour of the marker is the brand’s red. ![multiple\_markers](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/3630b63f53b7a4e7926971dbd33c87dd10e5649ff7334311f06ac1fc4e22747d.w1600.webp) **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { map.setLanguage("en") // an example on how to add a blue marker on a valid 3 word address and move the map view(camera) to the added marker map.addMarkerAtWords( listOf("filled.count.soap","stop.vibrates.looked"), markerColor = W3WMarkerColor.TURQUOISE, zoomOption = W3WZoomOption.CENTER_AND_ZOOM ) } } ``` You can add a map marker using coordinates instead of the what3words address. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { // set a marker using coordinates map.addMarkerAtCoordinates(51.5209894, -0.1956749, markerColor = W3WMarkerColor.YELLOW) } } ``` ### Access the map instance To access the Google map instance inside the Google Map Fragment you will need to add this line of code to your application: **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { map.addMarkerAtCoordinates(51.5209894, -0.1956749, markerColor = W3WMarkerColor.YELLOW) //if you want to access the google map instance inside W3WGoogleMapFragment do the following (map as? W3WGoogleMapFragment.Map)?.googleMap()?.let { googleMap -> googleMap.mapType = GoogleMap.MAP_TYPE_NORMAL } } } ``` Here is what your application should look like: ![marker\_with\_coordinates](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/6105936b433c0c3ffc91447c24a9bdcdb76ffcfe7b5a8bb50eac7a6e8e20e405.w1600.webp) ### Listening for events Now when you click on the map marker you can display the what3words address if you trigger the `onSquareSelected` event. **Note:** Only one square can be selected at the same time, just like our core apps. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) } override fun onMapReady(map: W3WMap) { map.addMarkerAtCoordinates(51.5209894, -0.1956749, markerColor = W3WMarkerColor.YELLOW) // set up a a callback for when an square in the map is selected map.onSquareSelected( onSuccess = { square, _, _ -> Snackbar.make(binding.root, square.words, Snackbar.LENGTH_INDEFINITE).show() } ) } } ``` ### Use AutoSuggest Component in the Search field If you want to add the AutoSuggest Component to the search box on top of the Map Fragment, you need to update the `activity_maps.xml` to both have the what3words components, the `W3WAutosuggestEditText` (for the AutoSuggest Component) and `W3WGoogleMapFragment` (for the Map Component). **Kotlin** ```kotlin ``` Now you need to set up the what3words AutoSuggest component with your API KEY to return coordinates so you can integrate it into the Map component without extra API calls. **Note:** As it is set up on our core app, you will be able to set that up when a suggestion is selected from the AutoSuggest Component it will select a what3words address on the map. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), W3WGoogleMapFragment.OnMapReadyCallback { private lateinit var binding: ActivityMapsBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMapsBinding.inflate(layoutInflater) setContentView(binding.root) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as W3WGoogleMapFragment mapFragment.apiKey("YOUR_API_KEY_HERE", this) // add AutoSuggest Component to the Map Component binding.autosuggest.apiKey("YOUR_API_KEY_HERE") .returnCoordinates(true) .onSuggestionSelected { square -> if (square != null) { map.selectAtSquare(square) } else { map.unselect() } } } override fun onMapReady(map: W3WMap) { // add this to integrate the AutoSuggest Component this.map = map map.addMarkerAtCoordinates(lat: 51.5209894, lng: -0.1956749, markerColor = W3WMarkerColor.YELLOW) map.onSquareSelected( onSuccess = { square, _, _ -> // add this to bind the AutoSuggest Component to the Map Component binding.autosuggest.display(square) Snackbar.make(binding.root, square.words, Snackbar.LENGTH_INDEFINITE).show() } ) } } ``` Here is what your application should look like: ![android\_map\_component\_final\_result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/b8d74fd2e43b389621e08ff4907dc94861569bed3f724919b7d926d93c561170.w1600.webp) ### Select Map Provider Our Map Component can support different map service providers, such as Google Maps and Mapbox. By simply replacing the Google Map fragment used in the examples above `W3WGoogleMapFragment` with the Mapbox Map Fragment `W3WMapboxMapFragment` in your `activity_main.xml` and `MapsActivity.kt` files. **Note:** To use the what3words Mapbox Maps Fragment in your app, first follow the quick start tutorial on the [Mapbox developer portal here](https://docs.mapbox.com/android/navigation/guides/get-started/install/). This ensures that Mapbox Maps can be used with the what3words Fragment. ## 5. Existing app with Google Maps If you already have an application we recommend using our what3words Google Map Wrapper in your app. To get started first follow the quick start tutorial on the [Google developer portal here](https://developers.google.com/maps/documentation/android-sdk/start). This ensures that Google Maps can be used with the what3words Map Wrapper. After a successful Google Maps run, you can start using our `W3WGoogleMapWrapper` following these steps: Add the following line of code to your `activity_main.xml` file within the `res` folder of your application: **Kotlin** ```kotlin ``` Add what3words Google Maps Wrapper to your `MapsActivity.kt` file. You will need to add your what3words API key here to display the Map Wrapper. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), OnMapReadyCallback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onMapReady(map: GoogleMap) { val apiWrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val googleMapsWrapper = W3WGoogleMapsWrapper( this, map, apiWrapper ) } } ``` After adding this snippet run your application and you will display Google Maps with the what3words grid on top of it. ### Customise the Map Component The Map Component can be customised using some what3words properties. Here is shown an example where you can - add a simple market to your Map with a specified what3words address; - set your own zoom level; - set the language of the what3words addresses; **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), OnMapReadyCallback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onMapReady(map: GoogleMap) { val apiWrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val googleMapsWrapper = W3WGoogleMapsWrapper( this, map, apiWrapper ).setLanguage("en") // set the language of the what3words addresses //show an example on how to add a blue marker //on a valid 3 word address and move the camera to the added marker. googleMapsWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> val cameraPosition = CameraPosition.Builder() .target(LatLng(marker.coordinates.lat, marker.coordinates.lng)) .zoom(19f) .build() p0.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) }, { error -> Log.e("MainActivity", "${error.message}") } ) } } ``` ### Listening for events Using an event listener, it is possible to fire other functionality in an app when something changes in the Map Component. For example, it is possible to listen for when a square on the grid map has been selected by the users or to listen for when new coordinates have been returned and pan/zoom a map to the location. **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), OnMapReadyCallback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onMapReady(map: GoogleMap) { val apiWrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val googleMapsWrapper = W3WGoogleMapsWrapper( this, map, apiWrapper ) //example how to add a blue marker on a valid 3 word address and move camera to the added marker. googleMapsWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> val cameraPosition = CameraPosition.Builder() .target(LatLng(marker.coordinates.lat, marker.coordinates.lng)) .zoom(19f) .build() p0.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) }, { error -> Log.e("MainActivity", "${error.message}") } ) //Using an event listener → click on existing what3words markers on the map. w3wMapsWrapper.onMarkerClicked { marker -> Log.i("MainActivity", "clicked: ${marker.words}") } //REQUIRED map.setOnCameraIdleListener { //existing code here... //needed to draw the 3x3m grid on the map googleMapsWrapper.updateMap() } //REQUIRED map.setOnCameraMoveListener { //existing code here... //needed to draw the 3x3m grid on the map googleMapsWrapper.updateMove() } } } ``` ### Set coordinates per selected marker Here is an example of how to select a 3x3m what3words square using coordinates: **Kotlin** ```kotlin class MainActivity : AppCompatActivity(), OnMapReadyCallback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val mapFragment = supportFragmentManager .findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onMapReady(map: GoogleMap) { val apiWrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val googleMapsWrapper = W3WGoogleMapsWrapper( this, map, apiWrapper ) … map.setOnMapClickListener { latLng -> //existing code here... //example of how to select a 3x3m what3words square using lat/lng googleMapsWrapper.selectAtCoordinates(latLng.latitude, latLng.longitude) } } } ``` ## 6. Existing app with Mapbox If you already have an application we recommend using our what3words Mapbox Wrapper in your app. To get started first follow the quick start tutorial on the [Mapbox developer portal here](https://docs.mapbox.com/android/navigation/guides/get-started/install/). This ensures that Mapbox can be used with the what3words Map Wrapper. After a successful Google Maps run, you can start using our `W3WMapboxWrapper` following these steps. Add the following line of code to your `activity_main.xml` file within the `res` folder of your application: **Kotlin** ```kotlin ``` Add what3words Mapbox Wrapper to your `MapsActivity.kt` file. You will need to add your what3words API key here to display the Map Wrapper. **Kotlin** ```kotlin class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) binding.mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) setContentView(binding.root) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val mapboxWrapper = W3WMapBoxWrapper( this, binding.mapView.getMapboxMap(), wrapper, ) } } ``` After adding this snippet run your application and you will display the Mapbox with the what3words grid on top of it. ### Customise the Map Component The Map Component can be customised using some what3words properties. Here is shown an example where you can - add a simple market to your Map with a specified what3words address; - set your own zoom level; - set the language of the what3words addresses; **Kotlin** ```kotlin class MainActivity: AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) binding.mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) setContentView(binding.root) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val mapboxWrapper = W3WMapBoxWrapper( this, binding.mapView.getMapboxMap(), wrapper, ).setLanguage("en") // set the language of the what3words addresses //show an example on how to add a blue marker //on a valid 3 word address and move the camera to the added marker. mapboxWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> }, { error -> Log.e("MainActivity", "${error.message}") } ) } } ``` ### Listening for events Using an event listener, it is possible to fire other functionality in an app when something changes in the Map Component. For example, it is possible to listen for when a square on the grid map has been selected by the users or to listen for when new coordinates have been returned and pan/zoom a map to the location. **Kotlin** ```kotlin class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) binding.mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) setContentView(binding.root) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val mapboxWrapper = W3WMapBoxWrapper( this, binding.mapView.getMapboxMap(), wrapper, ).setLanguage("en") // set the language of the what3words addresses //show an example on how to add a blue marker //on a valid 3 word address and move the camera to the added marker. mapboxWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> }, { error -> Log.e("MainActivity", "${error.message}") } ) //Using an event listener → click on existing what3words markers on the map. mapboxWrapper.onMarkerClicked { Log.i("MainActivity", "clicked: ${it.words}") } //REQUIRED binding.mapView.getMapboxMap().addOnMapIdleListener { //existing code here... //needed to draw the 3x3m grid on the map mapboxWrapper.updateMap() } //REQUIRED binding.mapView.getMapboxMap().addOnCameraChangeListener { //existing code here... //needed to draw the 3x3m grid on the map mapboxWrapper.updateMove() } } } ``` ### Set coordinates per selected marker Here is an example of how to select a 3x3m what3words square using coordinates: **Kotlin** ```kotlin class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) binding.mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) setContentView(binding.root) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val mapboxWrapper = W3WMapBoxWrapper( this, binding.mapView.getMapboxMap(), wrapper, ).setLanguage("en") // set the language of the what3words addresses //show an example on how to add a blue marker //on a valid 3 word address and move the camera to the added marker. mapboxWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> }, { error -> Log.e("MainActivity", "${error.message}") } ) ... binding.mapView.getMapboxMap().addOnMapClickListener { latLng -> //existing code here... //example of how to select a 3x3m what3words square using lat/lng mapboxWrapper.selectAtCoordinates(latLng.latitude(), latLng.longitude()) true } } } ``` ## 7. Configuring for use with API server If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server by adding this line of code to the Map Component: **Kotlin** ```kotlin val wrapper = What3WordsV3("YOUR_API_KEY_HERE", "https://api.yourserver.com", this) ``` ## 8. Use library with Jetpack Compose Both Google Maps and Mapbox Wrapper and Fragment work with Jetpack Compose using `AndroidView` and `AndroidViewBinding`, these modules are all available in our [GitHub repository](https://github.com/what3words/w3w-android-samples/) as examples of usage of our `w3w-android-map-components` library in a Jetpack Compose app. ## 9. Map Component Functions | Method Name | Description | Example | | --- | --- | --- | | addMarkerAtCoordinates | This method allow you to add a marker/square to the map defined by the latitude and longitude provided. | addMarkerAtCoordinates(49.180803, -8.001330, { marker }, { error }) or add multiple Coordinates to the map: addMarkerAtCoordinates(listOf(Pair(49.180803, -8.001330), Pair(50.180803, -8.001330)), { markers }, { error }) Example: key=Your-API-Key | | addMarkerAtSuggestion | This method allow you to add a marker/square to the map after getting the what3words suggestion from our W3WAutosuggestEditText allowing easy integration between both components autosuggest and maps. | addMarkerAtSuggestion(suggestion, markerColor.RED, { marker }, { error }) or add multiple suggestions to the map: addMarkerAtSuggestion(suggestions, markerColor.RED, { markers }, { error }) | | addMarkerAtWords | This method allow you to add a marker/square to the map if the parameter is valid what3words address, e.g. filled.count.soap. If it's not valid, onError will be called returning APIResponse.What3WordsError.BAD\_WORDS. | addMarkerAtWords("filled.count.soap"), markerColor.RED, { marker }, { error }) or add multiple 3 word addresses to the map: addMarkerAtWords(listOf("filled.count.soap", "index.home.raft"), markerColor.RED, { markers }, { error }) | | findMarkerByCoordinates | findMarkerByCoordinates This method allow you to find a marker added to the map (returns null if no marker is added on the specified coordinates). | val marker = findMarkerByCoordinates(50.180803, -8.001330) | | getAllMarkers | This method allow you to get all added markers from the map. | val markers = getAllMarkers() | | getSelectedMarker | This method allow you to return a selected marker from the map. | val selected\_markers = getSelectedMarker() | | gridEnabled | This method allow you to enalbe the grid overlay over the map with all 3mx3m squares on the visible map bounds, enabled by default. | gridEnabled(true) | | handleZoomOption | \| handleZoomOption \| This method allow you to define the zoom options. \| handleZoomOption(latLng: LatLng, zoomOption: W3WZoomOption) \| | handleZoomOption(latLng: LatLng, zoomOption: W3WZoomOption) | | removeAllMarkers | This method allow you to remove all markers added to the map. | removeAllMarkers() | | removeMarkerAtCoordinates | This method allow you to remove a marker defined by coordinates from the map. | removeMarkerAtCoordinates(50.180803, -8.001330) or remove multiple markers at coordinates from the map: removeMarkerAtCoordinates(listOf(Pair(49.180803, -8.001330), Pair(50.180803, -8.001330)) | | removeMarkerAtSuggestion | removeMarkerAtSuggestion This method allow you to remove a marker defined by a what3words suggestion from the map. | removeMarkerAtSuggestion(suggestion) or remove multiple suggestions: removeMarkerAtSuggestion(suggestions) | | removeMarkerAtWords | This method allow you to remove a marker at what3words address from the map. | removeMarkerAtWords("filled.count.soap") or remove multiple markers at 3 word adresses from the map: removeMarkerAtWords(listOf("filled.count.soap", "index.home.raft")) | | selectAtCoordinates | This method allow you to set coordinates for a selected marker on the map. It can only have one selected marker at the time. | selectAtCoordinates(50.180803, -8.001330, { selectedMarker }, { error } | | selectAtSquare | This method allow you to set square for a selected marker on the map. It can only have one selected marker at the time. | selectAtSquare(square: SuggestionWithCoordinates, zoomOption: W3WZoomOption, onSuccess: Consumer?, onError: Consumer?) {} | | selectAtSuggestion | This method allow you to set suggestion for a selected marker on the map. It can only have one selected marker at the time. | selectAtSuggestion(suggestion, { selected marker }, { error }) | | selectAtWords | This method allow you to set 3 word address for a selected marker on the map. It can only have one selected marker at the time. | selectAtWords("filled.count.soap", { selectedMarker }, { error }) | | setGridColor | This method allow you to set a different color to the Grid when the background mode is dark or light. To be noted that map providers have different Dark/Light modes settings i.e: GoogleMaps sets dark mode using JSON styles but Mapbox has dark mode as a MapType. \[GridColor.AUTO\] - Will leave up to the library to decide which Grid color and selected square color to use to match some specific map types, i.e: use \[GridColor.DARK\] on normal map types, \[GridColor.LIGHT\] on Satellite and Traffic map types. \[GridColor.LIGHT\] - Will force grid and selected square color to be light. \[GridColor.DARK\] - Will force grid and selected square color to be dark. | setGridColor(gridColor: GridColor.LIGHT) | | setLanguage | This method allow you to set the default language for all the calls that the map makes to the API. The parameter should be a supported what3words address language as an ISO 639-1 2 letter code. Defaults to en (English). | setLanguage("en") | | unselect | This method allow you to remove the selected marker from the map. | unselect() | | updateMap | This method allow you to refresh the grid bounds and draw the grid. This method should be called on GoogleMap.setOnCameraIdleListener or MapboxMap.addOnMapIdleListener. Enabled is set to true (default)\* | updateMap()\* | | updateMove | This method allow you to swap from markers to squares and show/hide grid when zoom goes higher or lower than the zoom level threshold. This method should be called on GoogleMap.setOnCameraMoveListener or MapboxMap.addOnCameraChangeListener. Enabled is set to true (default)\* | updateMove()\* | ## 10. Events | Event | Description | Example | | --- | --- | --- | | onMarkerClicked | This method allow you to set up a callback for when an existing marker is clicked on the map. | onMarkerClicked { marker } | | onSquareSelected | This method allow you to set up a callback for when a square is selected either by clicking on the map or programmatically using any of \[selectAtWords\], \[selectAtCoordinates\], \[selectAtSuggestion\]. | map.onSquareSelected(onSuccess = { square, \_, \_ Snackbar.make(binding.root, square.words, Snackbar.LENGTH\_INDEFINITE).show()}) | ### Listening for events Using an event listener, it is possible to fire other functionality in an app when something changes in the Map Component. For example, when you click on the map marker you can display the what3words address if you trigger the `onSquareSelected` event. **Note:** Only one square can be selected at the same time, just like our core apps. **Kotlin** ```kotlin class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) binding.mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS) setContentView(binding.root) val wrapper = What3WordsV3("YOUR_API_KEY_HERE", this) val mapboxWrapper = W3WMapBoxWrapper( this, binding.mapView.getMapboxMap(), wrapper, ).setLanguage("en") // set the language of the what3words addresses //show an example on how to add a blue marker //on a valid 3 word address and move the camera to the added marker. mapboxWrapper.addMarkerAtWords( "filled.count.soap", markerColor.BLUE, { marker -> }, { error -> Log.e("MainActivity", "${error.message}") } ) //Using an event listener → click on existing what3words markers on the map. mapboxWrapper.onMarkerClicked { Log.i("MainActivity", "clicked: ${it.words}") } //REQUIRED binding.mapView.getMapboxMap().addOnMapIdleListener { //existing code here... //needed to draw the 3x3m grid on the map mapboxWrapper.updateMap() } //REQUIRED binding.mapView.getMapboxMap().addOnCameraChangeListener { //existing code here... //needed to draw the 3x3m grid on the map mapboxWrapper.updateMove() } } } ``` ## 11. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). --- # Using the Android OCR Component what3words OCR Components extract what3words addresses from images or live feeds. Topics: Android, Mobile App Section: [Scanning](https://developer.what3words.com/docs/scanning.md) Source: https://developer.what3words.com/tutorial/using-the-android-ocr-component Updated: 2026-11-27 This guide will help you integrate the what3words OCR Components into your Android application, enabling users to seamlessly scan and interpret what3words addresses from images. The **what3words OCR Components** for Android simplify the process of scanning images to detect and extract what3words addresses using [MLKit V2](https://developers.google.com/ml-kit/vision/text-recognition/v2/android). This library supports multiple sources, including user-uploaded images and live camera feeds. #### Android minimum SDK support [![Generic badge](https://img.shields.io/badge/minSdk-24-green.svg)](https://developer.android.com/about/versions/marshmallow/android-7.0/) #### Features - Detects and extracts what3words addresses from images. - Supports both live and static image scanning. - Flexible APIs to configure scanning preferences. #### GitHub Repository Access the library and detailed documentation on . [Android OCR Component](https://github.com/what3words/w3w-android-ocr-components) #### Demo ![ocr-component-demo](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/749e609ea3d9c79bd9bc7b618b79c412aa22e5154969d9150dedee3a2557d40a.gif) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation ### Step 1: Add the Dependency Include the library in your project’s `build.gradle` file: **Gradle** ```groovy dependencies { // W3W API OCR Lib implementation 'com.what3words.android:ocr-components:' // mlkit implementation "com.google.android.gms:play-services-mlkit-text-recognition:$mlkit_core_version" implementation "com.google.android.gms:play-services-mlkit-text-recognition-chinese:$mlkit_languages_version" implementation "com.google.android.gms:play-services-mlkit-text-recognition-devanagari:$mlkit_languages_version" implementation "com.google.android.gms:play-services-mlkit-text-recognition-japanese:$mlkit_languages_version" implementation "com.google.android.gms:play-services-mlkit-text-recognition-korean:$mlkit_languages_version" } ``` Replace `` with the current version of the library, available in the [GitHub Repository](https://github.com/what3words/w3w-android-ocr-components). ### Step 2: Enable Camera Permissions Update your `AndroidManifest.xml` to request the necessary permissions: **XML** ```xml ``` ## 3. Initialisation Initialize OCR wrapper by MLKit Language **Kotlin** ```kotlin private lateinit var ocrWrapper: W3WOcrWrapper private val dataProvider: What3WordsAndroidWrapper by lazy { What3WordsV3( BuildConfig.W3W_API_KEY, this@ComposeOcrScanPopupSampleActivity ) } ``` **Kotlin** ```kotlin private fun getOcrWrapper(): W3WOcrWrapper { return W3WOcrMLKitWrapper( this, viewModel.selectedMLKitLibrary ) } ``` ## 4. Usage ### Adding a W3WOcrScanner to Your App Integrate the `W3WOcrScanner` component to enable OCR scanning in your app: **Kotlin** ```kotlin W3WOcrScanner( ocrScanManager = ocrScanManager, onDismiss = { // Handle scanner dismissal }, onSuggestionSelected = { suggestion -> // Handle address selection }, onError = { error -> // Handle the error }, ) ``` ### Creating an OcrScanManager The `OcrScanManager` handles the scanner’s state and logic, utilizing `W3WImageDataSource` and `W3WTextDataSource` for scanning and validating addresses. Note: initialize the OCR component with your API key **Kotlin** ```kotlin val w3WImageDataSource = W3WMLKitImageDataSource.create( context = context, recognizerOptions = TextRecognizerOptionsInterface.LATIN ) val w3WTextDataSource = W3WApiTextDataSource.create(context, W3W_API_KEY) val ocrScanManager = rememberOcrScanManager( w3wImageDataSource = w3WImageDataSource, w3wTextDataSource = w3WTextDataSource, ) ``` ### Setup Options You can configure the OCR scanner with either **Online** or **Offline** setups depending on your app’s requirements: 1. **Online Setup**: Use `MLKit` for scanning and `W3WApiTextDataSource` for online validation. 2. **Offline Setup**: Use `W3WTesseractImageDataSource` for offline scanning and `W3WSdkTextDataSource` for offline validation. *(Offline setup requires additional licensing; contact us for details.)* ### Using OcrScannerState for Advanced Control For more granular control, manage the scanner’s state externally with `OcrScannerState`: **Kotlin** ```kotlin val ocrScannerState = remember { OcrScannerState() } W3WOcrScanner( ocrScannerState = ocrScannerState, onError = { error -> // Handle the error }, onDismiss = { // Handle scanner dismissal }, onFrameCaptured = { image -> // Implement detection logic for what3words addresses CompletableDeferred().apply { complete(Unit) // Signal completion when processing is done } }, onSuggestionSelected = { suggestion -> // Handle address selection }, ) ``` ### Styling W3WOcrScanner Customise the appearance of `W3WOcrScanner` by overriding its default strings, colours, and text styles: **Kotlin** ```kotlin W3WOcrScanner( ... scannerStrings = W3WOcrScannerDefaults.defaultStrings( scanStateFoundTitle = stringResource(id = R.string.scan_state_found), ), scannerColors = W3WOcrScannerDefaults.defaultColors( bottomDrawerBackground = W3WTheme.colors.background ), scannerTextStyles = W3WOcrScannerDefaults.defaultTextStyles( stateTextStyle = W3WTheme.typography.headline ), suggestionColors = SuggestionWhat3wordsDefaults.defaultColors( background = W3WTheme.colors.background ), suggestionTextStyles = SuggestionWhat3wordsDefaults.defaultTextStyles( wordsTextStyle = W3WTheme.typography.headline ) ) ``` ### Camera Permission Ensure your app requests camera permissions by adding the following to your `AndroidManifest.xml`: **XML** ```xml ``` ## 5. Migration to v2.0 Upgrading to v2.0 introduces streamlined APIs and integration with the Core Library. ### Breaking Changes - **Core Library Models:** v1.x models replaced with Core Library equivalents; manual migration required. - **W3WOcrMLKitWrapper** **Removed**: Replaced by OcrScanManager for simplified API. - **MLKitOcrScanActivity** **Deprecated**: No longer supported; use Jetpack Compose for activity integration. ### New Features - **OcrScanManager:** Encapsulates scanning logic and state for easier implementation. - **Flexible Data Sources:** Support for online (MLKit + W3WApiTextDataSource) and offline setups. - **Improved Modularity:** Enhanced customisation and integration options for Jetpack Compose. ### Migration Steps 1. Replace the old library version with the latest: **Gradle** ```groovy implementation 'com.what3words:w3w-android-ocr-components:$latest' ``` **Step 2: Replace Deprecated Models** Manually update v1.x models with Core Library equivalents. Refer to the Core Library documentation for details. **Step 3: Use OcrScanManager** Replace W3WOcrMLKitWrapper with the new OcrScanManager for simplified state and logic management: **Kotlin** ```kotlin val ocrScanManager = rememberOcrScanManager( w3wImageDataSource = W3WMLKitImageDataSource.create(context, TextRecognizerOptionsInterface.LATIN), w3wTextDataSource = W3WApiTextDataSource.create(context, W3W_API_KEY), ) W3WOcrScanner(ocrScanManager = ocrScanManager, ...) ``` **Step 4: Remove MLKitOcrScanActivity** MLKitOcrScanActivity has been deprecated. Use Jetpack Compose for standalone scanning activities. ## 6. Sample App The OCR component repository includes a [sample app](https://github.com/what3words/w3w-android-samples/tree/main/ocr-sample) demonstrating the usage of the what3words OCR component. --- # Using the iOS Map Component Displaying the what3words grid and marker on Apple Maps' new or existing map applications. Topics: Swift, Mobile App Section: [Display Map](https://developer.what3words.com/docs/display-map.md) Source: https://developer.what3words.com/tutorial/using-the-ios-map-component Updated: 2026-11-27 ### Tutorial ### Introduction The easiest way to add what3words to your technology is to use one of our components. We have several components available for JavaScript, iOS, and Android which require minimal development to integrate. The what3words iOS Map Component provides a straightforward way to add what3words grid on top of your `MKMapView` or a full-featured map View Controller, displaying the what3words address and marker on the map for a selected  3 word address. This tutorial steps through how our iOS Map Component can be added to a new project that requires creating a map from scratch or to an existing map: - If you are creating a new map from scratch using our Map component then we recommend using our Map Component: W3WMapViewController; - If you want to add what3words to an existing map then we recommend using our Map Helper: W3WMapHelper; - If you are looking for a quick and dirty way to get the what3words functionality into your app we recommend using our Map View: W3WMapView. Follow the steps below to select your chosen way to integrate our what3words map component into your project.< GitHub repo: [https://github.com/what3words/w3w-swift-components](https://github.com/what3words/w3w-swift-components). ### Quickstart The iOS Map Component requires just a few lines of code to be added to an iOS application to create a map with what3words functionality. - Replace YOUR-API-KEY with your what3words API key. - It is compatible with applications that are built using iOS 9.0 or higher. - If you are upgrading from any version 1.x.x, see [this upgrade guide](https://github.com/what3words/w3w-swift-components/blob/master/Documentation/PreviousVersions/UpgradeFromV1.md). Here are listed some sample apps that can be used: - [Map Component Sample](https://github.com/what3words/w3w-swift-samples/tree/main/MapComponent); - [Map Helper Sample](https://github.com/what3words/w3w-swift-samples/tree/main/MapHelper); - [Map Viewer Sample](https://github.com/what3words/w3w-swift-samples/tree/main/MapView) ![ios\_map\_component\_final\_result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/38d78ec51b6ae50999ddc8ed2d5b68252a120254aac18e20557e3adaa5015b74.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") let textField = W3WAutoSuggestTextField(api) self.attach(textField: textField) textField.onSuggestionSelected = { suggestion in self.removeAllMarkers() self.addMarker(at: suggestion, camera: .zoom) } self.onSquareSelected = { square in self.removeAllMarkers() self.addMarker(at: square, camera: .center) testField.set(display: square) } let button = W3WMapTypeButton() attach(view: button, position: .bottomRight) // if there is an error then add it as an alert onError = { error in self.showError(error: error) } } /// set here the showError() function func showError(error: Error) { DispatchQueue.main.async { let alert = UIAlertController(title: "Error", message: String(describing: error), preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Dismiss", style: .cancel, handler: nil)) self.present(alert, animated: true) } } } ``` ### Step by Step ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Add the dependency The iOS Map Component depends on the [what3words swift wrapper](https://github.com/what3words/w3w-swift-wrapper), make sure you will add it as a Package Dependency. Follow these easy steps to add this swift package to your project: 1. From Xcode’s File menu choose `Swift Packages` then `Add Package Dependancy`. 2. The Choose Package Repository window appears. Add [https://github.com/what3words/w3w-swift-components.git](https://github.com/what3words/w3w-swift-components.git) in the search box, and click on `Next`. 3. If you are satisfied with the selected version branch choices, click Next again. 4. You should then be shown as a “Package Product” `W3WSwiftComponents`. Choose `Add Package`. Xcode should now automatically install `w3w-swift-components`, and `w3w-swift-wrapper`. Go to your `ViewController.swift` file and add the following libraries: **Swift** ```swift import W3WSwiftApi import W3WSwiftComponents ``` ## 3. New app using W3WMapViewController If you are starting a new project and you are creating a new app from scratch, we recommend using our W3WMapViewController which is a high-level component that has easy-to-use what3words functionality. Add the following class `W3WMapViewController` to the `ViewController` of your project. You will just have a Map view, no what3words functionality has been added yet at this point. **Swift** ```swift import UIKit import W3WSwiftApi import W3WSwiftComponents class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } } ``` You will need to add your [what3words API key](https://what3words.com/select-plan) here to display the Map Component: **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") } } ``` To refer to the map add the following line of code to your `viewDidLoad()` function below the `api` variable: **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") // set the map view --> self = map self.set(api) } } ``` After adding this snippet run your application and you will display the Apple Maps with the what3words grid on top of it. ![grid\_on\_map](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/edc97cf3b373515b5c8c6a2aaf30299edb8ecc088a78fa78a69d38b493a12fd5.w1600.webp) ### Customise the Map Component The Map Component can be customised using some what3words properties. Here is shown an example where you can add a simple market to your Map with a specified what3words address. It will place an annotation on the map, if the map is zoomed in, it will appear as a square, and if zoomed out it shows as a what3words annotation icon. ![customise\_map\_component](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/ffd6fdbeb45453e3375d4ec1a77fbf8950ede443111d071bfc96caed365915c9.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) // add Marker with a specified what3words address self.addMarker(at: "filled.count.soap") } } ``` You can set a language to get all the 3wa in the desired language (default english) by adding this line of code within the `viewDidLoad` function: **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) // set language to get all the what3words self.set(language: "en") self.addMarker(at: "filled.count.soap") } } ``` You can make the map marker change color or their position on the map or add a list of specified what3words addresses. **Note:** the default colour of the marker is the brand’s red. ![multiple\_markers](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/f2b616408423ad57c020529890931eee2ac85ec75ce5357420e9b0f6dee173fa.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // an example on how to add a blue marker on a valid 3 word address and move the map view to the center with multiple markers on the map self.addMarker(at:["filled.count.soap", "index.home.raft"], camera: .center, color: .blue) } } ``` You could also pass in a what3words suggestion to the `addMarker` property: ![suggestions\_marker](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1a33405638cebe347e3e26300c649668a7ddfcb2ecca0aba64854be84b0e050b.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // an example on how to add a what3words suggestions to the marker api.autosuggest(text: "filled.count.s") { suggestions, error in self.addMarker(at: suggestions) } } } ``` You could also restrict your what3words address suggestions to a desired country using `W3WOptions()` as shown here: ![suggestions\_marker\_with\_clipping](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/1ec427af3cbe06612cdda2c2dae64dc1e7644a393e833edfd7f48f2c328037ea.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // an example on how to add a what3words suggestions to the marker clipped to a desired country let options = W3WOptions().clipToCountry("GB") api.autosuggest(text: "filled.count.s", options: options) { suggestions, error in self.addMarker(at: suggestions) } } } ``` ### Access the map view To access the Map View you can use an accessor variable called `w3wMapView` which is an `MKMapView`. ### Listening for events Now when you click on the map marker you can display the what3words address if you trigger the `onSquareSelected` event. **Note:** Only one square can be selected at the same time, just like our core apps. ![selected\_square](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/87c632b054d8bf7867936fd7d6991d292500df1de041fa831aa11ae5306a9bf2.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // an example when a point is touched on the map and highlights its 3x3m what3words square, self.onSquareSelected = { square in // this clears previous what3words annotations and selected squares self.removeAllMarkers() self.addMarker(at: square, camera: .center) } } } ``` ### Use AutoSuggest Component in the Search field If you want to add the AutoSuggest Component to the search box on top of the Map Component, you need to update your `viewDidLoad()` function to both have the what3words components, the `W3WAutoSuggestTextField` (for the AutoSuggest Component) and `W3WMapViewController` (for the Map Component). ![autosuggest\_text\_field](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/eb5f9a3a9708cd80654056faa00e877a02cd83c1870cb69791f4c5faf7bb5b46.w1600.webp) **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // Add an AutoSuggest Component text field, and attach it to the view let textField = W3WAutoSuggestTextField(api) self.attach(textField: textField) // when an AutoSuggest suggestion is selected from the text field, show it on the map and clear previous selections textField.onSuggestionSelected = { suggestion in self.removeAllMarkers() self.addMarker(at: suggestion, camera: .zoom) } self.onSquareSelected = { square in self.removeAllMarkers() self.addMarker(at: square, camera: .center) // this add the what3words address to the text field textField.set(display: square) } } } ``` If you want to add the voice functionality to the AutoSuggest Text Field Component you need to make sure to add the following line of code right after you declare the `textField` variable **Swift** ```swift let textField = W3WAutoSuggestTextField(api) // Add an AutoSuggest text field component with the voice option, and attach it to the view (voice functionality requires API key permissions, contact what3words to enable this - https://accounts.what3words.com/overview) textField.set(voice: true) attach(textField: textField) ``` ### Customise map type If you are familiar with `MKMapView` you can set up different map types `MKMapType`, for example: - `.standard` if you want to display street map `mapView.mapType = .standard` - `.satellite` if you want to displays satellite imagery `mapView.mapType = .satellite` Here is what your application should look like: ![ios\_map\_component\_final\_result](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/38d78ec51b6ae50999ddc8ed2d5b68252a120254aac18e20557e3adaa5015b74.w1600.webp) ## 4. Existing app using W3WMapHelper If you already have an application with a map we recommend using our Map Helper, `W3WMapHelper` in your app. It provides convenience functions to add to your `MKMapViewDelegate` functions for what3words grid and pin annotations to be displayed on your map. An iOS UIKit example project can be out [here](https://github.com/what3words/w3w-swift-components/blob/master/Examples/MapHelper/MapHelper.xcodeproj). This example shows where you would place the calls, and how to instantiate the `W3WMapHelper`. **Note:** the `W3WMapHelper` is conforms to the `W3WMapViewProtol`. A function reference is described below in the Map Component Functions. **Swift** ```swift let api = What3WordsV3(apiKey: "YourApiKey") let mapHelper = W3WMapHelper(api, map: yourMKMapView) ``` ## 5. Existing app using W3WMapView If you are keen on using our Map View, `W3WMapView`, as a quick and dirty way to quickly get what3words functionality into your app, simply replace your `MKMapView` with `W3WMapView`, and your app should behave the same as before except it will draw what3words grid lines and have some new functions available, like `addMarker(at: "filled.count.soap")`. The `W3WMapView` is derived from `MKMapView` but Apple does not recommend deriving new objects from `MKMapView` presumably, because its interface could change in the future. A better approach to inserting our map component into your existing map would be to use our `W3WMapHelper` which is designed to fit nicely into your `MKMapViewDelegate` conforming class, presumably a `UIViewController`. An iOS UIKit example project can be out [here](https://github.com/what3words/w3w-swift-samples/tree/main/MapView/MapView.xcodeproj). **Note:** the `W3WMapHelper` is conforms to the `W3WMapViewProtol`. A function reference is described below in the Map Component Functions. **Swift** ```swift let api = What3WordsV3(apiKey: "YourApiKey") let mapview = W3WMapView(api) ``` ## 6. Configuring for use with API server If you run our Enterprise Suite API Server yourself, you may specify the URL to your own server by adding this line of code to the Map Component: **Swift** ```swift val api = What3WordsV3(apiKey: "YOUR_API_KEY_HERE", apiUrl: "https://api.yourserver.com") ``` ## 7. Map Component Functions | Method Name | Description | Example | | --- | --- | --- | | addMarker(at: \_, camera: W3WCenterAndZoom, color: UIColor?, style: W3WMarkerStyle) | This parameter will place an annotation on the map, if the map is zoomed in, it will appear as a square, and if zoomed out it shows as a what3words annotation icon. addMarker(at:camera:color) takes one required parameter and two optional ones. The first is the location, this can be a what3words address as: - words: String, - suggestion: W3WSuggestion, - squares: W3WSquare, - coordinates: CLLocatioinCorrdinate2D, - or it can be an array of any of those. Note: if you pass in a String, or W3WSuggestion, a call to convertToCoordinates will be made automatically to get the coordinates, and this will count towards your account quota. The second and optional parameter is called camera and it indicates how to move the map view. The choices are: - .zoom - zooms the map into the location right around the square - .center - adjusts the map's center so that the location is in the center, but does not zoom in - .none - this leaves the mapView showing the same area it was showing before the call The third and optional parameter is color which takes a UIColor color for the annotation. The default colour is the what3words brand's red. | map.addMarker(at:square, camera: .zoom) map.addMarker(at:"filled.count.soap", style: .pin) map.addMarker(at:\["filled.count.soap", "index.home.raft"\], camera: .center) map.addMarker(at:\["filled.count.soap", "index.home.raft"\], color: .blue, camera: .center) | | getMapAnnotationView(annotation: MKAnnotation) -> MKAnnotationView? | If the annotation is a what3words one, this parameter gets a renderer, otherwise, it returns nil. If you are using W3WMapHelper then this is typically called in your MKMapViewDelegate's call: mapView(\_, viewFor: MKAnnotation) | getMapAnnotationView(annotation: annotation) | | mapRenderer(overlay: MKOverlay) -> MKOverlayRenderer?addMarkerAtWords | This parameter gets a renderer for the what3words grid if it is given a W3WMapGridLines or W3WMapSquareLines overlay, otherwise, it returns nil. If you are using W3WMapHelper then this is typically called in your MKMapViewDelegate's call: mapView(\_, rendererFor: MKOverlay) | mapRenderer(overlay: overlay) | | removeAllMarkers() | This parameter will hide an annotation that was previously placed on the map. It takes one parameter and like addMarker(), it can be a what3words address as: - words: String, - suggestion: W3WSuggestion, - coordinates: CLLocatioinCorrdinate2D, - or it can be an array of any of those. | map.removeAllMarkers() | | removeMarker(at:) | This method allow you to get all added markers from the map. | map.removeMarker(at: square) map.removeMarker(at: "filled.count.soap") map.removeMarker(at: \["filled.count.soap", "index.home.raft"\]) | | set(language: String) | This parameter will set the default language for all the calls that the map makes to the API (or SDK if you use that instead). | map.set(language: "fr") // set default language to French | | set(zoomInPointsPerSquare: CGFloat) | This parameter will set how near the addMarker(at: "filled.count.soap", camera: .zoom) calls will zoom. zoomInPointsPerSquare is the size of squares in points when .zoom is used in an addMarker() call. (points being 1x, 2x, 3x a pixel depending on which device you are using and if it has a "retina" display. | set(zoomInPointsPerSquare: x.x) | | updateMap() | This parameter updates the map view with annotations and lines. If you are using W3WMapHelper then this is typically called in your MKMapViewDelegate's calls: mapViewDidChangeVisibleRegion() mapView(\_, regionWillChangeAnimated), and mapView(\_, regionDidChangeAnimated). | updateMap() | ## 8. Events | Event | Description | Example | | --- | --- | --- | | onMarkerSelected | This parameter is called when the user taps a square that has a marker added to it. | self.onMarkerSelected = { square in self.addMarker(at: square, camera: .center)} | | onSquareSelected | This parameter is called when the user taps a square on a map. | self.onSquareSelected = { square in self.addMarker(at: square, camera: .center)} | | onError | This parameter returns the error enum for any error that occurs. | onError = { error in self.showError(error: error) } | ### Listening for events Using an event listener, it is possible to fire other functionality in an app when something changes in the Map Component. For example, when you click on the map marker you can display the what3words address if you trigger the `onSquareSelected` event. **Note:** Only one square can be selected at the same time, just like our core apps. **Swift** ```swift class ViewController: W3WMapViewController { override func viewDidLoad() { super.viewDidLoad() let api = What3WordsV3(apiKey: "Enter your what3words API key") self.set(api) self.set(language: "en") // an example when a point is touched on the map and highlights its 3x3m what3words square, self.onSquareSelected = { square in // this clears previous what3words annotations and selected squares self.removeAllMarkers() self.addMarker(at: square, camera: .center) } } } ``` ## 9. Troubleshooting If you encounter errors or issues related to convert-to-coordinate, convert-to-3wa and grid-section requests while using the Free plan, please check the network panel for the following error message `Error 402 payment required` and its response, indicating the need to upgrade to a higher plan: **JSON** ```json { "error": { "code": "QuotaExceeded", "message": "Quota exceeded or API plan does not have access to this feature. Please change your plan at https://accounts.what3words.com/select-plan, or contact support@what3words.com" } } ``` For more information, visit our [API plans page](https://accounts.what3words.com/select-plan). If you need further assistance, contact [support@what3words.com](mailto:support@what3words.com). ### Issue *How to make the textfield suggest actual addresses (not w3w)?* ### Solution Currently, it’s not possible with the iOS AutoSuggest Component. There is, however, an example of this in [w3w-swift-wrapper](https://github.com/what3words/w3w-swift-wrapper) called [AutosuggestPlusYourData](https://github.com/what3words/w3w-swift-samples/tree/main/AutosuggestPlusYourData). You can use this as a guide or even take some of the code from it for your use. --- # Using the iOS OCR Component what3words OCR Components extract what3words addresses from images or live feeds. Topics: Swift, Mobile App Section: [Scanning](https://developer.what3words.com/docs/scanning.md) Source: https://developer.what3words.com/tutorial/using-the-ios-ocr-component Updated: 2026-11-27 This guide will help you integrate the what3words OCR Components into your iOS application, enabling users to seamlessly scan and interpret what3words addresses from images, using iOS’ Vision Framework or the what3words OCR SDK. #### Features - Detects and extracts what3words addresses from images. - Supports both live and static image scanning. - Flexible APIs to configure scanning preferences. #### GitHub Repository Access the library and detailed documentation on . [iOS OCR Component](https://github.com/what3words/w3w-swift-components-ocr/) #### Demo ![ocr-component-demo](https://kpcwlqbjuaezxoatdmqy.supabase.co/storage/v1/object/public/devsite-media/wp/749e609ea3d9c79bd9bc7b618b79c412aa22e5154969d9150dedee3a2557d40a.gif) ## 1. Get API key You will need a what3words API key to complete this tutorial. [Get an API Key](https://accounts.what3words.com/select-plan) or [sign in](https://accounts.what3words.com/). ## 2. Installation **Swift Package Manager** 1. Add the W3W OCR Swift Components to your project in Xcode, and navigate to **File > Add Packages**. 2. Enter the package URL: [https://github.com/what3words/w3w-swift-components-ocr.git](https://github.com/what3words/w3w-swift-components-ocr.git) 3. Select the latest version and integrate it into your project. Import the library in your Swift files: **Swift** ```swift import W3WSwiftComponentsOcr ``` ## 3. Initialisation ### Using iOS’ Vision Framework To use the Vision Framework for OCR, initialize the `W3WOcrNative` class with the what3words API: **Swift** ```swift let api = What3WordsV4(apiKey: "YourApiKey") let ocr = W3WOcrNative(api) let ocrViewController = W3WOcrViewController(ocr: ocr) ``` ### Using the what3words OCR SDK For offline functionality, use the what3words OCR SDK by specifying the path to OCR data files and an optional language code: **Swift** ```swift let ocr = W3WOcr(dataPath: "/path/to/ocr/datafiles", language: "en") let ocrViewController = W3WOcrViewController(ocr: ocr) ``` ## 4. Usage ### Displaying the OCR Scanner Use the following example to present the OCR scanner in a `UIViewController`: **Swift** ```swift @IBAction func scanButtonPressed(_ sender: Any) { let ocrViewController = W3WOcrViewController(ocr: ocr, w3w: api) // Present the scanner present(ocrViewController, animated: true) // Start scanning ocrViewController.start() // Handle address selection ocrViewController.onSuggestionSelected = { suggestion in print(suggestion) ocrViewController.stop() ocrViewController.dismiss(animated: true) } // Handle errors ocrViewController.onError = { error in print(error) } } ``` ### Customisation You can customise the appearance of the OCR scanner by applying themes through the `W3WThemes` framework: **Swift** ```swift import W3WThemes let theme = W3WTheme.forOcr( backgroundColor: UIColor.white.w3wColor, cameraBackgroundColor: UIColor.darkGray.w3wColor, headerTextColor: UIColor.red.w3wColor, fonts: W3WFonts(font: UIFont(name: "Courier", size: 24.0)) ) let ocrViewController = W3WOcrViewController(ocr: ocr, theme: theme, w3w: api) ``` #### Customisable Properties: - **Colours**: `backgroundColor`, `headerTextColor`, etc. - **Fonts**: Customisable with `W3WFonts`. - **Line Styles**: Modify `defaultLineColor`, `successLineColor`, and thickness options. ### Camera Permission Ensure camera permissions are added to your app’s `Info.plist`: **XML** ```xml NSCameraUsageDescription We need access to your camera to scan what3words addresses. ``` ## 5. Sample App The OCR component repository includes a [sample app](https://github.com/what3words/w3w-swift-samples) demonstrating the usage of the what3words OCR component. --- # Using the Notes Component Adding a what3words address to an existing textarea field with the Notes Component. Topics: Angular, JavaScript, React, Vue, Website Section: [Search Box](https://developer.what3words.com/docs/search-box.md) Source: https://developer.what3words.com/tutorial/using-the-notes-component Updated: 2026-11-27 ### Tutorial The easiest way to add what3words to your technology is to use one of our components. We have components available for JavaScript, iOS and Android which require minimal development to integrate. The JavaScript component can also be used in React.js, Vue.js and Angular. The what3words Notes Component allows users to input a 3-word address in the delivery notes field alongside free text. It provides real-time suggestions and validation, ensuring accurate address input. By default, it uses the what3words API but can be configured to use a private instance. This tutorial guides you through adding the JavaScript Notes Component to your website, whether you have static pages or use npm. It also covers customisation options to refine the 3-word address suggestions and how to style the component to match your site’s design. If you aim to integrate the what3words Public API into your Node.js or browser-based applications, our [JavaScript API Wrapper](https://developer.what3words.com/tutorial/javascript) is ideal. You can also access the JavaScript API Wrapper via the window object using our [JavaScript SDK](https://developer.what3words.com/tutorial/javascript-sdk). ### Quickstart The Notes Component requires just a few lines of code to be added to a form to create a what3words-powered textarea field. **Note:** - Replace `YOUR-API-KEY` with your actual what3words API key. - Customise the `placeholder` and `label` text as needed. #### Integrate within a Textarea Field To add the what3words Notes Component to a textarea field in your checkout page, e.g. Delivery Notes, use the following code snippet: **HTML** ```html Checkout Page
``` **React** ```jsx import { useState } from 'react'; import { What3wordsNotes } from '@what3words/react-components'; function MyFormElement() { const [value, setValue] = useState(''); const onChange = e => setValue(e.target.value); return ( ``` **React** ```jsx ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript

Custom title

Custom content

``` **React** ```jsx

Custom title

Custom content

``` **Vue** ```vue

Custom title

Custom content

``` **Angular** ```typescript

Custom title

Custom content

``` ## 3. Localise the Component ### Supported languages The Notes Component will accept any 3-word address in any language supported by the what3words API. It can also be added to a site using a right-to-left language as long as the HTML direction has been set, for example: **HTML** ```html ``` **React** ```jsx ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ### Country clipping To refine the suggestions supplied to a user we recommend using country clipping where appropriate. If, for example, the component is to be used on a checkout page then country clipping can be specified using the `clip-to-country` attribute for the delivery country to ensure that only suggestions are shown in that country and closer matches are displayed. Multiple countries can be specified as comma-separated. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ### Focus In addition to country clipping, it is also possible to add focus to results using the `search-focus` attribute. The focus should be supplied as a lat, long, usually the user’s location from the GPS on their device. Supplying focus will ensure that suggestions displayed to the user are biased to their location. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ### Controlling Tooltip Display The `showHintsTooltip` property of the what3words Notes Component allows you to control whether the what3words hint tooltip is displayed when the status icon is clicked. By setting the `show-hints-tooltip` attribute to `true` or `false`, you can choose whether to display the tooltip based on your application’s requirements. Here is an example where you decided to hide the tooltip by setting `show-hints-tooltip` attribute to `"false"`. **HTML** ```html ``` **React** ```jsx ``` **Vue** ```vue ``` **Angular** ```typescript ``` ## 5. Streamlining Delivery and Data Extraction **1\. Ensuring Smooth Deliveries:** For flawless fulfilment, getting the identified what3words address into the hands of everyone involved is crucial. This includes integrating it with your order management system and carrier partners. By doing so, you ensure addresses are processed accurately, leading to efficient deliveries. **2\. Extracting what3words Addresses:** Need to isolate what3words addresses from your existing order data? We’ve got you covered! Utilise the provided RegEx formula (included below with a cautionary note). This code helps detect potential what3words addresses within your data. **Have further questions or require assistance?** Feel free to contact our technology partner team at [technology.partnerships@what3words.com](mailto:technology.partnerships@what3words.com). We’re happy to help you navigate what3words integration and ensure a smooth user experience. **Important Considerations:** - While this approach simplifies integration, it’s crucial to note that the RegEx only validates the format, not the actual validity of the what3words address. Further verification might be necessary. Please refer to this [tutorial](https://developer.what3words.com/tutorial/detecting-if-text-is-in-the-format-of-a-3-word-address) for more information on this RegEx and its variations. Implementing these steps will allow you to leverage the power of what3words to streamline your deliveries and extract valuable location data from your existing system. ## 6. Attributes Table ### Component script parameters | Property | Attribute | Type | Description | | --- | --- | --- | --- | | apikey | api-key | String | An API key is required for the component to function correctly. Example: `api-key=Your-API-Key` | | apiVersion | api-version | ApiVersion.Version1 | The API version to use for the what3words API requests. Example: `'v3' as import('@what3words/api').ApiVersion` | | baseUrl | base-url | String | The component can be used with an Enterprise Suite API Server instance by using baseUrl. Example: `baseUrl=https://example.com/v3` | | callback | callback | String | Allows for a callback to be fired once the component has loaded. This should be the function name to be fired. Example: `callback=initMap` | | headers | headers | String | Enterprise API Server only - Allows for custom headers to be passed through in requests. | ### Recommended textarea or input element attributes | Attribute | Type | Description | | --- | --- | --- | | name | String | Standard CSS name. Example: name="what3words" | | id | String | Standard CSS input ID. If not specified then one will be added by our component. Example: id="what3words" | | class | String | Standard CSS class - use with the variant=inherit attribute to apply this class to the input element of the component. Example: class="input-field" | | placeholder | String | Placeholder text to display. We recommend keeping the placeholder as a what3words address proceeded with "e.g." Example: placeholder="e.g ///filled.count.soap" | ### Slots | Slot | Description | | --- | --- | | "input" | The textarea element to get suggestions from when typing. Example: textarea slot="input". | | "label" | The label element for the input slot element. Example: label slot="label" | | "tooltip" | The tooltip content to display when the status icon is clicked. Example div slot="tooltip | ### Component attributes | Property | Attribute | Type | Description | | --- | --- | --- | --- | | addressFormat | address-format | "slashes" \| "url" | The format to display the what3words address in - slashes - e.g. ///filled.count.soap (default) - url - e.g. https://w3w.co/filled.count.soap. Example: address-format="url" | | apiKey | api-key | String | Your what3words API Key can be specified as an attribute to the component. Example: api-key="Your-API-Key" | | clipToBoundingBox | clip-to-bounding-box | String | Restrict suggestions to a bounding box specified using co-ordinates. Example: clip-to-bounding-box="51.521,-0.343,52.6,2.3324" | | clipToCircle | clip-to-circle | String | Restrict suggestions to a circle, specified by lat,lng,kilometres, where kilometres is the radius of the circle. Example: clip-to-circle="51.521251,-0.203586,2" | | clipToCountry | clip-to-country | String | Restrict suggestions to a given country or comma separated list of countries. Example: clip-to-country="GB,US" | | clipToPolygon | clip-to-polygon | String | Restrict suggestions to a polygon, specified by a comma-separated list of lat,lng pairs. The polygon should be closed, i.e. the first element should be repeated as the last element; also the list should contain at least 4 entries. The API is currently limited to accepting up to 25 pairs. Example: clip-to-polygon="51.521,-0.343,52.6,2.3324,54.234,8.343,51.521,-0.343" | | language | language | String | Allows you to add a preferred suggestion fallback language. Only used when input value language cannot be determined. Example: language="EN" | | nFocusResults | n-focus-results | Number | The number of AutoSuggest results to apply the focus to. Example: n-focus-results="2" | | searchFocus | search-focus | {number},${number} | The focus point to prioritise results around. If not provided, the user's current location is used. Example: search-focus="51.5,-020" | | showHintsTooltip | show-hints-tooltip | Boolean | Show the what3words hints tooltip when clicking on the what3words status icon. Example: show-hints-tooltip="true" | | typeaheadDelay | typeahead-delay | Number | The delay in milliseconds to wait after the user has finished typing before making an autosuggest request. Example: typeahead-delay="300" | ## 7. Events Table | Event | Description | | --- | --- | | apiError | Emitted when an error occurs with the what3words API | | suggestionsHover | Emitted when a suggestion is hovered over | | suggestionsChanged | Emitted when the list of suggestions changes | | suggestionSelected | Emitted when a suggestion is selected | | valueChanged | Emitted when the input value changes | | valueInvalid | Emitted when the input value is not a valid what3words address | | valueValid | Emitted when the input value is a valid what3words address | ### Listening for events Using an event listener, it is possible to fire other functionality in a site when something changes in the Notes Component. For example, it is possible to listen for when a valid what3words address has been entered and update another element in the page or to listen for when new coordinates have been returned and pan/zoom a map to the location. **JavaScript** ```javascript document.addEventListener('DOMContentLoaded', () => { const notesComponent = document.querySelector('what3words-notes'); notesComponent.addEventListener('suggestionSelected', (event) => { const selectedSuggestion = event.detail.suggestion; console.log('Suggestion selected:', selectedSuggestion); // You can add additional code here to handle the selected suggestion }); }); ``` **React** ```jsx import { useState } from 'react'; import { What3wordsNotes } from '@what3words/react-components'; function MyFormElement() { const [value, setValue] = useState(''); const onChange = e => setValue(e.target.value); return ( console.log(detail.value)} onValueValid={({ detail }) => console.log(detail.value)} onValueInvalid={({ detail }) => console.log(detail.value)} onSuggestionSelected={({ detail }) => console.log(detail.suggestion)} onSuggestionsChanged={({ detail }) => console.log(detail.suggestions)} >