This is a Laravel project as a backup for Nominatim which has a usage limit. because of this limit, we often encounter problems in our applications. The hope is that this can be developed again.
This API is used to search for data based on several parameters such as search, street, city, county, state, country, and postalcode. This endpoint will return search results according to the criteria provided via query parameters.
The following are the query parameters that can be used:
- search (optional)
- Description: Keywords for general search.
- Example: ?search=hotel
- street (optional)
- Description: Street name or street address.
- Example: ?street=Independence Street
- city (optional)
- Description: City name.
- Example: ?city=Jakarta
- county (optional)
- Description: District name.
- Example: ?county=Bandung
- state (optional)
- Description: Name of province or state.
- Example: ?state=West Java
- country (optional)
- Description: Country name.
- Example: ?country=Indonesia
- postal code (optional)
- Description: Postal code.
- Example: ?postalcode=40125
Search based on general keywords
GET /search?search=Medan
Results: Returns search results related to the keyword Medan in name and display name.
This API is used to retrieve address data based on latitude and longitude coordinates.
- lat (required)
- Description: Latitude is used to find a location.
- Example: ?lat=3.595193
- lon (required)
- Description: Longitude is used to find locations.
- Example: ?lon=98.675022
To search for an address based on latitude and longitude coordinates:
GET /reverse?lat=3.595193&lon=98.675022
Results: Returns the closest address data that matches the given latitude and longitude coordinates.
The response from the API will be in the form of JSON containing data that matches the search criteria.
{
"meta": {
"code": 200,
"status": "success",
"message": null
},
"data": [
{
"place_id": 234441200,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 8484616,
"lat": "3.5896654",
"lon": "98.6738261",
"type": "administrative",
"place_rank": 12,
"importance": 0.57434742996263,
"addresstype": "city",
"name": "Kota Medan",
"display_name": "Kota Medan, Sumatera Utara, Sumatera, Indonesia",
"address": {
"village": null,
"borough": null,
"county": null,
"city": "Kota Medan",
"state": "Sumatera Utara",
"postcode": null,
"country": "Indonesia",
"country_code": "id",
"neighbourhood": null,
"road": null,
"shop": null,
"suburb": null,
"historic": null,
}
}
]
}
If the search parameter is not found or there is an error in the request, the API will return a response with an error status.
{
"meta": {
"code": 500,
"status": "error",
"message": "Service Error"
}
}