# ASNs by country using IP geolocation (not only by RIR registration)?

**URL:** <https://community.ipinfo.io/t/asns-by-country-using-ip-geolocation-not-only-by-rir-registration/7161>\
**Category:** General\
**Created:** [October 28, 2025, 4:24am UTC](https://community.ipinfo.io/t/asns-by-country-using-ip-geolocation-not-only-by-rir-registration/7161 "2025-10-28T04:24:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JDarzan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.ipinfo.io/jdarzan/32/4739_2.png) [@JDarzan](https://community.ipinfo.io/u/JDarzan)\
**Post date:** [October 28, 2025, 4:24am UTC](https://community.ipinfo.io/t/asns-by-country-using-ip-geolocation-not-only-by-rir-registration/7161/1 "2025-10-28T04:24:03Z")

</div>

Hey everyone

I’ve been testing some IPs and noticed that a few ASNs clearly located in specific countries don’t appear when I check the country ASN lists  
For example, both of these IPs are located in Bahrain according to IPinfo:

```auto
{
  "ip": "38.54.2.12",
  "city": "Manama",
  "country": "BH",
  "asn": {
    "asn": "AS138915",
    "name": "Kaopu Cloud HK Limited",
    "domain": "kaopucloud.com",
    "route": "38.54.2.0/23",
    "type": "hosting"
  }
}

{
  "ip": "15.185.237.11",
  "city": "Dār Kulayb",
  "country": "BH",
  "asn": {
    "asn": "AS16509",
    "name": "Amazon.com, Inc.",
    "domain": "amazon.com",
    "route": "15.185.0.0/16",
    "type": "hosting"
  }
}

```

But when I check the ASN list for Bahrain using the RIPE API:  
`https://stat.ripe.net/data/country-resource-list/data.json?resource=BH`

and also through IPinfo:  
`https://ipinfo.io/api/data/asns?country=bh `  
`or `  
`https://ipinfo.io/countries/bh#section-asns`

These ASNs don’t show up… just wanted to confirm if these endpoints only return ASNs registered under that country’s RIR or if there is a way to list ASNs detected by IP geolocation instead of registration origin.

---

<div class="post-metadata">

**Author:** ![Abdullah](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.ipinfo.io/abdullah/32/4973_2.png) [@Abdullah](https://community.ipinfo.io/u/Abdullah)\
**Post date:** [October 29, 2025, 6:19pm UTC](https://community.ipinfo.io/t/asns-by-country-using-ip-geolocation-not-only-by-rir-registration/7161/2 "2025-10-29T18:19:32Z")

</div>

Hi JDarzan,

The ASN country information is the organization’s registration country. An ASN can be registered in one country, but have IP addresses all over the world.

```auto
 $ ./asnsummary.sh AS138915

Summary
- Total 186880
- Unique 186880
- Anycast 0
- Bogon 0
- Mobile 0
- VPN 7260
- Proxy 5
- Hosting 184320
- Tor 2
- Relay 0

Top ASNs
- AS138915 Kaopu Cloud HK Limited 186880 (100.0%)

Top Usage Types
- Hosting 168960 (90.4%)
- Business 16128 (8.6%)
- ISP 1792 (1.0%)

Top Routes
- 211.155.96.0/22 (AS138915) 1024 (0.5%)
- 154.95.104.0/22 (AS138915) 1024 (0.5%)
- 154.95.100.0/22 (AS138915) 1024 (0.5%)
- 154.95.72.0/22 (AS138915) 1024 (0.5%)
- 211.155.100.0/22 (AS138915) 1024 (0.5%)

Top Countries
- Hong Kong 26625 (14.2%)
- United States 15360 (8.2%)
- Singapore 12048 (6.4%)
- Taiwan 7680 (4.1%)
- France 6504 (3.5%)

Top Cities
- Hong Kong, Hong Kong, HK 23428 (12.5%)
- Singapore, Singapore, SG 12048 (6.4%)
- Mountain View, California, US 9384 (5.0%)
- Taipei, Taiwan, TW 7168 (3.8%)
- Marseille, Provence-Alpes-Côte d'Azur, FR 6504 (3.5%)

Top Regions
- Hong Kong, HK 23428 (12.5%)
- Singapore, SG 12048 (6.4%)
- California, US 9384 (5.0%)
- Taiwan, TW 7168 (3.8%)
- Provence-Alpes-Côte d'Azur, FR 6504 (3.5%)

Top Privacy Services
- giampingsocks5 91 (0.0%)
- metrovpn 54 (0.0%)
- ufovpn 31 (0.0%)
- ZoogVPN 18 (0.0%)
- blinevpn 18 (0.0%)

Top Domains
- asianet.co.th 256 (0.1%)
- speakeasy.net 249 (0.1%)
- netsourceva.com 2 (0.0%)
- challalaw.com 1 (0.0%)

```

One way to get the registered country of the ASN is through our ASN API service:

```auto
$ curl https://ipinfo.io/AS138915?token=$TOKEN | jq .country

"HK"

```

Please, let me know what you think. Thank you. I really appreciate it.
