# Preventing bot activity with IPinfo's IP to Privacy Data

**URL:** <https://community.ipinfo.io/t/preventing-bot-activity-with-ipinfos-ip-to-privacy-data/1811>\
**Category:** Knowledgebase\
**Tags:** ip-privacy-detection, asn, ip-company, bot\
**Created:** [July 24, 2023, 8:52pm UTC](https://community.ipinfo.io/t/preventing-bot-activity-with-ipinfos-ip-to-privacy-data/1811 "2023-07-24T20:52:36Z")\
**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:** [July 24, 2023, 8:52pm UTC](https://community.ipinfo.io/t/preventing-bot-activity-with-ipinfos-ip-to-privacy-data/1811/1 "2023-07-24T20:52:36Z")

</div>

# Identify and prevent bots from accessing your site with IPinfo. Taking a closer look at `hosting` type of IP to Privacy Detection data.

 ![preventing bot activity with IPinfo (2)](https://canada1.discourse-cdn.com/flex035/uploads/ipinfo/original/2X/4/47f135f09d0d1d8e5c6c434b9886625cfb4b40d1.png)

In our post, [Getting IP data from anonymous IP addresses](https://community.ipinfo.io/t/getting-ip-data-from-anonymous-ip-addresses/1743), we took a closer look at getting [ASN](https://ipinfo.io/products/asn-api) and [company](https://ipinfo.io/products/ip-company-api) data from anonymous IP addresses.

If you are familiar with our IP to Privacy [API](https://ipinfo.io/products/proxy-vpn-detection-api) or [data download](https://ipinfo.io/products/anonymous-ip-database) services, you know that we identify the following anonymous IP address types:

- VPN
- Proxy
- Tor
- Relay
- Hosting

In this post, we are going to take a closer look at the hosting category, which represents IP addresses that are hosted in cloud provider platforms, data centers, and other hosting service platforms.

## What do we mean by `hosting` IP address? Is that bot?

Yes, usually, bots are hosted on hosting platforms such as data centers and cloud platforms. There are different types of bots, but they are typically defined as programs that access services connected to the internet, such as servers and websites, and repeatedly perform preprogrammed actions.

Different bots serve different purposes, but generally, a bot is built upon a data center server. Regular ISP-connected consumer devices cannot reliably and effectively support bots that perform large-scale programmable activities. Additionally, ISPs usually have very limited bandwidth allocation per consumer IP address. Therefore, for an effective bot, it needs to be hosted on a server.

So, by identifying `hosting` services, we can reasonably identify bots.

## What kind of information can we know from `hosting` IP addresses

In our IP to Privacy Data, we identify hosting services with a boolean flag.

For example, **[64.233.160.0](https://ipinfo.io/64.233.160.0)**. This IP address belongs to GCP (Google Cloud Platform – [AS15169](https://ipinfo.io/AS15169)). This IP address can potentially host a bot service.

**Code**

```bash
curl https://ipinfo.io/64.233.160.0?token=$token | jq .privacy

```

**Result**

```json
{
  "vpn": false,
  "proxy": false,
  "tor": false,
  "relay": false,
  "hosting": true,
  "service": ""
}

```

We have correctly identified it is a hosting service, and it could potentially be a bot service. To get more information, we can use the [company](https://ipinfo.io/products/ip-company-api) and the [ASN](https://ipinfo.io/products/asn-api) information as well.

```bash
curl https://ipinfo.io/64.233.160.0?token=$token | jq '{ "privacy": .privacy, "company": .company, "asn": .asn }'

```

```json
{
  "privacy": {
    "vpn": false,
    "proxy": false,
    "tor": false,
    "relay": false,
    "hosting": true,
    "service": ""
  },
  "company": {
    "name": "Google LLC",
    "domain": "google.com",
    "type": "hosting"
  },
  "asn": {
    "asn": "AS15169",
    "name": "Google LLC",
    "domain": "google.com",
    "route": "64.233.160.0/24",
    "type": "hosting"
  }
}

```

## Which database best complements our IP to Privacy Detection database?

An AS organization owns an IP address, but they can either operate the IP address themselves or allow other companies to use it. Therefore, the best database is the [IP to Company database](https://ipinfo.io/products/ip-company-database), which complements the [IP to Privacy Detection database](https://ipinfo.io/products/anonymous-ip-database).

For example: **[128.177.109.0](https://ipinfo.io/128.177.109.0)**

```bash
curl https://ipinfo.io/128.177.109.0?token=$token | jq '{ "privacy": .privacy, "company": .company, "asn": .asn }'

```

```json
{
  "privacy": {
    "vpn": false,
    "proxy": false,
    "tor": false,
    "relay": false,
    "hosting": true,
    "service": ""
  },
  "company": {
    "name": "Google Inc.",
    "domain": "google.com",
    "type": "hosting"
  },
  "asn": {
    "asn": "AS6461",
    "name": "Zayo Bandwidth",
    "domain": "zayo.com",
    "route": "128.177.0.0/16",
    "type": "hosting"
  }
}

```

Google is operating this IP address. However, the IP address is owned by [Zayo Bandwidth – AS6461](https://ipinfo.io/AS6461).

## Conclusion

Using this approach, you can easily identify bots hosted in cloud platforms like AWS, GCP etc. as well as hosting services like Hetzner, OVH etc. Then you can create firewall policies or reputation scores in your log management software based on the [IP to Privacy data](https://ipinfo.io/products/anonymous-ip-database) to prevent bots from accessing your site and server.

* * *

### IPinfo services referenced:

**API**

- [IP to Privacy Detection API](https://ipinfo.io/products/proxy-vpn-detection-api)
- IP to Company API
- IP to ASN API

**Database**

- IP to Company Database
- [IP to Privacy Detection Database](https://ipinfo.io/products/anonymous-ip-database)
- [IP to ASN Database](https://ipinfo.io/products/asn-database)

**Free / Open access services**

[Signup for a free account today](https://ipinfo.io/signup), and get access to the following services:

- [IP to Country ASN database](https://ipinfo.io/products/asn-database)
