# Address API

## Address API Overview

It leverages Google Places API to offer address autocomplete functionality and retrieve geographical coordinates, enhancing the accuracy of shipping addresses and enabling location-based services.

### Key Features

* Address autocomplete using Google Places API
* Geocoding to obtain latitude and longitude for addresses
* Validation of shipping addresses
* Support for international addresses

## Authentication

Before using the API, you need to obtain an access token from the [Authentication API](/authentication-api-integration.md). Include this token in the `Authorization` header of all API requests:

```
Authorization: Bearer <YOUR_ACCESS_TOKEN>
```

## Error Handling

The API uses standard HTTP response codes to indicate the success or failure of requests. In case of an error, the response body will contain a JSON object with more details about the error.

## Rate Limiting

The API is subject to rate limiting to ensure fair usage and maintain performance. If you exceed the rate limit, you'll receive a 429 (Too Many Requests) response.

## Best Practices

1. Use the autocomplete endpoint to provide real-time suggestions as users type their address.
2. Always use the place ID returned by the autocomplete endpoint to fetch detailed address information.
3. Store both the formatted address and the geocoding data (latitude and longitude) for each validated address.
4. Implement proper error handling to manage cases where address validation fails.

## Google Places API Key

{% hint style="info" %}
A Google Places API Key is required to use this service. You need to include this key in your requests to the Address API. For instructions on how to obtain a Google Places API Key, please refer to the [Google Maps Platform documentation](https://developers.google.com/maps/documentation/places/web-service/get-api-key)
{% endhint %}

## Required Google Cloud Configuration

Your Google Cloud API key must:

1. Have **Places API enabled**
2. Be authorized for the required SKUs
3. Have appropriate key restrictions configured (recommended: restrict to Places API only)

In Google Cloud Console:

* Go to **APIs & Services → Credentials**
* Edit your API key
* Under **API restrictions**, select:
  * ✅ *Places API* (or *Places API (New)* depending on your configuration)

### Required Billing SKUs

The following Google billing SKUs are required for the Address API endpoints:

#### 1️⃣ Autocomplete Endpoint

Used by: `POST /api/address/autocomplete`

**Google SKU:**\
Places Autocomplete – Per Request (Legacy Essentials SKU)\
<https://developers.google.com/maps/billing-and-pricing/sku-details#places\\_autocomplete-per-request-legacy-ess-sku>

***

#### 2️⃣ Place Details Endpoint

Used by: `GET /api/address/details`

**Google SKU:**\
Place Details – ID Refresh (Legacy Essentials SKU)\
<https://developers.google.com/maps/billing-and-pricing/sku-details#place-details-id-refresh-legacy-ess-sku>

## Support

Our dedicated support team is available to assist you with API integration and usage. For any questions or issues, please contact <solutions@liquidapp.co>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liquidcommerce.cloud/services/address-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
