# IP Geolocation API - IP to Company, ASN, VPN and Proxy Data (`nabeelbaghoor/ip-geolocation-company-data-api`) Actor

Look up IP addresses in bulk and get country, region, city, coordinates, timezone and postal code, ASN with network name, network domain and network type, hosting, mobile and anycast flags, carrier data, and VPN, proxy, Tor and relay detection. Pay per result. Bring your own API key.

- **URL**: https://apify.com/nabeelbaghoor/ip-geolocation-company-data-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$6.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## IP Geolocation API - IP to Company, ASN, VPN and Proxy Data

Turn a list of IP addresses into structured records: country, region, city, coordinates, timezone and postal code, the ASN with its network name, network domain and network type, hosting, mobile, satellite and anycast flags, mobile carrier data, and VPN, proxy, Tor and relay detection, one flat row per address.

### What this actor does

- **Resolves an IP address to the company behind it.** Every record carries the ASN, the network name and the network domain, which is what turns an anonymous log line into a named organisation.
- **Sends up to 1000 addresses per request.** The network and country dataset has a real batch route, so a 50,000 row log extract is 50 requests rather than 50,000.
- **Runs full detail lookups in parallel.** The deeper dataset has no batch route, so those go through a bounded worker pool instead, and the pool size is yours to set.
- **Detects VPNs, proxies, Tor exits, relays and residential proxies**, with the name of the privacy service where the provider knows it, plus how recently the address was seen behind one.
- **Flags hosting, mobile, satellite and anycast networks**, which is what separates a data centre address from a real end user.
- **Cleans up addresses pasted out of logs.** A port suffix, a CIDR mask, square brackets around an IPv6 literal or a trailing comma are all stripped before the request rather than sent through and counted as a miss.
- **Keeps one column layout across both datasets**, so a dataset built from the light lookups and one built from the full lookups line up column for column and only differ in how many are filled.
- **Never charges for a miss.** Only addresses that resolved to a record are billed.

### Input

| Field | What it does |
| --- | --- |
| `ipAddresses` | IP addresses to look up, one per line. IPv4 and IPv6. |
| `ipAddressesText` | A pasted block of addresses separated by newlines, commas, tabs or spaces. |
| `lookupOwnAddress` | Add one row for the address the run itself connects from. |
| `dataset` | Network and country, or full detail with geolocation and privacy detection. |
| `batchLookups` | Send network and country lookups through the batch route. |
| `batchSize` | Addresses per batch request, up to the provider's maximum of 1000. |
| `concurrency` | How many full detail lookups to keep in flight at once. |
| `skipNotFound` | Leave unresolved addresses out of the dataset. |
| `maxResults` | Hard cap on rows, and therefore on spend and run time. |
| `apiKey` | Your own access token. Stored as a secret. |

### Example output

```json
{
  "found": true,
  "query": "8.8.8.8",
  "ip": "8.8.8.8",
  "dataset": "lookup",
  "hostname": "dns.google",
  "country": "United States",
  "countryCode": "US",
  "continent": "North America",
  "continentCode": "NA",
  "region": "California",
  "regionCode": "CA",
  "city": "Mountain View",
  "postalCode": "94035",
  "latitude": "37.4056",
  "longitude": "-122.0775",
  "timezone": "America/Los_Angeles",
  "asn": "AS15169",
  "asName": "Google LLC",
  "asDomain": "google.com",
  "asType": "hosting",
  "isHosting": true,
  "isMobile": false,
  "isSatellite": false,
  "isAnycast": true,
  "isAnonymous": false,
  "isVpn": false,
  "isProxy": false,
  "isTor": false,
  "isRelay": false,
  "carrierName": null,
  "raw": { }
}
```

### Frequently asked questions

#### What data does the IP Geolocation API return?

Every resolved address returns the ASN, the network name, the network domain and the network type, the country, the country code, the continent and the continent code. Requesting full detail adds the reverse hostname, the region and region code, the city, the postal code, the latitude and longitude with an accuracy radius, the timezone, the GeoNames identifier, the hosting, mobile, satellite, anycast and anonymous flags, the mobile carrier name with its MCC and MNC, and the privacy breakdown of VPN, proxy, Tor, relay and residential proxy with the privacy service name.

#### Do I need my own API key?

Yes. This actor does not include data access. You use your own access token from IPinfo, which is the provider whose IP data API this actor calls, created on their developer dashboard. Your own plan, quota and terms apply. Paste the token into the `apiKey` field, where it is stored as an Apify secret and sent as a bearer token in the request header rather than as a URL parameter, so it never appears in a log line or a redirect.

#### How do I turn IP addresses into company names?

Use the network domain. Every record carries the ASN, the network name and the network domain of the organisation that owns the address block, so a web log becomes a list of named organisations without any extra enrichment step. Filter on `asType` to keep the ones that matter: `business` addresses are the ones worth routing to sales, while `hosting` and `isp` are data centres and consumer broadband.

#### How do I detect VPN and proxy traffic?

Pick the full detail dataset. Each record then carries `isVpn`, `isProxy`, `isTor`, `isRelay` and `isResidentialProxy` as separate booleans rather than one lumped score, plus `privacyServiceName` where the provider knows which service it is, and `privacyLastSeen` with `privacyPercentDaysSeen` for how consistently the address has been seen behind one. Separate flags matter because a corporate VPN and a Tor exit are very different signals for the same fraud rule.

#### How fast can a large list run?

The network and country dataset takes up to 1000 addresses per batch request, so throughput on that path is set by your monthly quota rather than by request count. Full detail lookups run one address per request through a worker pool; the default of 10 in flight is a safe starting point, and the provider does not enforce a concurrency cap, so raising it is the fastest way to shorten a long run.

#### What is the difference between the two data depths?

Network and country is the light record: ASN, network name, network domain, country and continent. Full detail is the same address looked up against the richer datasets and adds city level geography, the reverse hostname, carrier data and the whole privacy detection block. Both write the same column layout, so you can start on the light dataset and move up without rewriting anything downstream. Your plan has to be entitled to the depth you pick.

#### What happens when an address returns no record?

The row is written with `found: false` and an `error` giving the reason, and the run continues to the next address. Misses are not charged for. Set `skipNotFound` to true to leave them out of the dataset entirely.

#### Can I look up IPv6 addresses?

Yes. IPv6 literals are accepted in both datasets and are normalised before the request, so `[2001:4860:4860::8888]:443` copied out of a log is looked up as `2001:4860:4860::8888`.

#### How much does a run cost?

Pricing is pay per result: you are charged for each address resolved to a record and returned to the dataset, and never for misses or duplicates. Apify platform usage is included in the per-result price. Your own API provider's quota is separate and billed by them.

### Keyword map

IP geolocation API, IP to company API, IP lookup API, ASN lookup, IP to ASN, IP data enrichment, VPN detection API, proxy detection API, Tor exit node detection, residential proxy detection, hosting provider detection, bulk IP lookup, batch IP geolocation, IP address to country, IP to city, reverse IP company lookup, visitor identification, fraud prevention IP data, log enrichment, IPv6 geolocation

# Actor input Schema

## `ipAddresses` (type: `array`):

IP addresses to look up, one per line. IPv4 and IPv6 both work. A port suffix, a CIDR mask or square brackets around an IPv6 literal are stripped before the request, so addresses pasted straight out of a log file are accepted as they are.

## `ipAddressesText` (type: `string`):

A block of addresses pasted as one lump, separated by newlines, commas, tabs or spaces. Use this when your source is a log excerpt or a spreadsheet column rather than a clean list. Anything here is added to the list above and duplicates are removed.

## `lookupOwnAddress` (type: `boolean`):

Add one extra row for the address the run itself connects from. Useful as a one-click check that the token works and to see which addresses your platform egress uses.

## `dataset` (type: `string`):

Which family of record to request. Network and country returns the ASN, network name, network domain and country, and has a batch route that takes up to 1000 addresses per request. Full detail adds region, city, coordinates, timezone, postal code, hosting and mobile flags, carrier data and VPN, proxy, Tor and relay detection, and is looked up one address at a time. Your plan has to be entitled to the level you pick.

## `batchLookups` (type: `boolean`):

Send network and country lookups through the batch route instead of one request per address. On by default, because it is the difference between one request and a thousand on a large list. Has no effect on full detail lookups, which have no batch route.

## `batchSize` (type: `integer`):

How many addresses to send in one batch request. The provider accepts up to 1000, which is the default and the fastest setting. Lower it only if you want smaller, more frequent progress updates.

## `concurrency` (type: `integer`):

How many full detail lookups to keep in flight at once. The provider does not cap concurrent requests, so this is really a throughput dial: raise it to finish a long list sooner, lower it if you are sharing the plan's monthly quota with other jobs.

## `skipNotFound` (type: `boolean`):

Leave addresses the provider has no record for out of the dataset. Off by default, because keeping the misses is what lets you see which addresses resolved and which did not. Misses are never charged for either way.

## `maxResults` (type: `integer`):

Stop after this many rows. This is the cap on both spend and run time.

## `apiKey` (type: `string`):

Your own access token for the IP data API, sent as a bearer token in the request header rather than in the URL, so it never appears in a log line or a redirect. Required for every lookup. Stored as a secret.

## Actor input object example

```json
{
  "ipAddresses": [
    "8.8.8.8",
    "1.1.1.1"
  ],
  "lookupOwnAddress": false,
  "dataset": "lite",
  "batchLookups": true,
  "batchSize": 1000,
  "concurrency": 10,
  "skipNotFound": false,
  "maxResults": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "ipAddresses": [
        "8.8.8.8",
        "1.1.1.1"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/ip-geolocation-company-data-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "ipAddresses": [
        "8.8.8.8",
        "1.1.1.1",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/ip-geolocation-company-data-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "ipAddresses": [
    "8.8.8.8",
    "1.1.1.1"
  ]
}' |
apify call nabeelbaghoor/ip-geolocation-company-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/ip-geolocation-company-data-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OWVE8LolsdqPU4XoU/builds/ZhcGZSrYTAoCRb2dJ/openapi.json
