API - Find Places by Name (place_search)

Geolocation

Finds places by name, or by the first letters someone types: coordinates, region and country of each match, best first.

Endpointhttps://opensolr.com/solr_manager/api/place_search
MethodGET or POST
Authemail and api_key of your account, as GET or POST parameters: Authentication.

01 · Parameters

qRequired

The name or its beginning, up to 80 characters.

countryOptional

A two-letter country code, to search in one country only.

limitOptional

How many places, 1 to 25. Default 10.

02 · Example

curl -s "https://opensolr.com/solr_manager/api/place_search?email=YOUR_EMAIL&api_key=YOUR_API_KEY&q=zala&country=RO&limit=3"

03 · Answer

{
    "status": true,
    "contract_version": 1,
    "q": "zala",
    "country_code": "RO",
    "count": 1,
    "places": [
        {
            "place": "Zalau",
            "country_code": "RO",
            "lat": 47.2,
            "lon": 23.05,
            "kind": "city",
            "region": "Salaj",
            "country": "Romania",
            "population": 52359
        }
    ]
}

kind is city, region, country or address.

Only place, country_code, lat and lon are sure; the other fields are left out when not known.

Values shown are an example.

04 · Errors

ERROR_NO_QUERY_SUPPLIEDHTTP 400

q is empty.

ERROR_GEO_NO_DATAHTTP 404

No place by that name.

ERROR_GEO_LOOKUP_UNAVAILABLEHTTP 503

The place data could not be asked. Retry later.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds.

It never uses the AI allowance.

05 · Related

Many addresses at once, on api.opensolr.com: address_geo. Postal codes: postal_codes.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.