API - Places at GPS coordinates on the API servers (reverse_geo)

Geolocation

Turns GPS coordinates into the places they are in, up to 50 pairs in one call, with the batch answer of nearby_places.

Endpointhttps://api.opensolr.com/solr_manager/api/reverse_geo
MethodGET or POST, a JSON body works too
Authemail and api_key of your account, as GET or POST parameters: Authentication.

01 · Parameters

coordsOne of the two

lat,lon, or up to 50 pairs separated by ;, or an array.

lat, lonOne of the two

One pair as two fields.

withinOptional

The radius in km, 1 to 100. Default 25.

02 · Example

curl -s "https://api.opensolr.com/solr_manager/api/reverse_geo?email=YOUR_EMAIL&api_key=YOUR_API_KEY&coords=48.8566,2.3522;52.5163,13.3777"

03 · Answer

{
    "status": true,
    "contract_version": 1,
    "within_km": 25,
    "count": 2,
    "results": {
        "48.8566,2.3522": {
            "status": true,
            "contract_version": 2,
            "nearest": {
                "place": "Paris 04",
                "city": "Paris",
                "country_code": "FR",
                "distance_km": 0.4
            },
            "places": [
                "..."
            ]
        },
        "52.5163,13.3777": {
            "status": false,
            "msg": "ERROR_GEO_NO_DATA"
        }
    }
}

Always the batch answer, even for one pair, keyed by the pair rounded to four decimals. Each entry is the answer of nearby_places for one pair. Values shown are an example.

This endpoint always answers HTTP 200: read the status of each entry.

04 · Errors

ERROR_INVALID_COORDSHTTP 200

No usable pair. The answer carries max_coords.

ERROR_GEO_NO_DATA, ERROR_GEO_LOOKUP_UNAVAILABLEHTTP 200

In one entry: nothing within the radius, or the lookup failed.

WRONG_API_HOSTHTTP 404

Called on opensolr.com. The answer carries the right URL.

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.

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.