Geofencing API

Know when people arrive, leave or stay.

Send a location and get back the geofences it's in and what changed since the last one. Enter, exit and dwell events go to your webhooks, signed so you can trust them. Geofences can be circles, polygons, or the area someone can reach in ten minutes on foot.

What you get

  • Circles, polygons and isochrones

    Draw them, upsert them by tag and externalId, or give an address instead of coordinates. Isochrones cover 1 to 60 minutes by foot, bike, car, truck or motorbike, computed once with Valhalla.

  • Geofences from where your data is

    Import GeoJSON or CSV (10,000 rows at a time), KML or zipped Shapefiles, or sync a PostGIS table so polygons follow your own data (Pro).

  • Events you can act on

    Entered, exited and dwelled, with a confidence of 1 to 3 that allows for GPS accuracy. Stop detection, buffered entries and exits, and a maximum accuracy keep noisy fixes from firing events.

  • Rules per geofence

    Operating hours in a time zone, temporary geofences that disable or delete themselves, restrictions to certain users or IPs, a dwell time, and up to 16 metadata keys you can filter on.

  • Lookups without state

    Ask which geofences contain a point, check one geofence, search near a point by tag, or list who is inside a geofence now.

  • Webhooks and privacy

    HMAC-SHA256 signatures and three delivery attempts. Mark events accepted or rejected, and delete a user with all their events and trips for privacy requests.

Try it

Copy this, swap in a key from your project, and run it.

Request
curl https://api.mapsocket.com/v1/track \
  -H "Authorization: pk_live_…" -H "Content-Type: application/json" \
  -d '{"userId":"driver-118","latitude":40.7411,"longitude":-73.9897,"accuracy":12}'
Response
{
  "user": { "userId": "driver-118", "geofenceIds": ["9c1e5a40-…"] },
  "events": [{
    "type": "user.entered_geofence",
    "geofence": { "tag": "loading-bay", "externalId": "flatiron-02" },
    "confidence": 3
  }]
}

On each plan

Limit SandboxStarterProEnterprise
Geofences 1005,000100,000Unlimited
Tracked users / month 1005,00050,000Unlimited
Geofences synced from PostGIS NoNoYesYes

Full limits and prices on the pricing page.

Good to know

  • There's no mobile SDK yet. Your app sends locations to /v1/track itself; background location and beacon ranging are the app's job.
  • An isochrone is computed once, when it's saved. It doesn't follow live traffic.

Read more