# IP to Company API - Identify Companies and Firmographics (`nabeelbaghoor/ip-to-company-api`) Actor

Turn a list of IP addresses into company records: company name, website, industry, employee count, revenue, address, corporate hierarchy and audience segment. Built for visitor identification and log enrichment. Pay per result. Bring your own API key.

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

## Pricing

$15.00 / 1,000 company 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 to Company API - Identify Companies and Firmographics

Turn a list of IP addresses into company records. For each address you get the company name and marketing alias, website, industry and sub-industry, NAICS and SIC codes, employee count and size band, annual sales and revenue band, full address, phone, LinkedIn profile, corporate hierarchy and audience segment. You pay only for the records you actually receive.

This actor is built for visitor identification, enriching web and server logs, de-anonymising traffic in analytics exports, routing and scoring inbound leads, and any workflow that starts with an address and needs to know which company is behind it.

### What you can do with it

- Identify the companies behind a list of website visitor IP addresses.
- Enrich a server or CDN log export with firmographics before it reaches your warehouse.
- Score and route inbound demo requests by company size, revenue and industry.
- Separate real corporate traffic from ISP and consumer traffic.
- Map identified accounts to their parent and ultimate parent company.
- Export everything as JSON, CSV or Excel, or push it into your CRM or warehouse.

### Features

- Bulk lookups: paste hundreds of addresses, one per line, and get one row each.
- IPv4 and IPv6 accepted; invalid entries and duplicates are removed before any request is made.
- Match-level aware: a `Detailed` result carries the full company profile, a `Basic` result carries registry data only.
- An optional filter to keep only addresses that matched a real company, so you are not charged for registry-only rows.
- Corporate hierarchy on every record: parent and ultimate parent company IDs and names.
- Audience and audience segment classification, plus an ISP flag and access type.
- Account Connector custom fields passed straight through when your account has them configured.
- Optional page, page title and referrer context sent with each lookup so the calls report correctly on the provider side.
- Addresses that are not in the index are logged and skipped instead of ending the run.
- Pay-per-result pricing with a hard result cap so a run can never surprise you.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `ipAddresses` | array | Addresses to identify, one per line. Required. |
| `onlyMatchedCompanies` | boolean | Skip and do not charge for registry-only results. |
| `pageUrl` / `pageTitle` / `referrer` | string | Optional context sent with each lookup. |
| `maxResults` | integer | Stop after this many records (1 to 5,000). |
| `apiKey` | string | Your server-side API token. Required, stored securely. |

### Example output

Each dataset item is one address. Fields are populated where the provider has data, and the complete provider payload is kept under `raw`:

```json
{
  "ip": "203.0.113.24",
  "informationLevel": "Detailed",
  "companyId": 645072,
  "companyName": "Acme Robotics, Inc.",
  "marketingAlias": "Acme Robotics",
  "website": "acmerobotics.com",
  "industry": "Computer Software",
  "subIndustry": "Industrial Automation Software",
  "primaryNaics": "513210",
  "primarySic": "7371",
  "employeeCount": 750,
  "employeeRange": "Mid-Market",
  "annualSales": 235000000,
  "revenueRange": "$100M - $250M",
  "companyType": "Private",
  "companyStatus": "Operating",
  "businessStructure": "Global Parent",
  "streetAddress": "500 Congress Avenue",
  "city": "Austin",
  "state": "TX",
  "zip": "78701",
  "country": "US",
  "countryName": "United States",
  "phone": "+1 512 555 0100",
  "companyLinkedinProfile": "https://www.linkedin.com/company/acme-robotics",
  "audience": "Mid-Market Business",
  "audienceSegment": "Software & Technology",
  "accessType": "corporate",
  "isIsp": false,
  "registryCompanyName": "LEVEL3",
  "registryCity": "Austin",
  "registryCountryCode": "US",
  "raw": { "company_name": "Acme Robotics, Inc." }
}
```

An address with no company match returns `informationLevel: "Basic"` and only the registry fields, which is the provider's way of saying the address resolved to an ISP or an unallocated block.

### Pricing and the credit model

This actor uses pay-per-result pricing. You are charged a fixed price for each record delivered to the dataset, and nothing for a run that returns none. Turn on `onlyMatchedCompanies` if you only want to pay for addresses that resolved to a real company. Set `maxResults` to cap how many records a run can collect, and set a run spending limit as a second safety net.

### Bring your own API key

This actor connects to a third-party company identification provider (Demandbase) on your behalf and requires your own provider API token. The token must be a server-side token that is permitted to pass the query parameter, which is what a lookup by address uses; a client-side tag token will not work for bulk lookups. Paste it into the `apiKey` input. It is stored securely and never logged, and the actor never ships with or shares credentials.

### Frequently asked questions

#### What data does this actor return?

For a matched address: company ID, name and marketing alias, website, industry and sub-industry, primary NAICS and SIC codes, employee count and size band, annual sales and revenue band, company type, status, ownership and business structure, stock ticker, full postal address and phone, LinkedIn company profile, audience and audience segment, access type, and parent and ultimate parent company. For an unmatched address: registry-level data such as the registered network owner, city, country and coordinates.

#### What is the difference between Detailed and Basic?

`Detailed` means the address resolved to a known company, so the full profile is returned. `Basic` means no company matched and only registry data is available. The `informationLevel` field on every row tells you which you got, and `onlyMatchedCompanies` filters out the Basic ones.

#### How do I get an API token?

The API is part of a paid subscription. Your provider account team issues a server-side API token, typically 32 to 48 alphanumeric characters. Ask specifically for a token that is allowed to bypass the query parameter restriction, otherwise server-side lookups by address will be rejected.

#### Why do the returned attributes vary between rows?

The provider states plainly that the attribute set is not fixed: properties may be added or removed at any time and may be null when data is unavailable. This actor is written defensively for that. It surfaces the recommended attributes as stable columns when present, and always keeps the untouched provider payload under `raw`, so nothing is lost when the provider adds a field.

#### Does it cache results?

No. The provider asks integrators not to cache responses, because cached calls never reach it and that skews the analytics on their side. Every address in your list produces a live lookup.

#### What happens to invalid or duplicate addresses?

They are removed before any request is made, so you are never charged for them. Addresses the provider does not have are logged as not found and skipped.

#### How am I charged?

You pay a fixed price per record returned to the dataset. A run that returns nothing costs nothing. Use `onlyMatchedCompanies`, `maxResults` and the run spending limit to control cost.

#### What output formats are available?

The dataset can be exported as JSON, CSV, Excel, HTML or RSS, or read through the API for pushing into a CRM or warehouse.

### Keyword map

ip to company, ip address lookup api, visitor identification, company identification api, reverse ip lookup, firmographic enrichment, website visitor identification, anonymous traffic de-anonymisation, b2b visitor tracking, log enrichment, account identification, ip firmographics, company data by ip, abm visitor identification, lead routing data, revenue range data, employee range data, corporate hierarchy data, audience segment data, ip intelligence api.

# Actor input Schema

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

The IP addresses to identify, one per line, e.g. `8.8.8.8`. IPv4 and IPv6 literals are accepted; anything that is not a valid address is ignored. Duplicates are removed.

## `onlyMatchedCompanies` (type: `boolean`):

When enabled, addresses that resolve to registry data only, with no company match, are skipped and not charged. Leave off to keep every lookup, including the registry-level ones.

## `pageUrl` (type: `string`):

Optional context sent with each lookup: the page URL the visit relates to. Useful when you want the lookups to appear correctly in your own provider-side reporting.

## `pageTitle` (type: `string`):

Optional context sent with each lookup: the page title the visit relates to.

## `referrer` (type: `string`):

Optional context sent with each lookup: the referring page URL.

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

Stop after this many records (1-5,000). One record is one identified address. You are charged per result returned.

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

Your own server-side API token for the data provider. Required. It must be a token allowed to pass the query parameter, which is what server-side lookups by address use. Stored securely and never logged.

## Actor input object example

```json
{
  "ipAddresses": [
    "8.8.8.8"
  ],
  "onlyMatchedCompanies": 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"
    ],
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/ip-to-company-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"],
    "maxResults": 100,
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ],
  "maxResults": 100
}' |
apify call nabeelbaghoor/ip-to-company-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nabeelbaghoor/ip-to-company-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2xhBPWohEbhOXNOH4/builds/qhBKZXYveKkmWWQrI/openapi.json
