# get_postal_codes

**List postal codes** · Read-only, idempotent

List the postal codes `live_search` accepts in `postal_code`: for each marketplace, every supported postal code with its city, region (full state, province, prefecture, territory, county or UK nation name; Singapore in Singapore) and whether it is the marketplace default.

- In SA, AE and EG the `postal_code` is a city name.
- The default is first, then the rest by region and city.
- `delivery_scope` is "country" with no `postal_codes` for NL, BE and ZA, which deliver to the whole country and take no `postal_code`, and `postal_code` elsewhere.
- Call it before passing `live_search` a non-default `postal_code`, and match the user's place (for example a shopper in Texas) by city and region; pass the chosen `postal_code` exactly as listed.
- The list can change, so do not rely on values remembered from earlier conversations.
- Omit marketplace for every marketplace.

**Cost and limits:** Costs no credits; shared 60-per-minute limit.

## Input

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `marketplace` | `string` | Optional | Only this marketplace, any letter case: US, CA, MX, UK, DE, FR, IT, ES, AU, JP, BR, IN, SG, TR, NL, PL, SE, BE, SA, AE, EG, IE, ZA. Omit for every marketplace. Maximum length 2. |

## Output

Read this object from the result's `structuredContent`. The result's `content` carries a text version for the model, which is not always the same JSON.

One entry per marketplace.

`data` is an array. Fields of each `data[]` item:

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `marketplace` | `string` | Required | One of `US`, `CA`, `MX`, `UK`, `DE`, `FR`, `IT`, `ES`, `AU`, `JP`, `BR`, `IN`, `SG`, `TR`, `NL`, `PL`, `SE`, `BE`, `SA`, `AE`, `EG`, `IE`, `ZA`. |
| `delivery_scope` | `"postal_code" \| "country"` | Required | `country` when Amazon delivers to the whole country, so live search takes no `postal_code` and `postal_codes` is empty (`NL`, `BE` and `ZA`); otherwise `postal_code`. |
| `postal_codes` | `PostalCode[]` | Required | The marketplace's postal codes: the default first, then by region and city. Empty when `delivery_scope` is `country`. |

### `data[].postal_codes[]`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `postal_code` | `string` | Required | Postal code to pass to live search as `postal_code`, exactly as listed. In `SA`, `AE` and `EG` it is a city name. Minimum length 1. |
| `city` | `string` | Required | City the postal code is in. Minimum length 1. |
| `region` | `string` | Required | Full name of the state, province, prefecture, territory, county or UK nation the postal code is in. In Singapore, which has none, it is `Singapore` and `city` names the district. Minimum length 1. |
| `is_default` | `boolean` | Required | Whether live search uses this postal code when `postal_code` is omitted. Exactly one postal code per marketplace is the default. |

<details>
<summary>Full input and output JSON Schema</summary>

```json
{
  "inputSchema": {
    "type": "object",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "marketplace": {
        "description": "Only this marketplace, any letter case: US, CA, MX, UK, DE, FR, IT, ES, AU, JP, BR, IN, SG, TR, NL, PL, SE, BE, SA, AE, EG, IE, ZA. Omit for every marketplace.",
        "type": "string",
        "maxLength": 2
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "data"
    ],
    "properties": {
      "data": {
        "type": "array",
        "description": "One entry per marketplace.",
        "items": {
          "type": "object",
          "required": [
            "marketplace",
            "delivery_scope",
            "postal_codes"
          ],
          "properties": {
            "marketplace": {
              "type": "string",
              "enum": [
                "US",
                "CA",
                "MX",
                "UK",
                "DE",
                "FR",
                "IT",
                "ES",
                "AU",
                "JP",
                "BR",
                "IN",
                "SG",
                "TR",
                "NL",
                "PL",
                "SE",
                "BE",
                "SA",
                "AE",
                "EG",
                "IE",
                "ZA"
              ]
            },
            "delivery_scope": {
              "type": "string",
              "enum": [
                "postal_code",
                "country"
              ],
              "description": "`country` when Amazon delivers to the whole country, so live search takes no `postal_code` and `postal_codes` is empty (`NL`, `BE` and `ZA`); otherwise `postal_code`."
            },
            "postal_codes": {
              "type": "array",
              "description": "The marketplace's postal codes: the default first, then by region and city. Empty when `delivery_scope` is `country`.",
              "items": {
                "$ref": "#/$defs/PostalCode"
              }
            }
          }
        }
      }
    },
    "$defs": {
      "PostalCode": {
        "type": "object",
        "required": [
          "postal_code",
          "city",
          "region",
          "is_default"
        ],
        "properties": {
          "postal_code": {
            "type": "string",
            "minLength": 1,
            "description": "Postal code to pass to live search as `postal_code`, exactly as listed. In `SA`, `AE` and `EG` it is a city name."
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "description": "City the postal code is in."
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "description": "Full name of the state, province, prefecture, territory, county or UK nation the postal code is in. In Singapore, which has none, it is `Singapore` and `city` names the district."
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether live search uses this postal code when `postal_code` is omitted. Exactly one postal code per marketplace is the default."
          }
        }
      }
    }
  }
}
```

</details>
