{"id":13692341,"url":"https://github.com/picatz/ip2asn","last_synced_at":"2025-04-22T19:31:31.441Z","repository":{"id":48769003,"uuid":"127633162","full_name":"picatz/ip2asn","owner":"picatz","description":"🤖IP address to autonomous system number (ASN)","archived":false,"fork":false,"pushed_at":"2022-10-06T00:09:55.000Z","size":14,"stargazers_count":10,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-02T08:36:53.583Z","etag":null,"topics":["asn","client","ipaddresses","iptoasn","ruby"],"latest_commit_sha":null,"homepage":"https://iptoasn.com/","language":"Ruby","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/picatz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-01T13:46:18.000Z","updated_at":"2022-07-02T13:56:58.000Z","dependencies_parsed_at":"2022-08-26T20:12:03.063Z","dependency_job_id":null,"html_url":"https://github.com/picatz/ip2asn","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/picatz%2Fip2asn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picatz%2Fip2asn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picatz%2Fip2asn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picatz%2Fip2asn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picatz","download_url":"https://codeload.github.com/picatz/ip2asn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223876400,"owners_count":17218387,"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":["asn","client","ipaddresses","iptoasn","ruby"],"created_at":"2024-08-02T17:00:56.840Z","updated_at":"2024-11-10T01:41:49.115Z","avatar_url":"https://github.com/picatz.png","language":"Ruby","readme":"# Ip2asn\n\u003e IP address to autonomous system number (ASN)\n\nThis library uses the free IP-to-ASN service provided by [iptoasn.com](https://iptoasn.com/)  \n\n## Installation\n\n    $ gem install ip2asn\n\n## Usage\n\n```ruby\nrequire 'ip2asn'\n\nIP2ASN.check(\"8.8.8.8\")\n# =\u003e {\n#      \"announced\"=\u003etrue,\n#      \"as_country_code\"=\u003e\"US\",\n#      \"as_description\"=\u003e\"GOOGLE - Google LLC\",\n#      \"as_number\"=\u003e15169,\n#      \"first_ip\"=\u003e\"8.8.8.0\",\n#      \"ip\"=\u003e\"8.8.8.8\",\n#      \"last_ip\"=\u003e\"8.8.8.255\"\n# }\n```\n\nGet raw JSON response:\n```ruby\nraw_json = IP2ASN.check(\"8.8.8.8\" json: true)\n```\n\nDownload the [IPv4 to ASN map](https://iptoasn.com/data/ip2asn-v4.tsv.gz) and save the file as `ipv4.tsv`:\n```ruby\nIP2ASN.download_ipv4_to_asn_map(file: \"ipv4.tsv\")\n```\n\nDownload the [IPv4 to ASN map](https://iptoasn.com/data/ip2asn-v4-u32.tsv.gz) and save the file as `ipv4_u32.tsv` with IPv4 addresses as 32-bit unsigned integers:\n```ruby\nIP2ASN.download_ipv4_to_asn_map(file: \"ipv4_u32.tsv\", u32: true)\n```\n\nRead content of the IPv4 map, line by line (this time not saving to a file):\n```ruby\nIP2ASN.download_ipv4_to_asn_map do |line|\n  # do something with line from file\n  puts line\nend\n```\n\nDownload the [IPv6 to ASN map](https://iptoasn.com/data/ip2asn-v6.tsv.gz) and save the file as `ipv6.tsv`:\n```ruby\nIP2ASN.download_ipv6_to_asn_map(file: \"ipv6.tsv\")\n```\n\nDownload the combined [IPv4+IPv6 to ASN map](https://iptoasn.com/data/ip2asn-combined.tsv.gz) and save the file as `ip.tsv`:\n```ruby\nIP2ASN.download_ip_to_asn_map(file: \"ip.tsv\")\n```\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Lookup and Conversion Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicatz%2Fip2asn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicatz%2Fip2asn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicatz%2Fip2asn/lists"}