GeoAPI is a powerful and efficient open-source project written in Golang that provides a simple yet effective way to search for cities in a MySQL database. This project is useful for applications that need to query a large database of cities in real-time.
GET /city
Parameter | Type | Description | Demo |
---|---|---|---|
q / query |
string |
Required. For example: Albuque | /city?q=Albuque |
l / limit |
string |
Optional. For example: 2 | /city?q=Los+Ang&limit=2 |
[
{
"id": "111130",
"name": "Albuquerque",
"country_code": "US",
"lat": 35.08449,
"lng": -106.65114,
"country": {
"id": "233",
"name": "United States",
"iso2": "US",
"phonecode": "1",
"native": "United States",
"emoji": "🇺🇸"
},
"state": {
"id": "1423",
"name": "New Mexico",
"iso2": "NM"
}
}
]
More functions will be added Soon™.
- Data Source
- Database Dump is available in the cities_api.gz file.
- Add more endpoints
- Add Installation instructions
- Add tests
- Add demo link
The GeoAPI is open-sourced software licensed under the MIT license.
PS. This is my first project in Golang, so please be kind. :)