Finds postal codes and street addresses, from free text or from a country and a city.
https://api.opensolr.com/solr_manager/api/postal_codesemail and api_key of your account, as GET or POST parameters: Authentication.01 · Parameters
queryOne of the twoFree text, up to 120 characters: a postal code, 10115 Berlin, Bacau Romania.
country + cityOne of the twoA country and a city, with street, number and state if you want.
limitOptionalHow many of each kind, 1 to 50. Default 10.
02 · Example
curl -s "https://api.opensolr.com/solr_manager/api/postal_codes?email=YOUR_EMAIL&api_key=YOUR_API_KEY" --data-urlencode "query=10115 Berlin" -d "limit=3"
03 · Answer
{ "status": true, "contract_version": 1, "query": { "zip_query": "10115 Berlin" }, "postal_codes": [ { "postal_code": "10115", "place": "Berlin", "region": "Berlin", "country": "Germany", "country_code": "DE", "lat": 52.5323, "lon": 13.3846 } ], "addresses": [] }
postal_codes lists the matching codes with their place, addresses the matching street addresses. Values shown are an example.
04 · Errors
ERROR_NO_POSTAL_QUERYHTTP 200No query, and not both country and city.
ERROR_GEO_NO_DATAHTTP 200Nothing found.
ERROR_GEO_LOOKUP_UNAVAILABLEHTTP 200The data could not be asked. Retry later.
WRONG_API_HOSTHTTP 404Called on opensolr.com. The answer carries the right URL.
ERROR_AUTHENTICATION_FAILEDHTTP 403The email and API key do not match.
ERROR_RATE_LIMIT_PER_MINUTEHTTP 429Too many calls. Wait for the Retry-After seconds.
Each call counts once toward your per-minute and per-hour limits, whatever the number of items: Rate limits. Lookups never use the AI allowance.
05 · Related
Addresses to coordinates: address_geo.
Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.