oslew docs
Console
Menu

CompatibilityaddressoperationId compat_google_maps_api_geocode_json

GET/compat/google/maps/api/geocode/json

The Google Geocoding API's shape over this service's data: results and a status, at their path.

status is real and carries their meanings — OK, ZERO_RESULTS, INVALID_REQUEST — but never OVER_QUERY_LIMIT, because there is no query limit to go over: exceeding your throughput is a 429 with Retry-After. key is accepted and ignored. place_id is prefixed geoalt: so that storing it and sending it to Google fails loudly rather than returning a wrong place. Part of the address product.

Send Authorization: Bearer sk_live_…. The key's plan must include theaddress product; which plans do.

Explained in Migrating from another provider.

Example

A Google Geocoding request, unchanged but for the host.

curl
curl -G "https://api.oslew.com/compat/google/maps/api/geocode/json" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'address=Museo Soumaya' \
  --data-urlencode 'limit=1'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.compat_google_maps_api_geocode_json(address="Museo Soumaya", limit=1)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.compat_google_maps_api_geocode_json({ address: "Museo Soumaya", limit: 1 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1

{
  "results": [
    {
      "address_components": [
        {
          "long_name": "Miguel Hidalgo",
          "short_name": "Miguel Hidalgo",
          "types": [
            "locality",
            "political"
          ]
        },
        {
          "long_name": "CMX",
          "short_name": "CMX",
          "types": [
            "administrative_area_level_1",
            "political"
          ]
        },
        {
          "long_name": "MX",
          "short_name": "MX",
          "types": [
            "country",
            "political"
          ]
        }
      ],
      "confidence": 0.5,
      "formatted_address": "Museo Soumaya, Miguel Hidalgo, CMX, MX",
      "geometry": {
        "location": {
          "lat": 19.44062110346353,
          "lng": -99.20465953606559
        },
        "location_type": "GEOMETRIC_CENTER",
        "viewport": {
          "northeast": {
            "lat": 19.440681794925386,
            "lng": -99.20459517519265
          },
          "southwest": {
            "lat": 19.440560412001677,
            "lng": -99.20472389693853
          }
        }
      },
      "place_id": "geoalt:348329",
      "precision_m": 6.756173533775122,
      "provenance": {
        "licence": "CDLA-Permissive-2.0",
        "name": "overture-places",
        "release": "2026-08-19.0",
        "served_by": "geospatial-alt"
      },
      "types": [
        "point_of_interest",
        "establishment"
      ]
    }
  ],
  "status": "OK"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Query

NameTypeDescription
address
query
string
Free text; one of this or latlng.
latlng
query
string
lat,lng for a reverse lookup.
key
query
string
Accepted and ignored.
language
query
string
Accepted and ignored: no translation layer exists.
components
query
string
country:XX|postal_code:YYYY|locality:Z — country filters; locality and postal_code append to the query.
limit
query
integer
≤ 10
default 5

Responses

200 — Google's shape. A request with neither address nor latlng is INVALID_REQUEST inside a 200, as theirs is.

object

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.