• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
bart

bart

GoogleMapsToOSM

Public
Like
GoogleMapsToOSM
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://bart--fb5012eac4b911f0a33b42dde27851f2.web.val.run
README.md

Google Maps to OpenStreetMap Converter

A Val Town service that converts Google Maps links to OpenStreetMap.org links. This tool extracts location information from various Google Maps URL formats and generates the corresponding OpenStreetMap URLs.

Features

  • Web Interface: User-friendly form for easy conversion
  • API Endpoints: Both GET and POST endpoints for programmatic access
  • Multiple URL Formats: Supports various Google Maps URL patterns
  • Error Handling: Provides clear error messages for invalid inputs
  • Copy to Clipboard: Easy copying of converted URLs

Supported Google Maps URL Formats

  • Shortened URLs: maps.app.goo.gl/..., goo.gl/..., g.co/...
  • Direct coordinate links: maps.google.com/@lat,lng,zoom
  • Place searches: maps.google.com/place/Location+Name/@lat,lng,zoom
  • Search queries: maps.google.com/?q=search+term
  • Links with ll= or center= parameters
  • Street view and other coordinate-based URLs

Usage

Web Interface

Visit the val URL directly in your browser to access the web interface. Simply paste a Google Maps URL and click "Convert to OpenStreetMap" to get the corresponding OSM link.

API Usage

GET Request

GET /?url=<encoded_google_maps_url>

Example:

GET /?url=https%3A//www.google.com/maps/%4040.7128%2C-74.0060%2C15z

POST Request

POST /
Content-Type: application/json

{
  "url": "https://www.google.com/maps/@40.7128,-74.0060,15z"
}

Response Format

Success Response:

{ "original": "https://www.google.com/maps/@40.7128,-74.0060,15z", "converted": "https://www.openstreetmap.org/#map=15/40.7128/-74.006", "success": true }

Error Response:

{ "error": "Not a valid Google Maps URL", "success": false }

Examples

Shortened URLs

  • Input: https://maps.app.goo.gl/KX1cGxZiY2jK9NFZ8
  • Output: https://www.openstreetmap.org/#map=14/51.7532108/6.38258

Coordinate-based URLs

  • Input: https://www.google.com/maps/@40.7128,-74.0060,15z
  • Output: https://www.openstreetmap.org/#map=15/40.7128/-74.006

Place URLs

  • Input: https://www.google.com/maps/place/Statue+of+Liberty/@40.6892,-74.0445,17z
  • Output: https://www.openstreetmap.org/#map=17/40.6892/-74.0445

Search URLs

  • Input: https://www.google.com/maps?q=Central+Park+New+York
  • Output: https://www.openstreetmap.org/search?query=Central%20Park%20New%20York

Technical Details

The converter uses pattern matching to extract:

  1. URL Expansion: Automatically follows redirects for shortened URLs (goo.gl, maps.app.goo.gl, g.co)
  2. Coordinates: Latitude, longitude, and zoom level from various URL patterns
  3. Place Names: Location names for search-based conversions
  4. Zoom Levels: Maintains appropriate zoom levels for map viewing

When coordinates are available, it generates direct map links. When only place names are found, it creates search URLs on OpenStreetMap.

Error Handling

The service handles various error cases:

  • Invalid URLs
  • Non-Google Maps URLs
  • URLs without extractable location information
  • Malformed requests

All errors return appropriate HTTP status codes and descriptive error messages.

HTTP
  • index.ts
    bart--fb…f2.web.val.run
Code
README.md
H
index.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.