{"id":22296743,"url":"https://github.com/webklex/php-geoip","last_synced_at":"2025-03-25T22:40:59.963Z","repository":{"id":62547941,"uuid":"304974950","full_name":"Webklex/php-geoip","owner":"Webklex","description":"PHP-GeoIP provides you with the ability to gather open source ip intelligence by using the open api provided by https://github.com/Webklex/gogeoip.","archived":false,"fork":false,"pushed_at":"2020-10-17T22:34:32.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T19:55:47.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Webklex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-17T21:48:14.000Z","updated_at":"2023-03-01T16:23:49.000Z","dependencies_parsed_at":"2022-11-02T22:16:26.144Z","dependency_job_id":null,"html_url":"https://github.com/Webklex/php-geoip","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Webklex%2Fphp-geoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Webklex%2Fphp-geoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Webklex%2Fphp-geoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Webklex%2Fphp-geoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Webklex","download_url":"https://codeload.github.com/Webklex/php-geoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245556961,"owners_count":20634888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-03T17:47:28.969Z","updated_at":"2025-03-25T22:40:59.935Z","avatar_url":"https://github.com/Webklex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeoIP Library for PHP\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]][link-license]\n[![Build Status][ico-build]][link-scrutinizer] \n[![Total Downloads][ico-downloads]][link-downloads]\n[![Hits][ico-hits]][link-hits]\n\n\n## Description\nPHP-GeoIP provides you with the ability to gather open source ip intelligence by using the open api provided by [GoGeoIP](https://github.com/Webklex/gogeoip).\n\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Basic usage example](#basic-usage-example)\n- [Support](#support)\n- [Security](#security)\n- [Credits](#credits)\n- [License](#license)\n\n\n## Installation\n1.) Just install the PHP-GeoIP package by running the following command:\n```shell script\ncomposer require webklex/php-geoip\n```\n\n\n## Usage\n#### Basic usage example\nThis is a basic example, which will dump the geoip information for the current user ip as well as for the ip \"205.13.135.36\".\n\n```php\nuse Webklex\\GeoIP\\GeoIP;\n\n$gp = new GeoIP();\n\nvar_dump($gp-\u003ecurrent());\nvar_dump($gp-\u003eget(\"205.13.135.36\"));\n```\n\nIf you want to use your own instance of [GoGeoIP](https://github.com/Webklex/gogeoip), just provide your endpoint instead:\n```php\nuse Webklex\\GeoIP\\GeoIP;\n\n$gp = new GeoIP(\"https://my_enpoint.tld\");\n\nvar_dump($gp-\u003ecurrent());\nvar_dump($gp-\u003eget(\"205.13.135.36\"));\n```\n\n#### Response:\n```json\n{\n  \"network\": {\n    \"ip\": \"208.13.138.36\",\n    \"as\": {\n      \"number\": 209,\n      \"name\": \"CenturyLink Communications, LLC\"\n    },\n    \"isp\": \"\",\n    \"domain\": \"\",\n    \"tld\": [\".us\"],\n    \"bot\": false,\n    \"tor\": false,\n    \"proxy\": false,\n    \"proxy_type\": \"\",\n    \"last_seen\": 0,\n    \"usage_type\": \"\"\n  },\n  \"location\": {\n    \"region_code\": \"NV\",\n    \"region_name\": \"\",\n    \"city\": \"Las Vegas\",\n    \"zip_code\": \"89129\",\n    \"time_zone\": \"America/Los_Angeles\",\n    \"longitude\": -115.2821,\n    \"latitude\": 36.2473,\n    \"accuracy_radius\": 20,\n    \"metro_code\": 839,\n    \"country\": {\n      \"code\": \"US\",\n      \"cioc\": \"USA\",\n      \"ccn3\": \"840\",\n      \"call_code\": [\"1\"],\n      \"international_prefix\": \"011\",\n      \"capital\": \"Washington D.C.\",\n      \"name\": \"United States\",\n      \"full_name\": \"United States of America\",\n      \"area\": 9372610,\n      \"borders\": [\"CAN\", \"MEX\"],\n      \"latitude\": 39.443256,\n      \"longitude\": -98.95734,\n      \"max_latitude\": 71.441055,\n      \"max_longitude\": -66.885414,\n      \"min_latitude\": 17.831509,\n      \"min_longitude\": -179.23108,\n      \"currency\": [{\n          \"code\": \"USD\",\n          \"name\": \"\"\n       }, {\n          \"code\": \"USN\",\n          \"name\": \"\"\n       }, {\n          \"code\": \"USS\",\n          \"name\": \"\"\n      }],\n      \"continent\": {\n        \"code\": \"\",\n        \"name\": \"North America\",\n        \"sub_region\": \"\"\n      }\n    }\n  }\n}\n```\n\n## Support\nIf you encounter any problems or if you find a bug, please don't hesitate to create a new [issue](https://github.com/Webklex/php-geoip/issues).\nHowever please be aware that it might take some time to get an answer.\nOff topic, rude or abusive issues will be deleted without any notice.\n\nIf you need **immediate** or **commercial** support, feel free to send me a mail at github@webklex.com. \n\n\n##### A little notice\nIf you write source code in your issue, please consider to format it correctly. This makes it so much nicer to read \nand people are more likely to comment and help :)\n\n\u0026#96;\u0026#96;\u0026#96; php\n\necho 'your php code...';\n\n\u0026#96;\u0026#96;\u0026#96;\n\nwill turn into:\n```php\necho 'your php code...';\n```\n\n\n### Features \u0026 pull requests\nEveryone can contribute to this project. Every pull request will be considered but it can also happen to be declined. \nTo prevent unnecessary work, please consider to create a [feature issue](https://github.com/Webklex/php-geoip/issues/new?template=feature_request.md) \nfirst, if you're planning to do bigger changes. Of course you can also create a new [feature issue](https://github.com/Webklex/php-geoip/issues/new?template=feature_request.md)\nif you're just wishing a feature ;)\n\n\n## Change log\nPlease see [CHANGELOG][link-changelog] for more information what has changed recently.\n\n\n## Security\nIf you discover any security related issues, please email github@webklex.com instead of using the issue tracker.\n\n\n## Credits\n- [Webklex][link-author]\n- [All Contributors][link-contributors]\n\n\n## License\nThe MIT License (MIT). Please see [License File][link-license] for more information.\n\n\n[ico-version]: https://img.shields.io/packagist/v/Webklex/php-geoip.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/Webklex/php-geoip/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/Webklex/php-geoip.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/Webklex/php-geoip.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/Webklex/php-geoip.svg?style=flat-square\n[ico-build]: https://img.shields.io/scrutinizer/build/g/Webklex/php-geoip/master?style=flat-square\n[ico-quality]: https://img.shields.io/scrutinizer/quality/g/Webklex/php-geoip/master?style=flat-square\n[ico-hits]: https://hits.webklex.com/svg/webklex/php-geoip\n\n[link-packagist]: https://packagist.org/packages/Webklex/php-geoip\n[link-travis]: https://travis-ci.org/Webklex/php-geoip\n[link-scrutinizer]: https://scrutinizer-ci.com/g/Webklex/php-geoip/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/Webklex/php-geoip\n[link-downloads]: https://packagist.org/packages/Webklex/php-geoip\n[link-author]: https://github.com/webklex\n[link-contributors]: https://github.com/Webklex/php-geoip/graphs/contributors\n[link-license]: https://github.com/Webklex/php-geoip/blob/master/LICENSE\n[link-changelog]: https://github.com/Webklex/php-geoip/blob/master/CHANGELOG.md\n[link-jetbrains]: https://www.jetbrains.com\n[link-hits]: https://hits.webklex.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebklex%2Fphp-geoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebklex%2Fphp-geoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebklex%2Fphp-geoip/lists"}