Overview
Battuta offers a suite of application programming interfaces (APIs) focused on core geospatial tasks: geocoding, reverse geocoding, and IP geolocation. The Battuta documentation details how these services enable developers to integrate location intelligence into their applications. The Geocoding API converts physical addresses into precise latitude and longitude coordinates. This is useful for mapping applications, delivery services, or any system that needs to pinpoint a location on a map from a textual address. Conversely, the Reverse Geocoding API performs the opposite function, taking a set of coordinates (latitude and longitude) and returning a human-readable address, including street name, city, and country. This can be applied in scenarios like showing a user's current location on a map or associating sensor data with a specific place.
The IP Geolocation API provides location data based on an IP address, which can include country, region, city, and even postal code. This service is commonly used for personalizing content, enforcing geo-restrictions, or analyzing traffic origins. Battuta is designed for developers seeking straightforward, cost-effective solutions for these fundamental location services. Its free tier allows for experimentation and small-scale usage, while its paid plans are structured to scale with increased request volumes, making it a suitable option for projects with budget considerations. While it provides essential functionalities, developers requiring advanced features such as batch processing, complex address disambiguation, or highly specialized geospatial analytics may consider alternatives with broader feature sets.
Projects that prioritize ease of integration and a clear API structure will find Battuta to be a practical choice. The API's design focuses on delivering accurate results for common geocoding tasks without the overhead of more complex geospatial platforms. For instance, an e-commerce site might use Battuta's Geocoding API to validate customer shipping addresses during checkout or to calculate shipping zones. A mobile application could use the Reverse Geocoding API to display a user's current street address based on their device's GPS coordinates. The IP Geolocation API could help a content provider tailor language or available services based on the user's inferred country. The API's developer experience notes indicate a focus on simplicity, making it accessible for developers who need to implement location features quickly without extensive geospatial expertise.
Key features
- Geocoding API: Converts street addresses into latitude and longitude coordinates, enabling precise location plotting on maps.
- Reverse Geocoding API: Transforms latitude and longitude coordinates back into human-readable street addresses, useful for displaying location context.
- IP Geolocation API: Determines a user's geographic location (country, city, region) based on their IP address, supporting geo-targeting and analytics.
- GDPR Compliance: Adheres to General Data Protection Regulation (GDPR) standards for data privacy and handling within its operations.
- JavaScript SDK: Provides a dedicated client library for JavaScript environments, simplifying integration into web applications.
- Multiple Language Examples: Offers code examples in JavaScript, Python, PHP, and cURL to assist developers across different programming environments.
Pricing
Battuta offers a free tier and various paid plans structured around request volume. Pricing is current as of 2026-05-28.
| Plan | Monthly Requests | Monthly Cost | Features |
|---|---|---|---|
| Free | 2,500 | $0 | Geocoding, Reverse Geocoding, IP Geolocation |
| Starter | 25,000 | $10 | All Free tier features |
| Professional | 100,000 | $35 | All Starter tier features |
| Business | 500,000 | $120 | All Professional tier features |
| Enterprise | Custom | Custom | High volume, dedicated support |
For detailed pricing information and custom quotes for enterprise needs, refer to the official Battuta pricing page.
Common integrations
Battuta's APIs can be integrated into various applications and workflows. Its core functionality lends itself to web and mobile development where location services are required.
- Web Applications: Use the JavaScript SDK or direct API calls to embed location search and display capabilities into websites. For example, a real estate portal could use geocoding to plot properties on a map, similar to how Google Maps Platform APIs are used for location visualization.
- Mobile Applications: Integrate geocoding and reverse geocoding to enhance user experience in location-aware apps, such as ride-sharing or local search utilities.
- E-commerce Platforms: Validate shipping addresses or calculate distances for delivery services using geocoding APIs.
- Data Analysis and Business Intelligence: Enrich datasets with geographic coordinates or location names derived from IP addresses for market segmentation or logistical planning.
- CRM Systems: Automatically populate location fields for customer records based on addresses or IP data, improving data accuracy within platforms like Salesforce documentation.
Alternatives
Developers seeking geocoding and IP geolocation services have several alternatives, each with distinct features and pricing models.
- OpenCage: Offers global geocoding and reverse geocoding, emphasizing open data sources and a transparent pricing model.
- LocationIQ: Provides geocoding, reverse geocoding, and routing APIs, often highlighting its affordability and generous free tier.
- Geocodio: Specializes in U.S. and Canadian geocoding and reverse geocoding, known for its focus on data quality and batch processing capabilities.
- Google Maps Platform Geocoding API: A comprehensive solution from Google offering global coverage and robust features, often preferred for applications already within the Google ecosystem.
- ArcGIS Geocoding Service: Esri's geocoding solution, offering advanced capabilities for geographic information systems (GIS) and enterprise mapping.
Getting started
To begin using Battuta, you typically sign up for an API key on their website. The following JavaScript example demonstrates how to perform a simple geocoding request using the Battuta Geocoding API.
// Replace 'YOUR_API_KEY' with your actual Battuta API key
const API_KEY = 'YOUR_API_KEY';
const ADDRESS = '1600 Amphitheatre Parkway, Mountain View, CA';
async function geocodeAddress(address) {
try {
const response = await fetch(
`https://battuta.io/api/geocode?address=${encodeURIComponent(address)}&key=${API_KEY}`
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('Geocoding Result:', data);
if (data && data.length > 0) {
const firstResult = data[0];
console.log(`Latitude: ${firstResult.lat}, Longitude: ${firstResult.lon}`);
} else {
console.log('No results found for the given address.');
}
} catch (error) {
console.error('Error during geocoding:', error);
}
}
// Call the function to geocode an address
geocodeAddress(ADDRESS);
// Example for reverse geocoding (assuming you have coordinates)
const LATITUDE = 37.422; // Example Latitude
const LONGITUDE = -122.084; // Example Longitude
async function reverseGeocodeCoordinates(lat, lon) {
try {
const response = await fetch(
`https://battuta.io/api/reverse-geocode?lat=${lat}&lon=${lon}&key=${API_KEY}`
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('Reverse Geocoding Result:', data);
if (data && data.address) {
console.log(`Address: ${data.address.road}, ${data.address.city}, ${data.address.country}`);
} else {
console.log('No address found for the given coordinates.');
}
} catch (error) {
console.error('Error during reverse geocoding:', error);
}
}
// Call the function to reverse geocode coordinates
reverseGeocodeCoordinates(LATITUDE, LONGITUDE);
This JavaScript code snippet demonstrates how to make asynchronous requests to Battuta's Geocoding and Reverse Geocoding APIs. It first defines an API key and an example address for geocoding. The geocodeAddress function fetches data from the Battuta geocoding endpoint, parses the JSON response, and logs the resulting latitude and longitude. Similarly, the reverseGeocodeCoordinates function takes latitude and longitude to retrieve a human-readable address. Remember to replace 'YOUR_API_KEY' with your actual API key obtained from the Battuta website. Further details on API parameters and response formats are available in the Battuta API reference.