MapScale Docs
•••
Products
Product · Search & Geocoding

Search & Geocoding

Find places as users type, turn addresses into coordinates, and turn coordinates back into Thai addresses.

What you’ll achieve

Combine Autocomplete, Place Detail, Geocode and Reverse Geocode into one consistent search flow.

Choose the endpoint

Autocomplete powers interactive suggestions. Place Detail resolves a selected suggestion. Geocode is for complete addresses or batch-like server lookup. Reverse Geocode labels a clicked or GPS coordinate.

Geocode a place

Results are GeoJSON. geometry.coordinates is always [longitude, latitude]. Use bbox or proximity to make local results more relevant.

LIVE API PLAYGROUND

Sign in or create an account

Continue to run live requests directly from the docs.

Edit the inputs, send a real request, and inspect the live response.

Editable inputs

Request preview
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/geocode?q=Siam+Paragon&lang=th&limit=5"
Live response
Default response
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "place_bangkok_123",
      "text": "Siam Paragon",
      "place_name": "Siam Paragon, Pathum Wan, Bangkok",
      "geometry": {
        "type": "Point",
        "coordinates": [
          100.5348,
          13.7466
        ]
      },
      "properties": {
        "latitude": 13.7466,
        "longitude": 100.5348,
        "formattedAddress": "Siam Paragon, Pathum Wan, Bangkok 10330, Thailand",
        "street": "Rama I Road",
        "neighborhood": "Siam",
        "subdistrict": "Pathum Wan",
        "district": "Pathum Wan",
        "province": "Bangkok",
        "postalCode": "10330",
        "country": "Thailand"
      }
    }
  ]
}

A second geocode example

Same endpoint, a different query — the response shape never changes.

LIVE API PLAYGROUND

Sign in or create an account

Continue to run live requests directly from the docs.

Edit the inputs, send a real request, and inspect the live response.

Editable inputs

Request preview
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/geocode?q=Central+World&lang=th&limit=5"
Live response
Default response
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "place_bangkok_123",
      "text": "Siam Paragon",
      "place_name": "Siam Paragon, Pathum Wan, Bangkok",
      "geometry": {
        "type": "Point",
        "coordinates": [
          100.5348,
          13.7466
        ]
      },
      "properties": {
        "latitude": 13.7466,
        "longitude": 100.5348,
        "formattedAddress": "Siam Paragon, Pathum Wan, Bangkok 10330, Thailand",
        "street": "Rama I Road",
        "neighborhood": "Siam",
        "subdistrict": "Pathum Wan",
        "district": "Pathum Wan",
        "province": "Bangkok",
        "postalCode": "10330",
        "country": "Thailand"
      }
    }
  ]
}

Build a reliable search box

Debounce keystrokes, keep one session_token from the first suggestion request through Place Detail, and wait until the user selects a result before moving the map.

Next stepBuild address search

On this page