api_key query parameter, which is where the API expects it.
Things to know before you call:
- v2.1 is the current version. A live probe of v1.9 answered with a
_warningsentry saying a newer version exists, so the plugin targets v2.1 and does not produce that warning. - A bad key answers 403, not 401. A live probe returned
{"error":"Invalid API key","reference":"https://www.geocod.io/geocodio-403-forbidden-error/"}with HTTP 403. HTTP errors arrive as core’sApiError, with that envelope (minus the address sent) onerror.body. - A result always carries its confidence.
accuracyis 0 to 1,accuracy_typesays how the match was made (rooftop,range_interpolation,nearest_street,place) andmatch_typesays whether it was exact. A caller that ignores those treats a street centroid like a rooftop. - The components are parsed for you.
address_componentssplits the result intostreet,city,state_province,postal_code,countryandnation, so nothing has to re-parseformatted_address. - Batches are one request, not a loop.
geocode.batchandgeocode.batchReversetake up to 10,000 entries in a single POST and answer aresultsarray in the order they were sent. Each entry holds thequeryand its ownresponse.results. A failed batch is not retried, since its lookups may already be billed. parsecosts no lookup. It splits an address without geocoding it, which is the cheap way to clean data before spending lookups on it.- Distances come in two flavours.
drivingfollows roads and returns a duration;straightlineandhaversineare the as-the-crow-flies distance with no duration. Distances come fromdistance.fromOriginanddistance.matrix, which both accept all three modes; the geocode calls take no distance option. - An enterprise host exists. Pass
enterprise: trueongeocode.forward,geocode.reverse,geocode.batch,geocode.batchReverseanddistance.fromOriginto useapi.enterprise.geocod.ioinstead of the self-serve host.geocode.parse,distance.matrixand the jobs and lists calls always use the self-serve host. - Uploading a spreadsheet is not included. That route needs a multipart file upload;
lists.all,lists.getandlists.deleteare here so an existing list can be tracked, but a new one has to be uploaded from the dashboard.
- 13 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Geocodio API key before the first call: More: API Key
pnpm corsair setup --plugin=geocodio --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Geocode an addressWhat’s next
API reference
Every
geocodio.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.