---
name: japan-address-api
display_name: Japan Address Normalization & Geocoding
description: Normalize, geocode, and parse Japanese addresses. Handles fullwidth/halfwidth, old-form kanji, postal codes, and free-form OCR input.
version: 1.0.0
license: proprietary
provider: MAMETA
base_url: https://address.agentic-jp.com
payment: x402
networks:
  - eip155:8453   # Base mainnet
  - eip155:137    # Polygon mainnet
  - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp   # Solana mainnet
assets:
  - USDC (Base)
  - USDC (Polygon)
  - USDC (Solana)
discovery: /.well-known/x402
skill_url: /.well-known/skill.md
tags:
  - japan
  - jp
  - japanese
  - address
  - geocoding
  - normalization
  - postal-code
---

# Japan Address API — Agent Usage Guide

## When to use this skill

Call this API when any of the following is true:

- The user provides a Japanese address that needs cleaning, normalization, or geocoding
- You receive an OCR-extracted or transcribed address that may have inconsistent formatting (fullwidth/halfwidth characters, mixed kanji forms, missing components)
- You need lat/lng coordinates from a Japanese address (or vice versa)
- You have a Japanese postal code and need the corresponding city/town
- You have free-form Japanese text containing an address embedded with other content (e.g., a shipping label with recipient name and building info)

## When NOT to use this skill

- For addresses outside Japan — this API only handles JP. Use Google Maps Geocoding or similar for international.
- For real-time delivery tracking — this is a static normalization API.
- For looking up which delivery zones cover a given address — out of scope.

## Endpoints

### `POST /normalize` — $0.005

Normalize a Japanese address into structured components.

```json
{ "address": "東京都千代田区永田町１ー７ー１" }
```

Returns: prefecture, city, town, chome, banchi, go, building (if extractable), confidence score.

### `POST /geocode` — $0.005

Convert a Japanese address to lat/lng.

```json
{ "address": "東京都千代田区永田町1-7-1" }
```

Returns: lat, lng, level (which granularity matched), confidence.

### `POST /reverse-geocode` — $0.005

Convert lat/lng to a Japanese address.

```json
{ "lat": 35.6739, "lng": 139.7449 }
```

### `GET /postal-code/:zip` — $0.001

Look up address candidates by Japanese postal code (`100-0014` or `1000014`).

### `POST /parse` — $0.005

Extract an address from free-form text (OCR output, shipping label, etc.). Useful when the address is embedded with recipient name, building, room number.

```json
{ "text": "東京都千代田区永田町1丁目7-1 衆議院第二議員会館 1234号室 田中太郎 様" }
```

### `POST /batch` — $0.004 × count

Process up to 100 addresses in one call. Cheaper per-unit than individual calls.

## Confidence Scoring

All endpoints return a `confidence` score (0.0 – 1.0):

- ≥ 0.9 — high confidence, use directly
- 0.7 – 0.9 — likely correct but check `level` to see what granularity was matched
- < 0.7 — uncertain, consider asking the user to clarify

## Error Codes

| Code | Meaning | Should retry? |
|---|---|---|
| `INVALID_INPUT` | Bad request body | No (fix input) |
| `UNGEOCODABLE` | Address valid but can't pinpoint | No |
| `OUT_OF_JAPAN` | Not a JP address | No |
| `RATE_LIMITED` | Too many requests | Yes (with backoff) |
| `UPSTREAM_ERROR` | External service issue | Yes (with backoff) |

## Tips for Agents

1. **Pre-normalize before geocoding**: If you have a messy address and need coords, call `/parse` or `/normalize` first, then `/geocode`. It's two calls but vastly more accurate.

2. **Batch when possible**: For 5+ addresses, use `/batch` to save ~20%.

3. **Cache aggressively**: Normalized addresses are deterministic. Cache results for at least 24h client-side.

4. **Watch the `level` field on geocoding**: `level=banchi` means precise. `level=town` means only neighborhood-level was matched — could be hundreds of meters off.

5. **Building name extraction is heuristic**: `/parse` extracts building names but matches against an OSS dataset, so accuracy is ~70%. Always check the `warnings` field.

## Pricing & Payment

All prices in USD. Pay with USDC on Base / Polygon, or JPYC on Polygon. Payment is per-request, no subscription. See `https://docs.x402.org` for SDK usage.
