{"id":21740933,"url":"https://github.com/whois-api-llc/php-simple-geoip","last_synced_at":"2026-03-05T00:35:41.947Z","repository":{"id":57080414,"uuid":"146413136","full_name":"whois-api-llc/php-simple-geoip","owner":"whois-api-llc","description":"The simplest possible way to get IP geolocation information in PHP.","archived":false,"fork":false,"pushed_at":"2022-09-21T07:33:39.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T03:46:30.445Z","etag":null,"topics":["geolocation-api","ip","ip-geolocation","ip-geolocation-api","php","whoisxmlapi"],"latest_commit_sha":null,"homepage":"https://ip-geolocation.whoisxmlapi.com/api","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whois-api-llc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-28T08:03:27.000Z","updated_at":"2022-02-07T10:11:29.000Z","dependencies_parsed_at":"2022-08-24T14:57:23.856Z","dependency_job_id":null,"html_url":"https://github.com/whois-api-llc/php-simple-geoip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/whois-api-llc/php-simple-geoip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fphp-simple-geoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fphp-simple-geoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fphp-simple-geoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fphp-simple-geoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whois-api-llc","download_url":"https://codeload.github.com/whois-api-llc/php-simple-geoip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fphp-simple-geoip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30102482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T23:59:36.199Z","status":"ssl_error","status_checked_at":"2026-03-04T23:56:48.556Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation-api","ip","ip-geolocation","ip-geolocation-api","php","whoisxmlapi"],"created_at":"2024-11-26T06:15:57.293Z","updated_at":"2026-03-05T00:35:41.907Z","avatar_url":"https://github.com/whois-api-llc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-simple-geoip\n\n*The simplest possible way to get IP geolocation information in PHP.*\n\n## Prerequisites\n\nTo use this library, you'll need to create a free IP Geolocation account:\nhttps://ip-geolocation.whoisxmlapi.com/api\n\nIf you haven't done this yet, please do so now.\n\n\n## Installation\n\nTo install `simple-geoip` using [composer](https://getcomposer.org/), simply run:\n\n```console\n$ composer require whois-api/simple-geoip\n```\nIn the root of your project directory.\n\n\nTo use the library, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading)\n\n```php\nrequire_once __DIR__ . \"/vendor/autoload.php\";\n```\n\n## Requirements\n\n### Supported PHP versions:\n\n* PHP 5.6.x\n* PHP 7.0.x\n* PHP 7.1.x\n* PHP 7.2.x\n\n### Dependencies:\n\n* mbstring\n* mbregex\n* json\n* curl\n\n## Documentation\n\nFull API documentation available [here](https://geoipify.whoisxmlapi.com/docs)\n\n## Usage\n\nOnce you have `simple-geoip` installed, you can use it to easily find the\nphysical location of a given IP address.\n\nThis library gives you access to all sorts of geographical location data that\nyou can use in your application in any number of ways.\n\n```php\n\u003c?php\nrequire_once  __DIR__ . '/../vendor/autoload.php';\n\nuse WhoisApi\\SimpleGeoip\\Builders\\ClientBuilder;\n\n\n$builder = new ClientBuilder();\n\n$client = $builder-\u003ebuild('your API_KEY');\n\ntry {\n    echo $client-\u003egetRawData('8.8.8.8', 'json') . PHP_EOL;\n    echo print_r($client-\u003eget('8.8.8.8'), 1) . PHP_EOL;\n    \n    $result = $client-\u003eget('1.1.1.1');\n    echo 'IP: ' . $result-\u003eip . PHP_EOL;\n    echo 'Country: ' . $result-\u003elocation-\u003ecountry . PHP_EOL;\n    echo 'Region: ' . $result-\u003elocation-\u003eregion . PHP_EOL;\n    echo 'City: ' . $result-\u003elocation-\u003ecity . PHP_EOL;\n    echo 'Latitude: ' . $result-\u003elocation-\u003elat . PHP_EOL;\n    echo 'Longitude: ' . $result-\u003elocation-\u003elng . PHP_EOL;\n    echo 'Postal Code: ' . $result-\u003elocation-\u003epostalCode . PHP_EOL;\n    echo 'Timezone: ' . $result-\u003elocation-\u003etimezone . PHP_EOL;\n} catch (\\Throwable $exception) {\n    echo \"Error: {$exception-\u003egetCode()} {$exception-\u003egetMessage()}\" . PHP_EOL;\n}\n```\nMore examples you can see in the \"examples\" directory. \n\nHere's the sort of data you might get back when performing a ip geolocation lookup\nrequest:\n\n```json\n{\n  \"ip\": \"8.8.8.8\",\n  \"location\": {\n    \"country\": \"US\",\n    \"region\": \"California\",\n    \"city\": \"Mountain View\",\n    \"lat\": 37.40599,\n    \"lng\": -122.078514,\n    \"postalCode\": \"94043\",\n    \"timezone\": \"-08:00\"\n  }\n}\n```\n\n## Development\n\nAfter you clone this repository you need to install all requirements:\n\n```console\n$ composer install\n```\n\nTo run tests you can use the following command\n\n```console\n$ composer run-script test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fphp-simple-geoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhois-api-llc%2Fphp-simple-geoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fphp-simple-geoip/lists"}