A free, open-source API providing live location data for Tanzania. Use it locally or via our hosted solution.
Explore on GitHub Try the APIThe Locations API is an open-source project by HackEAC, designed to provide accurate and up-to-date location data for Tanzania. Whether you're building a mapping app, logistics platform, or need geospatial data, this API has you covered.
Check out the project on GitHub and contribute to its development!
Follow these steps to set up the API on your local machine:
git clone https://github.com/HackEAC/locations-api.git.env file and copy variables from sample.env..env file.npm installnpm run start:dev or production mode: npm run start:prodUse tools like Postman, HTTPie, or curl to test the API locally.
# Example curl request
curl http://localhost:3000/v1/locations
Access our hosted solution at api.locations.co.tz/v1.
Make HTTP requests to the API endpoint to retrieve location data. No setup required!
# Example curl request to hosted API
curl https://api.locations.co.tz/v1/locations
Note: The hosted API is free to use but may have rate limits. Check the documentation for details.
The Locations API makes it easy to build powerful navigation apps by providing accurate, structured location data for Tanzania. Below are three examples demonstrating how the API simplifies location selection compared to manual input.
Use dropdowns to select a region, district, and ward. The API dynamically loads the correct options, ensuring accuracy.
Search for any location in Tanzania by typing a query (e.g., 'Nzuguni' or 'Dodoma Mahomanyika'). Refine your search by adding more terms.
No localisation selected. Please search and select a location.
Try typing region, district, and ward names manually. Notice how easy it is to make mistakes or use inconsistent names.
Manual input leads to errors like typos or inconsistent names (e.g., "Arusha" vs. "Arusha Region"). The Locations API provides structured, accurate data, ensuring your navigation app delivers reliable results. Whether you're building a ride-sharing app, delivery service, or mapping tool, the Locations API is the key to precise location services.
Explore the GitHub repository or try the hosted API to get started!
Explore the code, contribute, or start using the API today!
Visit GitHub Repo Try Hosted API