# Filtering ASN database

**URL:** <https://community.ipinfo.io/t/filtering-asn-database/395>\
**Category:** General\
**Tags:** database, asn, ip-country-asn, firewall, filter\
**Created:** [May 16, 2023, 9:26am UTC](https://community.ipinfo.io/t/filtering-asn-database/395 "2023-05-16T09:26:44Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [May 16, 2023, 9:26am UTC](https://community.ipinfo.io/t/filtering-asn-database/395/1 "2023-05-16T09:26:44Z")

</div>

If you want to create a custom firewall based on our ASN database. Checkout the following posts:

> [@Filter ASN database based on a single ASN](https://community.ipinfo.io/t/filter-asn-database-based-on-one-asn/393):
>
> Get IP addresses by looking up a single ASN from IP to ASN (Free) and the ASN database (Paid) [asn\_filtered\_database (1)] If you want to filter the ASN database based on one ASN, follow the instructions below: Step 1: Download the CSV format of your ASN database. Here I am downloading the IP to ASN database. curl -L https://ipinfo.io/data/free/asn.csv.gz?token=\<YOUR\_TOKEN\> -o asn.csv.gz Step 2: Unzip the .gz database. I am using the CLI utility gunzip, but you can use whatever compression so…

> [@Filter ASN database based on multiple ASNs](https://community.ipinfo.io/t/filter-asn-database-based-on-multiple-asns/394):
>
> Get the IP addresses of multiple ASNs from the IP to ASN (Free) and the ASN database (Premium) [asn\_multiple\_filtered\_database (1)] If you want to create an AS-filtered database with a combination of multiple of ASes, follow the instructions below. Step 1: Download the CSV format of your ASN database. Here I am downloading the IP to ASN database. curl -L https://ipinfo.io/data/free/asn.csv.gz?token=\<YOUR\_TOKEN\> -o asn.csv.gz Step 2: Unzip the .gz database. I am using the CLI utility gunzip, …

> [@How the domain field uniquely identifies organizations in the ASN and Company database](https://community.ipinfo.io/t/how-the-domain-field-uniquely-identifies-organizations-in-the-asn-and-company-database/401):
>
> In the [ASN](https://ipinfo.io/products/asn-database) and [IP to Company](https://ipinfo.io/products/ip-company-database) database, the domain field is the unique identifier of organizations. We recommend users filter the [ASN](https://ipinfo.io/products/asn-database) or the [company](https://ipinfo.io/products/ip-company-database) database based on the domain field, as it is the most unique identifier for individual organizations in the database. The reason for that is organizations can operate under different names in different countries. However, their official website or domain remains the same. Moreover, different organizations can share the same organization name keyword…

### ASN database download commands

**ASN database (premium)**

```bash
curl -L https://ipinfo.io/data/standard_asn.csv.gz?token=<YOUR_TOKEN> -o asn.csv.gz

```

**IP to ASN database (open access)**

```bash
curl -L https://ipinfo.io/data/free/asn.csv.gz?token=<YOUR_TOKEN> -o asn.csv.gz

```

**IP to Country ASN database (open access)**

```bash
curl -L https://ipinfo.io/data/free/country_asn.csv.gz?token=<YOUR_TOKEN> -o country_asn.csv.gz

```

* * *

## IPinfo ASN Database Downloads

- [Open access IP to ASN Database](https://ipinfo.io/developers/ip-to-asn-database)
- [Open access IP to Country ASN Database](https://ipinfo.io/developers/ip-to-country-asn-database)
- [Premium ASN Database](https://ipinfo.io/products/asn-database) (Comes with AS type and AS country)
