You have a latitude and longitude from a phone, a GPS track or an event log, and you need a human label: "near Madrid, Spain", plus the time zone. You do not need a street address. A street-level geocoder returns more than that job needs, and you end up ignoring most of the response.
This guide uses the City Geocoding API on API.market. It works at city and town level over a built-in set of 171,000 populated places from GeoNames. There are three endpoints: reverse geocode, search by name, and list places within a radius. Below you get requests and responses, code in curl, Python and Node.js, a cached pipeline for GPS tracks, a rate-limited bulk runner, a time zone recipe, a worked example with arithmetic, what it costs at several volumes, how to pick between city-level and street-level reverse geocoding, and the errors you will hit first.
The internal quickstart dated 2026-10-28 reports calls to the three City Geocoding endpoints and one deliberate 400 error; the response examples below reproduce that written record, abridged. The current documentation review did not replay those calls or independently reconcile their charge receipts. The curl, Python and Node.js snippets are unexecuted examples based on the listing's request format. The Trueway and other listings mentioned later were reviewed from documentation only.
When city-level geocoding is enough
Use it when the output is a label or a grouping key, not a delivery address:
- A "you are near ..." line in a mobile app
- Tagging photos, rides or runs with town, region, country and time zone
- Adding city and local time zone to analytics or IoT events
- A city picker with autocomplete, ranked by population
- Listing towns inside a delivery radius of a depot
It will not return a street or a house number. If you need rooftop accuracy, look at a street-level geocoder instead. The section on street-level options below covers when that switch makes sense.
There is a second, quieter reason to prefer city level: the answer is stable and cheap to cache. A street address changes meaning when a building is demolished or renumbered. A city does not move. If your goal is a grouping key for reports ("rides per city per week"), a city-level answer is more consistent than a street address, because two points a block apart land in the same bucket.
Pricing and limits
There is no free plan on this listing, so budget a little before you test. Plans as returned by the live listing on 2026-11-17:
| Plan | Monthly fee | Included calls | Limit type | Notes |
|---|---|---|---|---|
| Pay as you go | $0 | none | Soft | $0.0005 per successful call, 10 requests per second |
| Pro | $4.99 | 25,000 | Hard | 10 requests per second |
| Ultra | $14.99 | 150,000 | Hard | 10 requests per second |
The two details that matter here. First, Pro and Ultra are hard-limit plans. The listing says that once the monthly quota is used up, further calls return 429 Too Many Requests until the next billing period, so there is no overage rate to read and no silent overage bill, but your service stops getting labels. Second, "$0 per month" on pay as you go is not a free allowance. It means you pay per successful call and nothing else. The listing states that pay as you go has no quota.
Pay as you go needs a positive wallet balance. If calls come back with a 402, top up at https://api.market/account/billing. At the documented rate, three successful calls would cost $0.0015. That is a cost illustration, not an independently verified receipt for the historical quickstart; whether its deliberate 400 was billed was not confirmed.
Authentication
Subscribe on the listing page, copy your key, and send it in the x-api-market-key header. The base URL is:
https://prod.api.market/api/v1/tidydata/city-geocoding
1. Reverse geocode a coordinate
Central Madrid, as a curl call. The lat parameter comes first, then lon:
curl -G "https://prod.api.market/api/v1/tidydata/city-geocoding/v1/geo/reverse" \
--data-urlencode "lat=40.4168" --data-urlencode "lon=-3.7038" --data-urlencode "minPopulation=0" \
-H "x-api-market-key: $API_MARKET_KEY"
The response example in the 2026-10-28 quickstart (the alternatives list is trimmed here):
{
"query": {"lat": 40.4168, "lon": -3.7038},
"nearest": {"geonameId": 6545083, "name": "Sol", "latitude": 40.4166, "longitude": -3.7033,
"countryCode": "ES", "country": "Spain", "region": "Madrid", "population": 8164,
"timezone": "Europe/Madrid", "type": "neighborhood", "distanceKm": 0.05},
"nearestMajorCity": {"geonameId": 3117735, "name": "Madrid", "countryCode": "ES",
"region": "Madrid", "population": 3255944, "timezone": "Europe/Madrid",
"type": "capital", "distanceKm": 0.11},
"alternatives": [{"geonameId": 3117735, "name": "Madrid", "distanceKm": 0.11}],
"attribution": "Place data Β© GeoNames (https://www.geonames.org), CC BY 4.0."
}
One thing catches people out. In a big city the nearest hit is often a district. Here it is "Sol", a neighborhood. If you want the city itself, read nearestMajorCity (the closest place with 100,000 or more people), or raise minPopulation so small places are skipped.
Which field to show depends on the product. A map label for a user standing in the middle of Madrid might want the neighborhood ("Sol"). A report that groups rides by city wants nearestMajorCity. A rural point may have no major city nearby at all, so your code should accept that nearestMajorCity can be empty, and fall back to nearest. The Python and Node examples below do that.
Python
import os
import requests
BASE = "https://prod.api.market/api/v1/tidydata/city-geocoding"
HEADERS = {"x-api-market-key": os.environ["API_MARKET_KEY"]}
def city_for(lat, lon):
r = requests.get(
f"{BASE}/v1/geo/reverse",
headers=HEADERS,
params={"lat": lat, "lon": lon},
timeout=15,
)
r.raise_for_status()
d = r.json()
city = d["nearestMajorCity"] or d["nearest"]
return city["name"], city["country"], city["timezone"]
print(city_for(40.4168, -3.7038))
Node.js 18+
const BASE = "https://prod.api.market/api/v1/tidydata/city-geocoding";
const headers = { "x-api-market-key": process.env.API_MARKET_KEY };
async function cityFor(lat, lon) {
const qs = new URLSearchParams({ lat: String(lat), lon: String(lon) });
const res = await fetch(`${BASE}/v1/geo/reverse?${qs}`, { headers });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const d = await res.json();
const city = d.nearestMajorCity ?? d.nearest;
return { name: city.name, country: city.country, timezone: city.timezone };
}
console.log(await cityFor(40.4168, -3.7038));
2. Search places by name
The search endpoint does accent-insensitive prefix matching and sorts by population, largest first. That makes it a decent backend for a city autocomplete box. Add country with an ISO code to narrow a common name. The limit can be 1 to 50.
curl -G "https://prod.api.market/api/v1/tidydata/city-geocoding/v1/geo/search" \
--data-urlencode "q=Salamanca" --data-urlencode "country=ES" --data-urlencode "limit=3" \
-H "x-api-market-key: $API_MARKET_KEY"
The response example in the historical quickstart had count: 2, even with limit=3, because only two Spanish places match:
{"query": "Salamanca", "count": 2, "results": [
{"geonameId": 6544491, "name": "Salamanca", "latitude": 40.4297, "longitude": -3.6797,
"countryCode": "ES", "country": "Spain", "region": "Madrid", "population": 147707,
"timezone": "Europe/Madrid"},
{"geonameId": 3111108, "name": "Salamanca", "latitude": 40.9688, "longitude": -5.6639,
"countryCode": "ES", "country": "Spain", "region": "Castille and LeΓ³n", "population": 144825,
"timezone": "Europe/Madrid"}
]}
Note the first hit is the Salamanca district of Madrid, not the university city. If your users type "Salamanca" they probably mean the second one, so show the region next to the name in your picker. Without the country filter, the listing's own example returns seven matches and the largest is in Mexico (Guanajuato, population 160,682), which is exactly why a bare name needs a country hint or a region label.
s = requests.get(
f"{BASE}/v1/geo/search",
headers=HEADERS,
params={"q": "Salamanca", "country": "ES", "limit": 3},
timeout=15,
).json()
print([(p["name"], p["region"], p["population"]) for p in s["results"]])
For an autocomplete box, two habits keep the bill down. Wait until the user has typed at least two or three characters. And debounce the input by a quarter of a second or so, so a fast typist triggers one call instead of one per keystroke. Cache the result by lowercase query string, since place names rarely change.
3. List places near a point
nearby returns every place inside a radius (up to 500 km), sorted by distance. Use minPopulation to drop tiny settlements and limit (1 to 100) to cap the list.
curl -G "https://prod.api.market/api/v1/tidydata/city-geocoding/v1/geo/nearby" \
--data-urlencode "lat=40.97" --data-urlencode "lon=-5.66" --data-urlencode "radius=25" \
--data-urlencode "minPopulation=5000" --data-urlencode "limit=3" \
-H "x-api-market-key: $API_MARKET_KEY"
With those settings the test call returned two places: Salamanca (population 144,825, 0.35 km away) and Santa Marta de Tormes (14,630, 3.49 km). Each place also carries a type such as county seat or seat.
const qs = new URLSearchParams({
lat: "40.97", lon: "-5.66", radius: "25", minPopulation: "5000", limit: "3",
});
const res = await fetch(`${BASE}/v1/geo/nearby?${qs}`, { headers });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { places } = await res.json();
console.log(places.map((p) => `${p.name} ${p.distanceKm}km`));
Two uses worth building: a service-area check ("which of our towns are within 40 km of this depot?") and a "closest big city" label for a rural point, by calling nearby with a high minPopulation and a wide radius, then taking the first row. Note that distanceKm is the straight-line distance from your point to the place. It is not a driving distance. If you need road distance, that is a routing job, not a geocoding one.
A pipeline for GPS tracks
The single calls above are fine for one-off lookups. A more realistic job is tagging a day of GPS points from a fleet, a running app or a set of IoT devices. A track from one vehicle can have thousands of points inside one city, and calling the API for each one is wasteful. Rounding and caching fixes most of that.
The idea: round each coordinate to three decimals, which is roughly 100 meters of latitude, use the rounded pair as a cache key, and only call the API on a miss. Rounding can change the selected nearest place near a boundary. Choose a precision and refresh policy for your application rather than assuming every point in a cell has the same answer.

import os
import sqlite3
import time
import requests
BASE = "https://prod.api.market/api/v1/tidydata/city-geocoding"
HEADERS = {"x-api-market-key": os.environ["API_MARKET_KEY"]}
db = sqlite3.connect("city_cache.db")
db.execute(
"""CREATE TABLE IF NOT EXISTS city (
cell TEXT PRIMARY KEY,
name TEXT, region TEXT, country TEXT, country_code TEXT, timezone TEXT,
distance_km REAL
)"""
)
def cell_key(lat, lon, places=3):
return f"{round(lat, places):.{places}f},{round(lon, places):.{places}f}"
def lookup(lat, lon):
key = cell_key(lat, lon)
row = db.execute("SELECT * FROM city WHERE cell = ?", (key,)).fetchone()
if row:
return dict(zip(
["cell", "name", "region", "country", "country_code", "timezone", "distance_km"], row
))
r = requests.get(
f"{BASE}/v1/geo/reverse",
headers=HEADERS,
params={"lat": lat, "lon": lon},
timeout=15,
)
if r.status_code == 429:
time.sleep(float(r.headers.get("Retry-After", 1)))
return lookup(lat, lon)
r.raise_for_status()
d = r.json()
place = d.get("nearestMajorCity") or d.get("nearest")
if not place:
return None
db.execute(
"INSERT OR REPLACE INTO city VALUES (?, ?, ?, ?, ?, ?, ?)",
(key, place["name"], place.get("region"), place["country"],
place["countryCode"], place["timezone"], place.get("distanceKm")),
)
db.commit()
return lookup(lat, lon)
def tag_track(points):
"""points: list of (lat, lon, utc_timestamp). Returns one dict per point."""
out = []
for lat, lon, ts in points:
city = lookup(lat, lon)
out.append({"lat": lat, "lon": lon, "ts": ts, "city": city})
return out
One caution about the retry on 429. On a hard-limit plan, a 429 can mean the monthly quota is gone, not that you went too fast. In that case sleeping and retrying forever will loop. Cap the number of retries, and treat a 429 that survives several attempts as "quota exhausted" and alert someone.
How much does this save? Suppose a delivery van reports a point every 10 seconds for an 8-hour shift. That is 2,880 points. The cache is keyed by cell, not by city, so the number of misses equals the number of distinct cells visited. A van that drives a long route touches many cells, and a 150 km route could plausibly cross on the order of a thousand or more of them. If you want fewer calls, round to two decimals (about 1.1 km) when a city-level label is all you need. The trade-off is that points near a city boundary may get the neighbouring town's label. Pick the rounding that matches how precise your report has to be.
Two details to handle. First, if your points come in as strings, convert them to floats before rounding, or the key will include noise. Second, if nearest is far from the point, you are probably in a rural or ocean area. The response includes distanceKm, so you can decide that anything over, say, 50 km is "no nearby place" and label it that way instead of printing a town the user cannot see.
Running many lookups without hitting the rate limit
Every plan allows 10 requests per second. A bulk job that fires hundreds of requests in parallel will see 429 responses. A simple limiter in front of a small thread pool keeps you under the line:
import threading
import time
from concurrent.futures import ThreadPoolExecutor
class RateLimiter:
def __init__(self, per_second):
self.interval = 1.0 / per_second
self.lock = threading.Lock()
self.next_time = 0.0
def wait(self):
with self.lock:
now = time.monotonic()
if now < self.next_time:
time.sleep(self.next_time - now)
now = time.monotonic()
self.next_time = now + self.interval
limiter = RateLimiter(8) # stay a bit under the 10 requests per second limit
def fetch_city(point):
lat, lon = point
limiter.wait()
r = requests.get(
f"{BASE}/v1/geo/reverse",
headers=HEADERS,
params={"lat": lat, "lon": lon},
timeout=15,
)
r.raise_for_status()
d = r.json()
return (lat, lon), (d.get("nearestMajorCity") or d.get("nearest"))
def bulk(points):
unique = sorted(set(points))
with ThreadPoolExecutor(max_workers=4) as pool:
return dict(pool.map(fetch_city, unique))
Deduplicating before you start (set(points)) is the largest saving. Combine it with the cell rounding above and a daily job over a large fleet often needs only a small fraction of the calls you would expect from the raw row count. How small depends on how repetitive your routes are, so measure it on your own data.
Cleaning coordinates before you pay for a call
Every call costs money, and a surprising share of bad calls come from bad input. A few checks in front of the API pay for themselves quickly. Reject anything that is not a finite number. Reject latitudes outside -90 to 90 and longitudes outside -180 to 180. Treat exactly 0, 0 as missing data: it is a point in the Gulf of Guinea that shows up in logs whenever a device had no GPS fix and wrote zeros, and a nearest-place lookup on it tells you nothing useful about where the device was. Drop points with a stated accuracy radius worse than what your report needs, because a 2 km error turns a neighbourhood label into a guess.
import math
def clean(lat, lon, accuracy_m=None, max_accuracy_m=500):
try:
lat, lon = float(lat), float(lon)
except (TypeError, ValueError):
return None
if not (math.isfinite(lat) and math.isfinite(lon)):
return None
if not (-90 <= lat <= 90 and -180 <= lon <= 180):
return None
if lat == 0 and lon == 0:
return None
if accuracy_m is not None and accuracy_m > max_accuracy_m:
return None
return lat, lon
Run every point through that function, count how many it rejects, and keep the count. A sudden jump in rejected points is usually a bug in a device firmware release, and you want to see it in a dashboard before it shows up as a strange spike in "Gulf of Guinea" rides.
Worked example: labelling a week of ride events
Here is the arithmetic for a job most teams eventually run. The numbers are assumptions for illustration, not data from a real customer. A small ride-hailing startup logs 12,000 trip start events in a week, each with a latitude, a longitude and a UTC timestamp. The product team wants a weekly report of trips per city and the local hour of day for each trip.
First, clean the points with the function above. Say 150 are rejected for missing fixes or poor accuracy, which leaves 11,850. Next, round each remaining point to three decimals and count distinct cells. Trips cluster around stations, airports and busy streets, so the number of distinct cells is usually far smaller than the number of trips. Suppose it comes out at 1,900. That is the number of API calls you need, not 12,000.
At the pay-as-you-go price of $0.0005 per successful call, 1,900 misses cost $0.95. If a later run reuses valid cached cells, only misses need new requests. The actual bill depends on new cells, cache expiry and data changes; no particular weekly cost or hit rate is guaranteed.
Store the labels in a table keyed by cell, then join the trips to it in SQL:
SELECT c.name AS city,
c.country_code,
COUNT(*) AS trips
FROM trips t
JOIN city c
ON c.cell = printf('%.3f,%.3f', round(t.lat, 3), round(t.lon, 3))
WHERE t.started_at >= date('now', '-7 day')
GROUP BY c.name, c.country_code
ORDER BY trips DESC;
For the local hour, read each trip's timezone from the same join and convert in your application with the zone name, as shown in the next section. Doing that conversion in the database works too if your engine has IANA zone support, but doing it in application code keeps the logic in one place.
Using the time zone
Every place record carries an IANA time zone, such as Europe/Madrid. That turns a UTC timestamp from a device into the local time where the event happened, which is what most analytics and customer-facing screens want.
from datetime import datetime, timezone
from zoneinfo import ZoneInfo
def local_time(utc_iso, tz_name):
dt = datetime.fromisoformat(utc_iso.replace("Z", "+00:00")).astimezone(timezone.utc)
return dt.astimezone(ZoneInfo(tz_name))
city = {"name": "Madrid", "timezone": "Europe/Madrid"}
print(local_time("2026-11-02T14:30:00Z", city["timezone"]))
Using the zone name, not a fixed offset, is the important part. Daylight saving changes the offset during the year, and the IANA database handles it. Do not store "+01:00" as the zone for a place. Store Europe/Madrid and compute the offset for each timestamp.
In Node.js the built-in Intl.DateTimeFormat does the same job:
function localTime(utcIso, timeZone) {
return new Intl.DateTimeFormat("en-GB", {
timeZone,
dateStyle: "medium",
timeStyle: "short",
}).format(new Date(utcIso));
}
console.log(localTime("2026-11-02T14:30:00Z", "Europe/Madrid"));
City-level or street-level reverse geocoding
The City Geocoding API is the cheap answer to "which town is this". It is the wrong answer to "which building is this". Other API.market listings cover street-level work, and picking the right one is mostly about what you will show or store. The comparison below uses each listing's own documentation and plan data as returned on 2026-11-17. It is a comparison of documented offers, not a benchmark: we did not run the other listings, and a listing supports its own terms, not those of the others.
| City Geocoding (tidydata) | Trueway Geocoding | Geocoding API (quotalink) | |
|---|---|---|---|
| Listing | tidydata/city-geocoding | trueway/geocoding | quotalink/geocoding-api |
| Reverse result | Nearest place, nearest major city, alternatives | Documented: address list with street, house number, postal code, type and location type | Tool list includes a reverse endpoint (latitude, longitude); the listing text documents only forward name search, so the reverse output is unverified |
| Street and house number | No | Yes, in the documented response | Not documented |
| Time zone in result | Yes | Not in the documented sample | Yes, in the documented forward search |
| Free offer | None; pay as you go from $0.0005 per call | 5,000-call Basic trial, hard limit, one-time | 100-call Free trial, hard limit, one-time |
| Paid entry | Pro $4.99 for 25,000, hard limit | Pro $49 for 100,000, soft limit | PRO $9.99 for 10,000, soft limit, overage billed per call |
The free offers on hard-limit plans are finite trials. Do not read them as a monthly allowance that refills. Once a trial is used up, the next step is a paid plan.
If you need a street address, the Trueway listing documents a ReverseGeocode operation. Its location parameter takes the coordinate as one lat,lng string, and the sample response is a list of results, each with an address, postal_code, street, house, a location_type (exact, approximate or centroid) and a type. Here is the documented request shape. We have not run it:
curl -X GET "https://api.magicapi.dev/api/v1/trueway/geocoding/GeocodingService/ReverseGeocode?location=37.7879493%2C-122.3961974&language=en" \
-H "accept: application/json" \
-H "x-api-market-key: $API_MARKET_KEY"
That is a different shape from the city API, and it is priced for street-level work: the entry paid plan is $49 a month for 100,000 calls on a soft limit. The listing plan data does not state the overage rate, so check it before you rely on a soft limit as a safety net.
A reasonable split for a product that does both:
- Use the city API for everything that is a label, a grouping key or a time zone.
- Use a street-level API only on the user actions that really need an address, like confirming a pickup point.
That split matters for cost. If a ride app reverse geocodes a location every 5 seconds to update a label, nearly all of those calls are label updates, and they can all go through the cheaper city endpoint.
Which listing for which job
Think about what the output will be used for, not which API sounds most capable. If a person will read it as a place name, or a report will group by it, the City Geocoding listing is enough. If a driver has to find a door, you need a street-level result such as the one Trueway Geocoding documents, and you should read its location_type field so you know whether the point is exact or only approximate. The quotalink Geocoding API is documented as a forward place-name search over OpenStreetMap-derived data, with a one-time 100-call free trial. If you want to see what its reverse tool returns, a trial call on a handful of your own coordinates is the way to find out, because the listing text does not describe the output.
The opposite direction, going from a typed US street address to coordinates, is a different job again. For that, see the AireLit geocode listing. It is documented as US-only, with a Free plan of 500 calls (a hard-limit trial) and paid plans from $9 a month. Many products need both directions: forward geocoding when a user types an address, and the city-level reverse lookup from this guide when the app later logs where the phone actually was.
A practical way to decide is to take 50 real coordinates from your own data, run them through each listing you are considering, and read the results side by side. You are looking for three things: whether the label is the one your users would use, whether the response has the fields you need without extra parsing, and how often the nearest place is surprising. Fifty calls cost about two and a half cents on the City API's pay as you go plan, and the exercise settles most arguments faster than reading plan tables.
The error you will hit first
Send a coordinate that is not a number, or one out of range, and you get a 400. The test call with lat=abc returned:
{"error": "lat must be a number between -90 and 90"}
The usual cause is swapped latitude and longitude. Latitude goes from -90 to 90, longitude from -180 to 180. A pair like -122.4, 37.8 is longitude first, and a latitude of -122.4 fails range validation. Not every swap fails, though. A pair such as 40.4, -3.7 swapped to -3.7, 40.4 is still valid and will quietly return a place in the wrong hemisphere, so validate that your input order is what you think it is.
Other status codes you should handle:
| Code | Meaning | What to do |
|---|---|---|
| 400 | Missing or invalid parameter | Check the body, fix the value |
| 401 | Key missing, invalid or expired | Check the x-api-market-key header |
| 403 | Plan does not include this endpoint | Check your plan |
| 404 | Item or path does not exist | Check the path against the listing |
| 429 | Over 10 requests per second, or monthly quota used | Back off and honour Retry-After; on Pro or Ultra a quota 429 lasts until the next billing period |
| 500 | Something failed on the provider side | Retry after a short delay |
The 400 above is recorded in the historical quickstart. The meanings of the other codes are the ones the listing documents; we did not trigger them.
Edge cases to plan for
Open water and remote areas. The data is a set of populated places, so a point in the middle of an ocean or a desert still gets an answer: the nearest listed place, which may be very far away. Look at distanceKm and apply a cutoff.
Boundary points. A coordinate near a district line can resolve to a different neighbourhood from one 50 meters away. If a flip-flopping label would look bad in a UI, cache by cell and keep the first answer for a session.
Disputed or renamed places. Names come from GeoNames, which is a community-maintained dataset. A place can have a historical name or a variant spelling. If your product shows names to people in a particular country, spot-check the labels for the places that matter most.
Large cities split into districts. As in the Madrid example, nearest can be a district. If your reports count "Madrid" rides, group by nearestMajorCity or by the city name you pick, not by the raw nearest place.
Precision of the input. Phones and browsers report coordinates with different accuracy, and a poor GPS fix can be hundreds of meters off. Rounding to three decimals does not fix a bad fix. If your source gives an accuracy radius, drop low-accuracy points before geocoding.
Two things to remember in production
Show the attribution. Place data comes from GeoNames under CC BY 4.0, which requires credit. Every response carries an attribution string you can print in your app footer or about page. The listing does not spell out terms for storing results beyond that attribution requirement, so if you plan to keep the labels in your own database long term, read the GeoNames licence terms yourself.
Cache by rounded coordinates. Cities do not move. If you reverse geocode a stream of GPS points, round to three decimals (about 100 meters) and cache the result. You will cut your call count, and at $0.0005 a call on pay as you go that adds up at volume.
Pricing math for real volumes
Plan prices are easy to read, so here is what they mean for a few jobs. These are worst cases with no caching, which you should not run in production. The call counts are assumptions for illustration.
| Job | Calls per month | Pay as you go | Plan that fits | Cost |
|---|---|---|---|---|
| Hobby app, 50 users, a few lookups each per day | about 5,000 | $2.50 | PAYG | $2.50 |
| Small fleet, 20 vehicles, 1 lookup per minute, 8 hours a day, 22 days | about 211,000 | $105.60 | None of the fixed plans (Ultra caps at 150,000) | $105.60 on PAYG, or cache first |
| Analytics enrichment of 500,000 events once | 500,000 | $250 | None | $250 on PAYG, or cache first |
| City picker with 30,000 searches a month | 30,000 | $15.00 | Ultra | $14.99 on Ultra, about the same as PAYG |
Check the arithmetic on the fleet row: 20 vehicles times 60 lookups an hour times 8 hours times 22 days is 211,200 calls, and at $0.0005 that is $105.60. Because Pro and Ultra are hard-limit plans, a month with more calls than the plan includes does not turn into an overage bill. It turns into 429 responses until the next period. That is why the fleet row has no fixed plan that fits.
Where Pro starts to win: Pro at $4.99 includes 25,000 calls, about $0.0002 each when fully used. PAYG at $0.0005 a call costs $4.99 at roughly 10,000 calls, so Pro is cheaper from there up to its 25,000 cap. Ultra at $14.99 for 150,000 calls is about $0.0001 each when fully used and beats PAYG from roughly 30,000 calls a month. Between 25,000 and 30,000 calls, PAYG is the cheaper of the two, since Pro is capped and Ultra has not caught up yet.
Caching changes the picture more than any plan choice. Take the small fleet row: 211,000 raw lookups. With cell rounding at three decimals and a repeat route, a fleet may need a small fraction of that. If it came down to around 20,000 calls, that would fit on Pro for $4.99. That 20,000 figure is an illustration, not a measurement. With two-decimal rounding it can be lower still. The honest advice is to measure your cache hit rate on a week of real data before you pick a plan.
Troubleshooting
I get a neighbourhood when I wanted the city. Read nearestMajorCity, or set minPopulation=100000. Both are covered above.
My search returns the wrong Salamanca. Add country=ES and show region in the results. Results are sorted by population, not by what your user means.
Everything returns 429 after a burst. You went over 10 requests per second or used up your quota. Add the limiter above, then check usage on your account page. If you are on Pro or Ultra and the quota is gone, calls keep failing until the next billing period.
A 402 on pay as you go. The wallet balance is empty. Top up at the billing page linked in the pricing section.
The label is wrong for a coordinate in the middle of nowhere. Check distanceKm. The API returns the nearest known place, not a statement that you are in it.
Time zone looks off by an hour twice a year. You stored an offset instead of the IANA zone name. Store the name and compute the offset per timestamp.
Latitude and longitude seem swapped. They probably are. Latitude first in this API's lat and lon parameters. Some libraries and file formats (GeoJSON) put longitude first.
A lot of trips are labelled with one faraway town. Look for 0, 0 coordinates and for points with a poor accuracy radius. The cleaning function above rejects both before they reach the API.
Frequently asked questions
Does it return street addresses? No. It returns the nearest populated place, region and country. For streets, see the Trueway listing in the comparison table.
How many places are in the data? 171,000 populated places, from GeoNames.
What is the maximum radius for nearby? 500 km, with 1 to 100 results sorted by distance.
Do I have to credit GeoNames? Yes. The data is CC BY 4.0, and every response includes an attribution line you can show.
Is there a free plan? No. Pay as you go has no monthly fee and charges $0.0005 per successful call, so testing costs very little.
What happens when I pass the plan quota? On Pro and Ultra the listing says further calls return 429 until the next billing period. Pay as you go has no quota.
Can I send a batch of coordinates in one request? The listing documents single-point endpoints, so a batch is a loop on your side. Use the rate limiter and the cell cache above.
Can I use it from an AI agent? The listing exposes three tools (reverse, search and nearby) in the API.market MCP server, called with the same key.
How fresh is the data? The listing does not state an update schedule. Place names and populations change slowly, which is why long cache times are reasonable.
Can I get the time zone without the city? The time zone comes as part of the place record, so you call reverse geocode and read the timezone field.
Which plan to pick
If you are testing, pay as you go costs nothing until you call. At 25,000 calls a month, Pro at $4.99 works out to about $0.0002 a call, so it beats pay as you go once you pass roughly 10,000 calls a month, up to its 25,000 cap. Between 25,000 and about 30,000, stay on pay as you go. From about 30,000 up to 150,000, Ultra at $14.99 is cheapest. Beyond 150,000 a month the fixed plans stop, so you are on pay as you go at $0.0005 a call, or you contact the seller about a larger arrangement.
Ready to try it? Subscribe on the City Geocoding API page, grab your key, and run the curl call above.

