{"id":51463732,"url":"https://github.com/aredoff/netident","last_synced_at":"2026-07-06T08:30:54.226Z","repository":{"id":360675173,"uuid":"1251160568","full_name":"aredoff/netident","owner":"aredoff","description":"Detect provider by ip address","archived":false,"fork":false,"pushed_at":"2026-05-27T12:12:40.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T19:05:16.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/aredoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T09:53:03.000Z","updated_at":"2026-05-27T11:13:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aredoff/netident","commit_stats":null,"previous_names":["aredoff/netident"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aredoff/netident","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aredoff%2Fnetident","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aredoff%2Fnetident/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aredoff%2Fnetident/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aredoff%2Fnetident/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aredoff","download_url":"https://codeload.github.com/aredoff/netident/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aredoff%2Fnetident/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35184015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-07-06T08:30:53.198Z","updated_at":"2026-07-06T08:30:54.214Z","avatar_url":"https://github.com/aredoff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netident\n\nIdentify network providers, search engine bots, and cloud platforms by matching IP, PTR, WHOIS, and ASN data against a weighted JSON rule database.\n\n## Install\n\nLibrary:\n\n```bash\ngo get github.com/aredoff/netident\n```\n\nCLI — download a binary from [GitHub Releases](https://github.com/aredoff/netident/releases).\n\n## CLI\n\nIdentify a provider by IP, PTR, WHOIS, or ASN data:\n\n```bash\nnetident -ip 66.249.79.1 -ptr crawl-66-249-79-1.googlebot.com\n```\n\nOutput:\n\n```text\nprovider=googlebot name=\"Google Bot\" category=bot score=1000\n  ptr \"*.googlebot.com\" weight=1000\n```\n\nMore examples:\n\n```bash\nnetident -ip 8.8.8.8 -netname GOOGLE-CLOUD\nnetident -asn 15169 -asn-name GOOGLE\nnetident -netmail abuse@amazonaws.com -ptr ec2-1-2-3-4.compute.amazonaws.com\nnetident -version\nnetident -validate ./providers.json\n```\n\nValidate a custom config:\n\n```bash\nnetident -validate ./my-providers.json\n```\n\nOutput:\n\n```text\nconfig ok: ./my-providers.json\n```\n\nFlags:\n\n| Flag | Description |\n|---|---|\n| `-ip` | IP address |\n| `-ptr` | PTR record |\n| `-netname` | WHOIS netname |\n| `-netmail` | WHOIS netmail |\n| `-asn` | ASN number |\n| `-asn-name` | ASN organization name |\n| `-asn-mail` | ASN abuse email |\n| `-validate` | Validate `providers.json`, load config, and run a probe identify |\n| `-config` | Path to custom `providers.json` (default: embedded production config) |\n| `-cache-dir` | Directory for network URL cache (default: `$TMPDIR/netident-cache`) |\n| `-version` | Print version and exit |\n\nAt least one input flag is required for identify mode. `-validate` runs standalone and does not require input flags.\n\n## Library usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"net\"\n\n    \"github.com/aredoff/netident\"\n)\n\nfunc main() {\n    det, err := netident.New()\n    if err != nil {\n        panic(err)\n    }\n\n    ctx, cancel := context.WithCancel(context.Background())\n    defer cancel()\n\n    if err := det.Start(ctx); err != nil {\n        panic(err)\n    }\n    defer det.Close()\n\n    result := det.Identify(netident.Input{\n        IP:  net.ParseIP(\"66.249.79.1\"),\n        PTR: \"crawl-66-249-79-1.googlebot.com\",\n    })\n\n    if result.OK \u0026\u0026 result.Category == netident.CategoryBot {\n        // never block bots\n        return\n    }\n}\n```\n\n## Lifecycle\n\n| Method | Description |\n|---|---|\n| `New*` | Load JSON config, compile rules, read cache. No goroutines. |\n| `Start(ctx)` | Start background network URL updater. |\n| `Close()` | Stop updater and wait for shutdown. |\n| `Identify` | Match input against all providers, return best result. |\n\n`Identify` works immediately after `New` using static rules and cached CIDR lists.\n\n## Config format\n\nEach provider has weighted rules:\n\n```json\n{\n  \"version\": 1,\n  \"defaults\": {\"min_score\": 1, \"rule_weight\": 10},\n  \"providers\": [\n    {\n      \"id\": \"googlebot\",\n      \"name\": \"Google Bot\",\n      \"category\": \"bot\",\n      \"rules\": {\n        \"ptr\": [{\"match\": \"*.googlebot.com\", \"weight\": 1000}],\n        \"network_urls\": [{\n          \"url\": \"https://developers.google.com/static/search/apis/ipranges/googlebot.json\",\n          \"format\": \"google_prefixes\",\n          \"weight\": 900\n        }]\n      }\n    }\n  ]\n}\n```\n\nAll rules use `{\"match\": \"...\", \"weight\": N}`. Omitted `weight` defaults to `defaults.rule_weight`.\n\nSupported rule fields: `ptr`, `networks`, `network_urls`, `netname`, `netmail`, `asn`, `asn_name`, `asn_mail`.\n\nCategories: `bot`, `cloud`, `cdn`, `hosting`, `isp`, `other`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faredoff%2Fnetident","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faredoff%2Fnetident","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faredoff%2Fnetident/lists"}