This solution query information from the GeoDB Cities API.
The API integration enables users to perform the following queries:
- Retrieve country details including country code, currency, and flag image.
- Fetch details of the capital city including region, elevation, latitude, longitude, and population.
- Obtain information about places near a specific city using the city's ID.
- Clone the repository to your local machine.
- Duplicate the .env_sample, generate and replace api key for GEODB_API_KEY
- Navigate to the project directory.
- Set up the project dependencies using -
composer install
- Use the provided API routes to query country and city information.
- GET /countries: Retrieve a list of all countries.
- GET /country: Retrieve details of a specific country.
- GET /cities: Retrieve a list of cities by country.
- GET /city: Retrieve details of a specific city by its ID.
- GET /city/nearby: Retrieve nearby places of a specific city.
- GET /country/search: Search for a country and retrieve its information.
These API's can be used to improve and implement more features
I have added a Postman collection file named GEODB.postman_collection.json
to the project root. It provides API requests used to connect to the GeoDB API.
Additionally, I've included an API documentation file named API.postman_collection.json
, which provides detailed documentation for the project's APIs.
To test the user interface:
- Navigate to the
/
location from your browser. - Select a country from the dropdown menu.
- Submit the form.
- View the displayed country, capital, and nearby cities' details.