Source: https://developers.woosmap.com/products/w3w-api/get-started/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Getting Started with the Woosmap for what3words API



## Before we start

To use any of the examples you will need a Woosmap Public Key with both:

- the `what3words` product is enabled for the project (`Localities` is automatically enabled with `what3words`)
- the `localhost` domain whitelisted

You can follow [this](/get-started) tutorial to learn how set up your account,  
And [this one](/api-reference/authentication/) to learn about Woosmap API Keys domain restrictions.

## Convert to address

This endpoint will take a what3words address and return to you a list of possible street addresses. If there are no street addresses within 200m of the what3words address it will return an empty list.

For the UK do not forget to enable Localities UK Addresses add-on.

Convert-to-address endpoint is designed to provide address suggestions. As for other autocomplete or autosuggest services, you’ll need to perform an additional request to get details on a dedicated suggestion. To retrieve lat/lng and address components, perform a [get details](/api-reference/localities-api/get-localities-details/) request using the `public\_id contained in suggestions.

```shell
curl -L -X GET 'https://api.woosmap.com/what3words/convert-to-address?words=couch.spotted.amended&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
```

```python
import requests

url = "https://api.woosmap.com/what3words/convert-to-address?words=couch.spotted.amended&key=YOUR_PUBLIC_API_KEY"

payload={}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```javascript
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.woosmap.com/what3words/convert-to-address?words=couch.spotted.amended&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

[Reference Doc](/api-reference/what3words-api/get-what3words-convert-to-address/)

## AutoSuggest

AutoSuggest can take a slightly incorrect 3 word address and suggest a list of valid 3 word addresses. It has powerful features that can, for example, optionally limit results to a country or area, and prioritise results that are near the user (see Clipping and Focus below).

It provides corrections for the following types of input error:

- Typing errors
- Spelling errors
- Misremembered words (e.g. singular vs. plural)
- Words in the wrong order

```shell
curl -L -X GET 'https://api.woosmap.com/what3words/autosuggest?input=couch.spotted.am&clip-to-country=fr&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
```

```python
import requests

url = "https://api.woosmap.com/what3words/autosuggest?input=couch.spotted.am&clip-to-country=fr&key=YOUR_PUBLIC_API_KEY"

payload={}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```javascript
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.woosmap.com/what3words/autosuggest?input=couch.spotted.am&clip-to-country=fr&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

[Reference Doc](/api-reference/what3words-api/get-what3words-autosuggest/)

## Convert to what3words

You can use this endpoint to take a Latitude and Longitude and convert them into a what3words address.

```shell
curl -L -X GET 'https://api.woosmap.com/what3words/convert-to-3wa?coordinates=48.858304,2.294514&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
```

```python
import requests

url = "https://api.woosmap.com/what3words/convert-to-3wa?coordinates=48.858304,2.294514&key=YOUR_PUBLIC_API_KEY"

payload={}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```javascript
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.woosmap.com/what3words/convert-to-3wa?coordinates=48.858304,2.294514&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

[Reference Doc](/api-reference/what3words-api/get-what3words-convert-to-3wa/)
