Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 1.86 KB

File metadata and controls

66 lines (49 loc) · 1.86 KB

MIT License

GeoAPI

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.

API Reference

Search by city name

  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

Example response

[
 {
  "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

  • Data Source
  • Database Dump is available in the cities_api.gz file.

TODO

  • Add more endpoints
  • Add Installation instructions
  • Add tests
  • Add demo link

License

The GeoAPI is open-sourced software licensed under the MIT license.

PS. This is my first project in Golang, so please be kind. :)