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

Use GeoNames for country field #29

Open
Andrew67 opened this issue Apr 17, 2024 · 0 comments
Open

Use GeoNames for country field #29

Andrew67 opened this issue Apr 17, 2024 · 0 comments

Comments

@Andrew67
Copy link
Owner

Use GeoNames' country info API combined with a CRON job to enrich database country data, no matter the source.
Their license allows storage of such data, and the API simply returns the country code.

API: https://www.geonames.org/export/web-services.html#countryInfo
Example URL: http://api.geonames.org/countryCode?lat=35&lng=139&username=demo
Result is just the string, so a simple file_get_contents could be employed: https://www.php.net/manual/en/function.file-get-contents

Considerations:

  1. A "last update" field or capturing the lat/lng at the time of update, to handle stale entries after the data is populated.
  2. Attribution section for country data in sources.json, separate from the usual data source information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant