Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenWeatherMap API Call #35

Open
ben-miles opened this issue Apr 12, 2023 · 1 comment
Open

Fix OpenWeatherMap API Call #35

ben-miles opened this issue Apr 12, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ben-miles
Copy link
Owner

OpenWeatherMap updated their API quite a bit since I last worked on this project.

API requests by city name, zip-codes and city id have been deprecated in the Current API endpoint. You can still get a response for queries of only a city name, but if the name applies to more than one city worldwide, you get the first result -- so they may not be accurate (example: "London" returns results for London, UK, but the user could possibly mean London, Ohio, USA). Additionally, it's not super intuitive to users to enter only a city name.

They've introduced a Geocoder API endpoint which will take any string and return 1 or more objects that match, along with their specific latitude and longitude...

So perhaps the interface should be updated to hit that Geocoder endpoint first, maybe 1 second after the user stops typing. Then, if there's only 1 result, pass it to the Current Weather endpoint and return the results -- and if there's 2 or more results, present those in a dropdown below the current input field so the user can click the relevant one, and then fetch the Current Weather. Just my first thought for now!

@ben-miles ben-miles added the bug Something isn't working label Apr 12, 2023
@ben-miles ben-miles self-assigned this Apr 12, 2023
@ben-miles
Copy link
Owner Author

AccuWeather has a perfect illustration of the concept I outlined above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant