> ## Documentation Index
> Fetch the complete documentation index at: https://docs.radar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete, geocode, and validate addresses

> Build an address entry flow with Radar autocomplete, then use forward, reverse, and IP geocoding and address validation where each one fits.

By the end of this guide, you will have an address form that suggests addresses as the user types, fills structured fields from the chosen suggestion, lets the user correct them, and checks a hand-typed address before accepting it.

## Complete example

The JavaScript tab is the whole address form in one HTML page, and the other tabs make the same autocomplete and geocode calls in a native app.

```html JavaScript theme={null}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Address</title>
    <link href="https://js.radar.com/autocomplete/v1.2.0/radar-autocomplete.css" rel="stylesheet">
    <script src="https://js.radar.com/v5.3.0/radar.min.js"></script>
    <script src="https://js.radar.com/autocomplete/v1.2.0/radar-autocomplete.min.js"></script>
    <style>
      body { margin: 0; padding: 16px; font-family: system-ui, sans-serif; }
      form { max-width: 480px; }
      label { display: block; margin-top: 12px; }
      input { display: block; width: 100%; box-sizing: border-box; padding: 8px; font: inherit; }
      button { margin-top: 12px; padding: 8px 12px; font: inherit; }
      #choices button { display: block; width: 100%; text-align: left; }
    </style>
  </head>

  <body>
    <form id="address-form" novalidate>
      <div id="autocomplete"></div>

      <label>Street address <input id="line1" autocomplete="address-line1"></label>
      <label>Apartment, suite, or unit <input id="unit" autocomplete="address-line2"></label>
      <label>City <input id="city" autocomplete="address-level2"></label>
      <label>State <input id="stateCode" autocomplete="address-level1" maxlength="2"></label>
      <label>Postal code <input id="postalCode" autocomplete="postal-code"></label>
      <label>Country <input id="countryCode" autocomplete="country" maxlength="2" value="US"></label>

      <button type="submit">Continue</button>
      <p id="status" role="status" aria-live="polite"></p>
      <div id="choices"></div>
    </form>

    <script>
      const form = document.getElementById('address-form');
      const statusEl = document.getElementById('status');
      const choicesEl = document.getElementById('choices');
      const fields = {};
      ['line1', 'unit', 'city', 'stateCode', 'postalCode', 'countryCode'].forEach((id) => {
        fields[id] = document.getElementById(id);
      });

      // The last result taken from Radar. Cleared when the user edits a field by hand.
      let accepted = null;

      Radar.initialize('prj_test_pk_...');

      function setStatus(message) {
        statusEl.textContent = message;
      }

      // Copy a Radar address result into the editable fields.
      function fillFields(address) {
        fields.line1.value = [address.number, address.street].filter(Boolean).join(' ') || address.addressLabel || '';
        fields.unit.value = address.unit || fields.unit.value;
        fields.city.value = address.city || '';
        fields.stateCode.value = address.stateCode || '';
        fields.postalCode.value = address.postalCode || '';
        fields.countryCode.value = address.countryCode || '';
        accepted = address;
      }

      // Editing anything except the unit means the fields no longer match a Radar result.
      ['line1', 'city', 'stateCode', 'postalCode', 'countryCode'].forEach((id) => {
        fields[id].addEventListener('input', () => {
          accepted = null;
        });
      });

      function submitAddress(address) {
        choicesEl.replaceChildren();
        setStatus(`Address accepted: ${address.formattedAddress}`);
        // Send the field values, address.latitude, and address.longitude to your backend here.
      }

      Radar.ui.autocomplete({
        container: 'autocomplete',
        width: '100%',
        layers: ['address'],
        countryCode: 'US',
        placeholder: 'Start typing your address',
        ariaLabel: 'Find your address',
        onSelection: (address) => {
          fillFields(address);
          choicesEl.replaceChildren();
          setStatus('Check the details, add a unit if you have one, then continue.');
        },
        onError: (error) => {
          console.error(error);
          setStatus('Address suggestions are unavailable. Enter your address in the fields below.');
        },
      });

      form.addEventListener('submit', async (event) => {
        event.preventDefault();
        choicesEl.replaceChildren();

        const missing = ['line1', 'city', 'postalCode', 'countryCode']
          .filter((id) => !fields[id].value.trim());
        if (missing.length > 0) {
          setStatus('Enter a street address, city, postal code, and country.');
          return;
        }

        // The fields still match a result the user chose. No second request is needed.
        if (accepted) {
          submitAddress(accepted);
          return;
        }

        // The address was typed or edited by hand. Check that it resolves.
        const query = [
          fields.line1.value.trim(),
          fields.city.value.trim(),
          `${fields.stateCode.value.trim()} ${fields.postalCode.value.trim()}`.trim(),
        ].join(', ');

        setStatus('Checking address...');

        let addresses;
        try {
          ({ addresses } = await Radar.forwardGeocode({
            query,
            layers: ['address'],
            country: fields.countryCode.value.trim(),
          }));
        } catch (error) {
          // API error: bad request, rate limit, network failure, or server error.
          console.error(error);
          setStatus(error.status === 'ERROR_BAD_REQUEST'
            ? 'That address could not be read. Check it and try again.'
            : 'We could not check the address right now. Try again.');
          return;
        }

        // No result.
        if (!addresses || addresses.length === 0) {
          setStatus('We could not find that address. Check the street number, street name, and postal code.');
          return;
        }

        // One exact match: a valid address.
        if (addresses.length === 1 && addresses[0].confidence === 'exact') {
          fillFields(addresses[0]);
          submitAddress(addresses[0]);
          return;
        }

        // Several matches, or an approximate match: ask the user to choose or correct.
        setStatus('Is one of these your address? Choose one, or edit the fields and try again.');
        addresses.slice(0, 5).forEach((address) => {
          const button = document.createElement('button');
          button.type = 'button';
          button.textContent = address.formattedAddress;
          button.addEventListener('click', () => {
            fillFields(address);
            submitAddress(address);
          });
          choicesEl.append(button);
        });
      });
    </script>
  </body>
</html>
```

```swift Swift theme={null}
import RadarSDK
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        Radar.initialize(publishableKey: "prj_test_pk_...")
        return true
    }
}

// Call as the user types, after three characters and a 200 ms pause.
func suggestAddresses(for query: String) {
    Radar.autocomplete(query: query, near: nil, layers: ["address"], limit: 8, country: "US") { (status, addresses) in
        guard status == .success, let addresses = addresses else {
            // Show that suggestions are unavailable. Manual entry still works.
            return
        }

        // Show each address's formattedAddress as a suggestion, or a "no results" row when the array is empty.
        print(addresses.count)
    }
}

// Call when the user chooses a suggestion, to fill the editable fields.
func fillFields(from address: RadarAddress) {
    let numberAndStreet = [address.number, address.street].compactMap { $0 }.joined(separator: " ")
    let line1 = numberAndStreet.isEmpty ? (address.addressLabel ?? "") : numberAndStreet
    let unit = address.unit ?? ""
    let city = address.city ?? ""
    let stateCode = address.stateCode ?? ""
    let postalCode = address.postalCode ?? ""
    let countryCode = address.countryCode ?? ""

    // Set your text fields from these values, and keep address.coordinate with them.
    print(line1, unit, city, stateCode, postalCode, countryCode)
}

// Call on submit when the address was typed or edited by hand.
func checkTypedAddress(line1: String, city: String, stateCode: String, postalCode: String, countryCode: String) {
    let query = "\(line1), \(city), \(stateCode) \(postalCode)"

    Radar.geocode(address: query, layers: ["address"], countries: [countryCode]) { (status, addresses) in
        guard status == .success, let addresses = addresses else {
            // Show a retry message.
            return
        }

        if addresses.isEmpty {
            // No result. Ask the user to check the street number, street name, and postal code.
        } else if addresses.count == 1 && addresses[0].confidence == .exact {
            // One exact match: a valid address.
            fillFields(from: addresses[0])
        } else {
            // Several matches, or an approximate match. Show up to five and ask the user to choose or correct.
            print(addresses.prefix(5).compactMap { $0.formattedAddress })
        }
    }
}
```

```kotlin Kotlin theme={null}
import android.app.Application
import io.radar.sdk.Radar
import io.radar.sdk.model.RadarAddress

class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Radar.initialize(this, "prj_test_pk_...")
    }
}

// Call as the user types, after three characters and a 200 ms pause.
fun suggestAddresses(query: String) {
    Radar.autocomplete(query = query, layers = arrayOf("address"), limit = 8, country = "US") { status, addresses ->
        if (status != Radar.RadarStatus.SUCCESS || addresses == null) {
            // Show that suggestions are unavailable. Manual entry still works.
            return@autocomplete
        }

        // Show each address's formattedAddress as a suggestion, or a "no results" row when the array is empty.
        println(addresses.size)
    }
}

// Call when the user chooses a suggestion, to fill the editable fields.
fun fillFields(address: RadarAddress) {
    val line1 = listOfNotNull(address.number, address.street).joinToString(" ").ifEmpty { address.addressLabel.orEmpty() }
    val unit = address.unit.orEmpty()
    val city = address.city.orEmpty()
    val stateCode = address.stateCode.orEmpty()
    val postalCode = address.postalCode.orEmpty()
    val countryCode = address.countryCode.orEmpty()

    // Set your text fields from these values, and keep address.coordinate with them.
    println("$line1 $unit $city $stateCode $postalCode $countryCode")
}

// Call on submit when the address was typed or edited by hand.
fun checkTypedAddress(line1: String, city: String, stateCode: String, postalCode: String, countryCode: String) {
    val query = "$line1, $city, $stateCode $postalCode"

    Radar.geocode(query, arrayOf("address"), arrayOf(countryCode)) { status, addresses ->
        if (status != Radar.RadarStatus.SUCCESS || addresses == null) {
            // Show a retry message.
            return@geocode
        }

        if (addresses.isEmpty()) {
            // No result. Ask the user to check the street number, street name, and postal code.
        } else if (addresses.size == 1 && addresses[0].confidence == RadarAddress.RadarAddressConfidence.EXACT) {
            // One exact match: a valid address.
            fillFields(addresses[0])
        } else {
            // Several matches, or an approximate match. Show up to five and ask the user to choose or correct.
            println(addresses.take(5).map { it.formattedAddress })
        }
    }
}
```

```jsx React Native theme={null}
import { useState } from 'react';
import { Button, Text, TextInput, View } from 'react-native';
import Radar, { Autocomplete } from 'react-native-radar';

Radar.initialize('prj_test_pk_...');

const LABELS = {
  line1: 'Street address',
  unit: 'Apartment, suite, or unit',
  city: 'City',
  stateCode: 'State',
  postalCode: 'Postal code',
  countryCode: 'Country',
};

// Copy a Radar address result into the editable fields.
const toFields = (address, unit) => ({
  line1: [address.number, address.street].filter(Boolean).join(' ') || address.addressLabel || '',
  unit: address.unit || unit,
  city: address.city || '',
  stateCode: address.stateCode || '',
  postalCode: address.postalCode || '',
  countryCode: address.countryCode || '',
});

export default function AddressForm({ onAccept }) {
  const [fields, setFields] = useState({ line1: '', unit: '', city: '', stateCode: '', postalCode: '', countryCode: 'US' });
  // The last result taken from Radar. Cleared when the user edits a field by hand.
  const [accepted, setAccepted] = useState(null);
  const [choices, setChoices] = useState([]);
  const [status, setStatus] = useState('');

  const fill = (address) => {
    const next = toFields(address, fields.unit);
    setFields(next);
    setAccepted(address);
    setChoices([]);
    return next;
  };

  const edit = (key, value) => {
    setFields({ ...fields, [key]: value });
    if (key !== 'unit') setAccepted(null);
  };

  const submit = async () => {
    setChoices([]);
    if (!fields.line1.trim() || !fields.city.trim() || !fields.postalCode.trim() || !fields.countryCode.trim()) {
      setStatus('Enter a street address, city, postal code, and country.');
      return;
    }

    // The fields still match a result the user chose. No second request is needed.
    if (accepted) {
      onAccept(fields, accepted);
      return;
    }

    // The address was typed or edited by hand. Check that it resolves.
    setStatus('Checking address...');
    let addresses;
    try {
      ({ addresses } = await Radar.geocode({
        address: `${fields.line1}, ${fields.city}, ${fields.stateCode} ${fields.postalCode}`,
        layers: ['address'],
        countries: [fields.countryCode],
      }));
    } catch (err) {
      setStatus('We could not check the address right now. Try again.');
      return;
    }

    if (!addresses || addresses.length === 0) {
      setStatus('We could not find that address. Check the street number, street name, and postal code.');
    } else if (addresses.length === 1 && addresses[0].confidence === 'exact') {
      setStatus('');
      onAccept(fill(addresses[0]), addresses[0]);
    } else {
      // Several matches, or an approximate match: ask the user to choose or correct.
      setStatus('Is one of these your address? Choose one, or edit the fields and try again.');
      setChoices(addresses.slice(0, 5));
    }
  };

  return (
    <View>
      <Autocomplete
        options={{
          layers: ['address'],
          countryCode: 'US',
          placeholder: 'Start typing your address',
          onSelection: (address) => {
            fill(address);
            setStatus('Check the details, add a unit if you have one, then continue.');
          },
          onError: () => setStatus('Address suggestions are unavailable. Enter your address in the fields below.'),
        }}
      />
      {Object.keys(LABELS).map((key) => (
        <TextInput
          key={key}
          accessibilityLabel={LABELS[key]}
          placeholder={LABELS[key]}
          value={fields[key]}
          onChangeText={(value) => edit(key, value)}
        />
      ))}
      <Button title="Continue" onPress={submit} />
      <Text accessibilityLiveRegion="polite">{status}</Text>
      {choices.map((address) => (
        <Button
          key={address.formattedAddress}
          title={address.formattedAddress}
          onPress={() => onAccept(fill(address), address)}
        />
      ))}
    </View>
  );
}
```

## Prerequisites

* A publishable key. See [Choose the right API key](https://docs.radar.com/fundamentals/authentication-and-access.md#choose-the-right-api-key). Never put a secret key in client code.
* **Web**: The examples use `radar-sdk-js` 5.3.0 and `@radarlabs/plugin-autocomplete` 1.2.0, which requires `radar-sdk-js` 5.3.0 or later. Geocoding and validation are part of the core SDK.
* No location permission, unless you reverse geocode the user's current position.

## Formatted address, geocoded coordinate, and validated address

A Radar address result can carry three kinds of information. Don't treat one as another.

| Term | Where it appears | What it tells you | What it doesn't tell you |
| - | - | - | - |
| Formatted address | `formattedAddress` on every result | A display string, such as `841 Broadway, New York, NY 10003 USA`. | That the address was checked. A city or postal code result has one too. |
| Geocoded coordinate | `latitude`, `longitude`, `layer`, and, on forward geocode results, `confidence` | Where Radar places the result, and how precisely: `exact` is a known address location, `interpolated` is an estimate between known address points, and `fallback` is the center of a containing area such as a postal code or city. | That mail or a courier can reach it. |
| Validated address | `result.verificationStatus` from the validate operation | Whether the structured input matched a known address record. | That a delivery will succeed. |

## Add the autocomplete component

Load the stylesheet, the core SDK, and the autocomplete plugin, in that order, as the JavaScript tab does. With npm, install the packages:

```bash theme={null}
npm install radar-sdk-js @radarlabs/plugin-autocomplete
```

Then import `@radarlabs/plugin-autocomplete/dist/radar-autocomplete.css`, call `Radar.registerPlugin(createAutocompletePlugin())`, and initialize with your publishable key.

`Radar.ui.autocomplete()` renders a search input and a suggestions list into `container`, an element ID or element, and handles keyboard navigation and screen reader announcements. If you pass an existing `input` element, it attaches the list to that input. In a single-page app, create the component once per mount and call its `remove()` method on unmount.

## Fill structured fields from the selection

`onSelection` receives one address object. The example copies `number` and `street` (or `addressLabel`), `unit`, `city`, `stateCode`, `postalCode`, and `countryCode` into editable fields and keeps `latitude` and `longitude` with them. Every field except the coordinate can be absent, so read them defensively.

Store the structured fields and the coordinate, not only `formattedAddress`. For every field, see [Address object](https://docs.radar.com/api/geocoding.md#address-object).

## Check a typed address on submit

Autocomplete suggests an address. It doesn't decide which address is right. Keep the fields editable after a selection so the user can add a unit, fix a postal code, or enter an address Radar doesn't know, such as a new building. In the example, adding a unit keeps the selection, and editing any other field clears it.

When the address was typed or edited by hand, the example sends the combined fields to `Radar.forwardGeocode()` and branches on the response:

| Response | Meaning | What the example does |
| - | - | - |
| One address with `confidence` of `exact` | The text resolved to one known address location. | Accepts it and updates the fields to the matched form. |
| Several addresses, or `confidence` of `interpolated` or `fallback` | The input is ambiguous, or Radar could only place it approximately. | Shows up to five candidates and lets the user choose one or edit the fields. |
| An empty `addresses` array | Nothing matched. | Asks for a correction. Doesn't submit. |

Whether your product blocks submission when nothing matches is your decision. Enforce it on your backend as well, because anything sent from a browser can be changed by the user. This check confirms that the address resolves to a location. It isn't [address validation](#validate-an-address).

## Tune the component

| Option | Default | Description |
| - | - | - |
| `minCharacters` | `3` | Characters required before the first request. |
| `debounceMS` | `200` | Milliseconds to wait after the last keystroke before a request. |
| `limit` | `8` | Maximum number of suggestions. |
| `layers` | None | Kinds of result to return, for example `['address']` for street addresses only. |
| `countryCode` | None | Restrict results to a country, as a two-letter code. |
| `near` | None | A location to prefer results near. Without it, results are biased by the request's IP-derived location. |
| `onSelection`, `onError` | None | Called with the chosen address, and with the error when a request fails. |

The component also accepts `lang`, `postalCode`, `mailable`, `placeholder`, `width`, `maxHeight`, `disabled`, `showMarkers`, `markerColor`, `hideResultsOnBlur`, `idPrefix`, `ariaLabel`, `onResults`, and `onRequest`.

To keep your own input and suggestions list, call the autocomplete operation through a `Radar.AutocompleteSession`, and apply the same minimum input length and debounce yourself. See [Web SDK](https://docs.radar.com/sdk/web.md#search).

## Use the other operations

Each operation accepts a publishable key.

### Forward geocode

`Radar.forwardGeocode({ query })` converts a complete address to a coordinate. Use autocomplete for partial input instead of calling it on every keystroke. Check `confidence` before you rely on the coordinate for anything precise, such as a delivery pin. See [Forward geocode](https://docs.radar.com/api/geocoding.md#forward-geocode).

### Reverse geocode

`Radar.reverseGeocode({ latitude, longitude })` converts a coordinate to the nearest address. If you omit the coordinate, the SDK requests the browser's location first, which shows a permission prompt. See [Reverse geocode](https://docs.radar.com/api/geocoding.md#reverse-geocode).

### Validate an address

> [!NOTE]
>
> Address validation is available on the [Enterprise plan](https://radar.com/pricing), for United States and Canada addresses.

`Radar.validateAddress()` takes a complete address in structured fields and returns a standardized `address` and a `result.verificationStatus`. Send `city`, `stateCode`, `postalCode`, and `countryCode`, plus either `number` and `street` or a single `addressLabel`. See [Validate an address](https://docs.radar.com/api/geocoding.md#validate-an-address).

| `verificationStatus` | Meaning | Suggested handling |
| - | - | - |
| `verified` | The input has a complete and unique match with a result. | Accept. Store the standardized `address`. |
| `partially verified` | The input has a partial match with a result. | Show the returned address and ask the user to confirm or correct. |
| `ambiguous` | The input closely matches multiple results. | Ask for more detail, often a unit. |
| `unverified` | Radar was unable to verify the input address. | Ask for a correction, or an explicit confirmation if your product allows it. |

`verified` means the text matched a single known address record. It isn't a guarantee that a carrier delivers there, and `unverified` doesn't prove the address is fake.

### IP geocode

`Radar.ipGeocode()` converts the IP address of the request to an estimated city, state, and country, with no permission and no input. The result is an estimate: an IP address locates a network, not a person. Use it for defaults the user can change, such as a preselected country, and not to decide eligibility for regulated activity. See [IP geocode](https://docs.radar.com/api/geocoding.md#ip-geocode).

## Native apps

The iOS, Android, and React Native SDKs provide the same operations, and the React Native SDK also exports an `Autocomplete` component. In a native text field, apply the minimum input length and debounce yourself before you call `Radar.autocomplete`. See [iOS SDK](https://docs.radar.com/sdk/ios.md#geocoding), [Android SDK](https://docs.radar.com/sdk/android.md#geocoding), and [React Native SDK](https://docs.radar.com/sdk/react-native.md#maps-and-ui-kits).

## Coverage

Coarse (city-level) geocoding and autocomplete and IP geocoding are rated great in every rated country. Fine (address-level) coverage varies:

| Fine geocoding and autocomplete | Countries and territories |
| - | - |
| Great | Algeria, Andorra, Argentina, Armenia, Australia, Austria, Azerbaijan, Bahrain, Belarus, Belgium, Bosnia-Herzegovina, Brazil, Bulgaria, Canada, Chile, Colombia, Croatia, Cyprus, Czechia, Denmark, Ecuador, Estonia, Faroe Islands, Finland, France, French Guiana, Georgia, Germany, Greece, Guadeloupe, Hungary, Iceland, Ireland, Italy, Kosovo, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Martinique, Mayotte, Mexico, Moldova, Montenegro, Netherlands, New Zealand, Norway, Paraguay, Peru, Poland, Portugal, Republic of North Macedonia, Reunion, Romania, Russia, San Marino, Serbia, Slovakia, Slovenia, South Africa, Spain, Sweden, Switzerland, Tunisia, Turkey, Ukraine, United Kingdom, United States, Uruguay |
| Good | Brunei, Cambodia, Egypt, Hong Kong, India, Indonesia, Israel, Japan, Jordan, Kazakhstan, Kuwait, Laos, Lebanon, Macao, Malaysia, Monaco, Morocco, Myanmar, Philippines, Saudi Arabia, Singapore, United Arab Emirates |
| Approximate | Other rated countries and territories |

Fine autocomplete is rated good, not great, in Argentina, Ecuador, and Peru. Place search is rated good in nearly every rated country, and great in the United States.

## Handle results and errors

Web SDK methods reject with a `RadarError`. Read its `status`. The component passes the same errors to `onError`.

| Result or error | What it means | What to do |
| - | - | - |
| An empty `addresses` array, or "No results" in the component | Nothing matched. | Let the user keep typing or enter the address by hand. |
| `onSelection` never fires | The user didn't pick a suggestion. | Keep the fields usable on their own, and check them on submit. |
| Several addresses, or `confidence` of `interpolated` or `fallback` | An ambiguous or approximate match. | Show the candidates and let the user choose. Don't pick the first one silently. |
| `ERROR_BAD_REQUEST` | An invalid request, for example an empty query or `addressLabel` sent together with `number` and `street`. | Fix the request. Don't retry unchanged. |
| `ERROR_UNAUTHORIZED` | The key is wrong or revoked. | Check the key and environment. |
| `ERROR_PAYMENT_REQUIRED` from `Radar.validateAddress()` | Validation isn't available to the project. | Fall back to the forward geocode check. |
| `ERROR_RATE_LIMIT` | Too many requests. | Keep the debounce and minimum length in place, and retry after a short wait. |
| `ERROR_NETWORK` or another `RadarError` | The request failed. | Let the user retry, and keep manual entry available. |

## Test the integration

* **Passing case**: Type the start of a real address, choose a suggestion, and confirm every field is filled. Select Continue. The address is accepted with no further request.
* **Failing case**: Enter a street line of random letters and select Continue. The correction message appears and nothing is accepted.

For more, see [Test, troubleshoot, and go live](https://docs.radar.com/fundamentals/testing-and-launch.md).

## Production checklist

* [ ] The form uses the Live publishable key from configuration. No secret key is in client code.
* [ ] Minimum input length and debounce are in place for every autocomplete input.
* [ ] Fields stay editable after a selection, and manual entry works when suggestions are unavailable.
* [ ] You store structured fields and the coordinate, not only `formattedAddress`.
* [ ] Your rule for unverified or unmatched addresses is enforced on the backend.
* [ ] Your interface doesn't promise more than the result supports: "verified" isn't "deliverable".

## Build with an agent

Copy this prompt into a coding agent that has access to your repository.

```text theme={null}
Add address autocomplete and address checking to this repository with Radar.

Read https://docs.radar.com/maps/addresses.md, https://docs.radar.com/sdk/web.md, and
https://docs.radar.com/api/geocoding.md, and follow them for this platform.

Constraints:
- Use a publishable key read from configuration. Never put a secret key in client code.
- Keep the fields editable, and check a typed or edited address on submit.
- Use address validation only if this project has access. Do not invent fields.

Add tests for: selecting a suggestion fills every structured field; an ambiguous address
shows choices; an address with no match shows a correction message and does not submit.
```

## See also

* [Geocoding API](https://docs.radar.com/api/geocoding.md)
* [Autocomplete API](https://docs.radar.com/api/search.md#autocomplete)
* [Web SDK](https://docs.radar.com/sdk/web.md)
* [Build store locators](https://docs.radar.com/maps/store-locators.md)
* [Display maps](https://docs.radar.com/maps/maps.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.