# What is Geofencing?
Geofencing is a location-based service that uses GPS (RFID, Wi-Fi, or mobile data) to trigger a pre-programmed action or decision when a mobile device enters or leaves a configured virtual boundary in a geographic location, known as geofencing.
Depending on how a geofence or geofence is configured, it can request mobile push notifications, trigger text messages or alerts, send targeted ads on social media, enable vehicle fleet tracking, disable certain technology, or deliver marketing data based on the Location.
Some geofences are set up to monitor activity in secure areas, allowing management to see alerts when someone enters or leaves a specific area. Businesses can also use geofencing to monitor employees in the field, automate time cards, and keep track of company property.
# Important
This document describes the Geofencing API web service. It is intended for website and mobile developers who want to use Geofencing data in maps provided by one of the Geodir platform APIs.
Before you start developing with the Geofencing API, review the authentication requirements (needs an API key) .
# Geofencing API
The following Geofencing requests are available:
- Geofencing LatLon returns the variables with crime level of the requested location latitude, longitude.
Each of the services is accessed as an HTTP request and returns a JSON or XML response. All requests to a Geofencing service must use the https:// protocol and include an API key.
The Geofencing API uses a Unique Identification Code (grid_code) to uniquely identify an area of information.
# Geofencing API Request Format
A Geofencing API request has the following form:
https://apis.geodir.co/geofencing/v1/outputFormat?parameters
where outputFormat can be any of the following values:
- json (recommended) indicates output in JavaScript Object Notation (JSON); either
- xml indicates output in XML
Security is important and HTTPS is recommended whenever possible, especially for applications that include sensitive user data, such as a user's location, in requests. Using HTTPS encryption makes your application more secure and more resistant to eavesdropping or tampering.
Note: URLs must be properly encoded (See best practices) to be valid and are limited to 8000 characters for all web services. Keep this limit in mind when creating your URLs. Please note that different browsers, proxies and servers may also have different URL character limits.
Some parameters are required while others are optional. As is standard in URLs, parameters are separated by the ampersand character (&).
# Terms of Use Restrictions
For information on the terms of use, see the Geofencing API Policies and the License Restrictions section of the Geodir Platform Terms of Service.