{"id":23628239,"url":"https://github.com/lineofflight/country","last_synced_at":"2025-04-04T08:05:20.744Z","repository":{"id":25805224,"uuid":"29244141","full_name":"lineofflight/country","owner":"lineofflight","description":"IP-to-country geolocation API","archived":false,"fork":false,"pushed_at":"2025-02-26T18:41:24.000Z","size":613,"stargazers_count":212,"open_issues_count":7,"forks_count":21,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T07:07:03.612Z","etag":null,"topics":["geoip","geolocation","ip-to-country"],"latest_commit_sha":null,"homepage":"http://country.is/","language":"JavaScript","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/lineofflight.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-14T12:56:12.000Z","updated_at":"2025-03-27T21:33:29.000Z","dependencies_parsed_at":"2024-06-22T04:45:14.771Z","dependency_job_id":"01d485c0-2167-4fc4-954b-564fc11d0a7d","html_url":"https://github.com/lineofflight/country","commit_stats":{"total_commits":152,"total_committers":5,"mean_commits":30.4,"dds":0.5592105263157895,"last_synced_commit":"c99c8d38384cf349ca34144257d9f8b9e0fa4804"},"previous_names":["lineofflight/country"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lineofflight%2Fcountry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lineofflight%2Fcountry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lineofflight%2Fcountry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lineofflight%2Fcountry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lineofflight","download_url":"https://codeload.github.com/lineofflight/country/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142062,"owners_count":20890652,"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":["geoip","geolocation","ip-to-country"],"created_at":"2024-12-28T00:13:58.894Z","updated_at":"2025-04-04T08:05:20.727Z","avatar_url":"https://github.com/lineofflight.png","language":"JavaScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Country\n\n[![Build](https://github.com/lineofflight/country/workflows/Build/badge.svg)][action]\n\nCountry is an IP-to-country geolocation API that returns a user’s country based on their IP address.\n\n[We run a free instance][free-instance]—no API key\nneeded. You can also self-host if preferred.\n\n## Usage\n\nThe API has a minimal interface.\n\n### GET /\n\nReturns the country of the IP making the request, typically the user’s browser or app.\n\n```json\n/* https://api.country.is/ */\n{\n  \"ip\": \"77.249.1.1\",\n  \"country\": \"NL\"\n}\n```\n\n### GET /{ip}\n\nReturns the country of any given IP. The API supports both with IPv4 and IPv6.\n\n```json\n/* https://api.country.is/77.1.2.3 */\n{\n  \"ip\": \"77.1.2.3\",\n  \"country\": \"DE\"\n}\n```\n\n### GET /info\n\nProvides metadata about the API, including when the data sources were last updated.\n\n```json\n/* https://api.country.is/info */\n{\n  \"dataSources\": [\"maxmind\", \"cloudflare\"],\n  \"lastUpdated\": \"2024-08-20T18:34:36.000Z\"\n}\n```\n\nThe API automatically updates MaxMind data every 24 hours in the background.\n\n## Deployment\n\nIf you prefer not to use our hosted service, you can self-host with Docker.\n\n```\ndocker run -d -p 3000:3000 -e ACCOUNT_ID=YOUR_MAXMIND_ACCOUNT_ID -e LICENSE_KEY=YOUR_MAXMIND_LICENSE_KEY lineofflight/country\n```\n\nReplace `YOUR_MAXMIND_ACCOUNT_ID` and `YOUR_LICENSE_KEY` with your MaxMind account ID and the license key associated with it.\n\n### Cloudflare Integration\n\nTo improve performance, deploy behind [Cloudflare][cloudflare]:\n\n1. Point your domain to Cloudflare's nameservers\n2. Enable Cloudflare proxying for your API endpoint (click the cloud icon next to your DNS record until it turns orange)\n\nWhen deployed with Cloudflare, the API will automatically use Cloudflare's geolocation data as the primary source, falling back to MaxMind when needed.\n\n[free-instance]: https://api.country.is\n[action]: https://github.com/lineofflight/country/actions\n[cloudflare]: https://www.cloudflare.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flineofflight%2Fcountry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flineofflight%2Fcountry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flineofflight%2Fcountry/lists"}