# ASN Lookup (`greip/asn-lookup`) Actor

Retrieve comprehensive information about Autonomous System Numbers (ASNs) including organization details, country, contact information, and IP prefixes. Ideal for network analysis, infrastructure research, and security investigations.

- **URL**: https://apify.com/greip/asn-lookup.md
- **Developed by:** [Greip](https://apify.com/greip) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 5 total users, 1 monthly users, 97.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## Greip's ASN Lookup

A robust Apify Actor that retrieves comprehensive information about Autonomous System Numbers (ASNs) using the **Greip ASN Lookup API**. This tool helps analyze network infrastructure, organization details, and IP prefixes associated with any ASN for network analysis, troubleshooting, and security assessments.

### 🚀 Features

- **Complete ASN Information**: Get detailed data about any Autonomous System Number
- **Organization Details**: Retrieve contact information, domain, and registration data
- **IP Prefix Analysis**: Access IPv4 and IPv6 prefixes associated with the ASN
- **Network Classification**: Identify organization types (ISP, hosting, business, education, government)
- **Registry Information**: Get registration details and creation dates
- **Structured Output**: Clean, well-formatted JSON results stored in datasets

### Input Parameters

| Parameter | Type   | Required | Description                                         |
| --------- | ------ | -------- | --------------------------------------------------- |
| `asn`     | string | ✅       | Autonomous System Number (e.g., "AS6167" or "6167") |
| `userID`  | string | ❌       | Optional user identifier for tracking               |

### Output Format

The Actor outputs comprehensive information about each ASN:

```json
{
    "asn": "AS6167",
    "name": "Cellco Partnership DBA Verizon Wireless",
    "country": "US",
    "org": "Cellco Partnership DBA Verizon Wireless",
    "phone": "+1-908-306-7000",
    "email": "abuse@verizonwireless.com",
    "domain": "verizonwireless.com",
    "status": "active",
    "created": "1999-11-04",
    "type": "isp",
    "registry": "arin",
    "totalPrefixes": 250,
    "ipv4Prefixes": ["69.78.0.0/16", "70.195.0.0/16", "75.156.0.0/14"],
    "ipv6Prefixes": ["2600:1000::/28", "2600:1001::/32"],
    "timestamp": "2026-01-14T10:30:00.000Z"
}
```

#### Output Field Descriptions

**Core ASN Information:**

- `asn`: Autonomous System Number being looked up (e.g., "AS6167")
- `name`: Name of the organization that owns the ASN
- `country`: Country code of the organization (ISO 3166-1 alpha-2 format)
- `org`: Organization name associated with the ASN
- `phone`: Phone contact for the organization
- `email`: Email contact for the organization
- `domain`: Domain associated with the organization
- `status`: Current status of the ASN registration
- `created`: Date when the ASN was created/registered
- `type`: Type of organization ("isp", "hosting", "business", "education", or "government")
- `registry`: Registration authority (e.g., "arin", "ripe", "apnic", "lacnic", "afrinic")

**IP Prefix Information:**

- `totalPrefixes`: Total number of IP prefixes associated with the ASN
- `ipv4Prefixes`: Array of IPv4 network prefixes allocated to the ASN
- `ipv6Prefixes`: Array of IPv6 network prefixes allocated to the ASN
- `timestamp`: Timestamp when the data was retrieved

### Use Cases

This ASN lookup tool is essential for various network analysis and security applications:

- **Network Infrastructure Analysis**: Understand the organization behind IP addresses and network blocks
- **Security Investigations**: Identify the source of network traffic for threat analysis
- **Multi-accounting Detection**: Detect coordinated activities from the same network infrastructure
- **Compliance Monitoring**: Verify network ownership for regulatory compliance
- **Network Troubleshooting**: Diagnose routing issues and network connectivity problems
- **Fraud Prevention**: Analyze network patterns to identify suspicious activities

### Your feedback

We're always working on improving the performance of our Actors. If you have any technical feedback for ASN lookup scraper or found a bug, please create an issue in the [Issues tab](https://apify.com/greip/asn-lookup/issues/open).

# Actor input Schema

## `asn` (type: `string`):

Autonomous System Number to lookup using Greip ASN Lookup API. Accepts formats like 'AS9112' or '9112'.

## Actor input object example

```json
{
  "asn": "AS9112"
}
```

# Actor output Schema

## `asnLookupResults` (type: `string`):

No description

# 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 = {
    "asn": "AS9112"
};

// Run the Actor and wait for it to finish
const run = await client.actor("greip/asn-lookup").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 = { "asn": "AS9112" }

# Run the Actor and wait for it to finish
run = client.actor("greip/asn-lookup").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 '{
  "asn": "AS9112"
}' |
apify call greip/asn-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,greip/asn-lookup"
        }
    }
}

```

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/OChDsLkZ9lNuMfC3H/builds/wxNaGXjbhn7MFQ1BO/openapi.json
