{"id":22117683,"url":"https://github.com/mooore-digital/magento2-module-geoip","last_synced_at":"2026-02-11T15:03:29.964Z","repository":{"id":49727930,"uuid":"208793040","full_name":"mooore-digital/magento2-module-geoip","owner":"mooore-digital","description":"Magento 2 module providing basic Geo IP detection","archived":false,"fork":false,"pushed_at":"2021-06-10T09:05:10.000Z","size":24,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-16T08:18:06.489Z","etag":null,"topics":["geo-ip-detection","geoip","ipinfo","magento2","magento2-module"],"latest_commit_sha":null,"homepage":"","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/mooore-digital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-09-16T12:22:24.000Z","updated_at":"2022-06-09T09:20:18.000Z","dependencies_parsed_at":"2022-09-10T09:23:48.422Z","dependency_job_id":null,"html_url":"https://github.com/mooore-digital/magento2-module-geoip","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooore-digital%2Fmagento2-module-geoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooore-digital%2Fmagento2-module-geoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooore-digital%2Fmagento2-module-geoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooore-digital%2Fmagento2-module-geoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooore-digital","download_url":"https://codeload.github.com/mooore-digital/magento2-module-geoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227569766,"owners_count":17787791,"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":["geo-ip-detection","geoip","ipinfo","magento2","magento2-module"],"created_at":"2024-12-01T13:38:10.448Z","updated_at":"2026-02-11T15:03:24.933Z","avatar_url":"https://github.com/mooore-digital.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magento 2 GeoIp\nMagento 2 module providing basic Geo IP detection.\n\n## API\n\n### REST\n```bash\n$ curl https://\u003cmagento site\u003e/rest/V1/countryCode\n\"NL\"                                                                                                                                                                                                                        \n```\n\n### PHP\n``` php\n\u003c?php\n\nnamespace Acme\\Component;\n\nuse Mooore\\GeoIp\\Api\\CountryCodeInterface;\n\nclass SomeComponent\n{\n    /**\n     * @var \\Mooore\\GeoIp\\Api\\CountryCodeInterface\n     */\n    private $countryCode;\n\n    public function __construct(CountryCodeInterface $countryCode)\n    {\n        $this-\u003ecountryCode = $countryCode;\n    }\n\n    public function execute(): void\n    {\n        //output: Country is NL\n        echo sprintf('Country is %s', $this-\u003ecountryCode-\u003eget());\n    }\n}\n```\n\n## Installation\n```bash\ncomposer require mooore/magento2-module-geoip\nbin/magento setup:upgrade\n```\n\n## Configuration\nThis module has a fallback reliance on several inputs:\n1. [GeoIP](http://nginx.org/en/docs/http/ngx_http_geoip_module.html) variable `GEOIP_COUNTRY_CODE`.\n2. [GeoIP2](https://github.com/leev/ngx_http_geoip2_module) variable `COUNTRY_CODE`.\n3. [Cloudflare](https://www.cloudflare.com/) header `CF-IPCountry`.\n4. [IpInfo.io](https://ipinfo.io/) API.\n\nTo be able to fall back on IpInfo.io, follow these steps:\n1. Have an account at [ipinfo.io](https://ipinfo.io/) (usage is free for 50k requests per month).\n2. Have the ipinfo.io API key.\n3. Configure it in the Magento 2 backend (Advanced -\u003e System -\u003e GeoIP):\n![Configuration](docs/configuration.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooore-digital%2Fmagento2-module-geoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooore-digital%2Fmagento2-module-geoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooore-digital%2Fmagento2-module-geoip/lists"}