DEV Community

tarkun55
tarkun55

Posted on

How I Built a Flat-Rate Reverse Geocoding API for Japan to Escape Google Maps Bill Shock

If you've ever built a global app or travel tool operating in Japan, you know the struggle:

  1. Google Maps Geocoding API pricing: At $5.00 per 1,000 requests, unexpected traffic spikes can lead to terrifying monthly bills.
  2. Messy Japanese address data: Official Japanese government (MLIT) CSVs and Japan Post files are difficult to normalize and query without self-hosting a spatial database like PostGIS.

To solve this for indie hackers and global dev teams, I built ReverseGeoJP — a fast, flat-rate reverse geocoding API for Japan address data.


What it does

Send a standard HTTP GET request with latitude and longitude:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.reversegeojp.com/reverse?lat=35.6595&lon=139.6987"
Enter fullscreen mode Exit fullscreen mode

Receive Japanese prefecture, city, town, postal code, and distance to town centroid in clean JSON:

{
  "prefecture": "東京都",           // Prefecture (e.g. Tokyo)
  "city": "渋谷区",               // City / Ward (e.g. Shibuya-ku)
  "town": "道玄坂二丁目",          // Town / District (e.g. Dogenzaka 2-chome)
  "zipcode": "1500043",            // 7-digit postal code
  "zipcode_candidates": ["1500043"],
  "distance_m": 36                  // Distance to town centroid (m)
}
Enter fullscreen mode Exit fullscreen mode

How it's built

  • Cloudflare Workers & D1: Powered by SQLite at the edge, offering fast response times globally without server maintenance overhead.
  • Official Data: Sourced from official Ministry of Land, Infrastructure, Transport and Tourism (MLIT) location data and Japan Post records.
  • Flat-Rate Plans: Free tier (1,000 req/mo), then flat monthly subscriptions ($15/mo for 30k req, $39/mo for 200k req) with zero per-request surge charges.

Try it out

You can test the API and sign up for a free API key at https://api.reversegeojp.com/en (no credit card required).

I'd love to hear your feedback on the schema, performance, or features you'd like to see!

Top comments (0)