API / Search Detail
GET /search/detail/{id}

Search Detail API.

Fetch the full place record including GeoJSON geometry for any result by document ID.

Called after a user selects a result from Search or Reverse Search. Returns the complete document with GeoJSON geometry polygon, linestring, or point suitable for rendering a shape on the map, drawing a building footprint, or highlighting a street segment. All structured address fields included.

Part of the Search API family alongside Search and Reverse Search.

API OPERATIONAL · View status
# Fetch full record + GeoJSON geometry by document ID
curl "https://api.farun.one/search/detail/way%2F123456789" \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -H "X-RapidAPI-Host: farun-maps.p.rapidapi.com"

# ID comes from the `id` field of any Search or Reverse Search result
# URL-encode the slash: way/123456789 → way%2F123456789

Trigger

On result selection

Geometry

Full GeoJSON included

ID source

Search or Reverse Search

How place detail lookup works

Call once. Get the full record, geometry included.

Search and Reverse Search deliberately exclude the geometry field from list results to keep response payloads small and latency low. Search Detail is the dedicated endpoint to fetch the complete document including GeoJSON polygon, linestring, or point for exactly the record the user selected.

Step 1

Select a result

A user types an address in your search field and selects one of the autocomplete suggestions, or taps a point on the map and picks from the reverse geocode results. At this point you have a result ID.

ID format: way/123, node/456, relation/789

Step 2

Fetch by document ID

Pass the result's id field to GET /search/detail/{id}. The API performs a direct document GET against Elasticsearch a single-key lookup with no query parsing overhead, returning the full stored record.

Direct ES document GET - no scoring, no fan-out.

Step 3

Render geometry on the map

The response includes a geometry field containing the full GeoJSON Feature - Polygon for areas and buildings, LineString for streets and roads, Point for nodes and POIs. Pass it directly to your map library as a source.

Types: Polygon, LineString, Point, MultiPolygon.

Who uses it

When a pin isn't enough, draw the shape.

A coordinate tells you where something is. A polygon tells you what it covers. Search Detail is for any product that needs to highlight a building footprint, shade a suburb boundary, render a street segment, or confirm the exact extent of an address rather than just placing a pin.

Property & Real Estate

Render building footprints and cadastral boundaries

When a user selects a property from an autocomplete search, fetch its full polygon and draw the building footprint or cadastral boundary on the map. Gives buyers and agents precise spatial context beyond a centre-point pin.

Logistics & Fleet

Highlight delivery zones and suburb boundaries

After a dispatcher confirms a delivery suburb, fetch its polygon to shade the zone on the dispatch map. Operators see at a glance which suburb a job falls within and can verify the correct service region before dispatching.

Insurance & Risk

Confirm property polygon for spatial risk scoring

Resolve a declared address to its GeoJSON polygon, then overlay flood, wildfire, or crime risk raster layers to perform spatial intersection scoring. The geometry is the missing link between an address string and actual coverage area.

Map & Navigation UX

Highlight selected street segment or POI shape

When a user picks a street or place from a search dropdown, fetch the geometry and render a highlighted linestring or polygon to confirm the selection visually. Users immediately understand what they selected without reading an address label.

Response shape

Complete structured address plus full GeoJSON geometry.

Every field from the Search API response is present, plus the geometry field - the GeoJSON Feature containing the full spatial shape of the record. Pass it directly to Mapbox GL, MapLibre, Leaflet, or any GeoJSON-compatible map renderer.

  • id Document ID - same value used in the request path
  • doc_type address · street · place · poi
  • display_name Full human-readable address label
  • name Place or POI name (if applicable)
  • housenumber House or unit number component
  • street Street name
  • suburb Suburb or neighbourhood
  • city City
  • postcode Postal code
  • province Province or state
  • country ISO 3166-1 alpha-2 country code (e.g. ZA)
  • location {"lat": float, "lon": float} - centroid of the record
  • geometry Full GeoJSON Feature - Polygon, LineString, or Point
  • osm_id OpenStreetMap element ID
  • wikidata Wikidata QID (for named places, where available)
  • category Place category or highway classification
  • brand / phone For POIs: brand name and phone number where available
GET /search/detail/way%2F123456789 200 OK
{
  "id":           "way/123456789",
  "doc_type":     "street",
  "display_name": "Bree Street, Cape Town City Bowl, 8001",
  "street":       "Bree Street",
  "suburb":       "Cape Town City Bowl",
  "city":         "Cape Town",
  "postcode":     "8001",
  "province":     "Western Cape",
  "country":      "ZA",
  "location": { "lat": -33.9249, "lon": 18.4241 },
  "osm_id":       "123456789",
  "wikidata":     null,
  "geometry": {
    "type":       "Feature",
    "geometry": {
      "type":        "LineString",
      "coordinates": [
        [18.4235, -33.9261],
        [18.4241, -33.9249],
        [18.4248, -33.9233]
      ]
    },
    "properties": {}
  }
}

The geometry field is a valid GeoJSON Feature. Pass directly to map.addSource() in Mapbox GL or MapLibre.

Endpoint reference

GET https://api.farun.one/search/detail/{id}

Path parameters

id req
string
URL-encoded document ID from a Search or Reverse Search result. Example: way%2F123456789 (encode the slash).

Response codes

200 application/json Full document with all address fields and GeoJSON geometry.
404 Not found No document found for the given ID.
401 Unauthorized Missing or invalid RapidAPI key.
429 Rate limited Daily pool exhausted. Upgrade on RapidAPI.
503 Unavailable Search backend unavailable.

Lookup type

Direct document GET - no query

Geometry

Full GeoJSON Feature included

Geometry types

Polygon, LineString, Point

ID source

Search or Reverse Search result

When to call

On user selection only

ID encoding

URL-encode slashes in the ID

Integration example

Search → select → render geometry - JavaScript JavaScript
// Step 1: render search dropdown from /search results
const results = (await searchApi(inputValue)).results;
renderDropdown(results);

// Step 2: user selects a result - NOW call Search Detail
async function onSelect(result) {
  const encoded = encodeURIComponent(result.id);
  const detail  = await fetch(
    `/api/detail-proxy/$${encoded}`  // server-side proxy
  ).then(r => r.json());

  // Step 3: render geometry on the map
  if (map.getSource("selected")) {
    map.getSource("selected").setData(detail.geometry);
  } else {
    map.addSource("selected", {
      type: "geojson",
      data: detail.geometry,
    });
    map.addLayer({
      id:     "selected-fill",
      type:   "fill",
      source: "selected",
      paint:  { "fill-color": "#f97316", "fill-opacity": 0.25 },
    });
  }
}

Always proxy server-side. Never call the API directly from client-side JavaScript, your RapidAPI key would be exposed. Route all requests through your own backend endpoint.

Search API family

Often used together

Start building

From address string to map polygon
in two API calls.

Free tier on RapidAPI. 1,000 requests per day across all non-tile APIs combined. No credit card required.