Add ip2geo IP geolocation provider#1269
Open
bfzli wants to merge 1 commit intogeocoder-php:masterfrom
Open
Conversation
Add a new provider for the ip2geo.dev IP geolocation API. Supports geocoding IP addresses (IPv4 and IPv6) with rich response data including city, country, continent, ASN, currency, flag, timezone, and registered country information. - Provider class with PSR-18 HTTP client support - Custom Ip2GeoAddress model with 20+ extra fields - Unit tests with mocked HTTP responses - Integration test scaffold - CI workflow for PHP 8.0-8.5 API docs: https://ip2geo.dev/docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ip2GeoAddressmodel with 20+ extra fields (ASN, currency, flag, continent, registered country, etc.)IP2GEO_API_KEYenv var)Provider details
GET https://api.ip2geo.dev/convert?ip={ip}X-Api-Keyheader (API key required, free tier available at ip2geo.dev)Files added
Test plan
php -lpasses on all PHP filescomposer install && vendor/bin/phpunit— 10 unit tests pass, 11 integration tests skip (no API key)