# Ripestat Asn Prefix Scraper (`b2b_lead_generation/ripestat-asn-prefix-scraper`) Actor

Extract ASN holder details, allocation blocks, and announced IPv4/IPv6 BGP prefixes from RIPEstat. Simply choose a lookup mode, enter one or more AS numbers, set a row limit, and download your structured results directly as JSON, CSV, or Excel.

- **URL**: https://apify.com/b2b_lead_generation/ripestat-asn-prefix-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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.
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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## RIPEstat ASN & Prefix Scraper

Retrieve ASN registration details and announced IPv4/IPv6 prefixes using public RIPEstat data. Choose between ASN overview and announced-prefix modes, provide one or more ASNs, and collect structured network information for research, infrastructure analysis, and threat intelligence enrichment.

### What It Does

- **ASN Overview:** Collect ASN holder names, announcement status, and allocation block information.
- **Announced Prefixes:** Retrieve IPv4 and IPv6 prefixes announced by an ASN.

The results are organized into structured dataset records and can be exported as JSON, CSV, or Excel.

### Why Use This Actor?

- Two focused modes for ASN and BGP prefix research.
- Accepts multiple ASN or prefix resources.
- Provides allocation, holder, and announcement information.
- Produces structured records ready for analysis and export.

### Use Cases

- **Network Research:** Identify ASN holders and check announcement status.
- **BGP Inventory:** Collect announced prefixes for networks such as Cloudflare and Google.
- **Threat Intelligence:** Enrich ASN indicators with registration and prefix information.
- **Infrastructure Audits:** Research hosting networks and their announced address ranges.
- **Bulk ASN Research:** Process multiple ASN resources in one run.

### Available Modes

| Mode | Description |
|---|---|
| `as_overview` | Collect ASN holder, announcement status, and allocation block information. |
| `announced_prefixes` | Collect announced network prefixes associated with the supplied resources. |

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `as_overview` | Select `as_overview` or `announced_prefixes`. |
| `resources` | array | `["AS13335"]` | ASNs or prefixes to query, such as `AS13335`. |
| `sourceapp` | string | `bigibyte-actor` | Application identifier supplied with the RIPEstat request. |
| `maxItems` | integer | `100` | Maximum number of dataset records to collect. |
| `timeoutSecs` | integer | `300` | Overall run timeout in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout for an individual request. |
| `userAgent` | string | userresearch UA | User-Agent value used for requests. |
| `proxyConfiguration` | object | No proxy | Optional Apify or custom proxy configuration. |

#### Example Input

```json
{
  "mode": "as_overview",
  "resources": ["AS13335", "AS15169"],
  "sourceapp": "bigibyte-actor",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "userAgent": "ActorResearch/1.0",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### Output Data

Each successful record contains ASN or prefix information, depending on the selected mode.

#### Example Output

```json
{
  "resourceType": "as",
  "resource": "13335",
  "block": {
    "resource": "13312-15359",
    "desc": "Assigned by ARIN",
    "name": "IANA 16-bit Autonomous System (AS) Numbers Registry"
  },
  "holder": "CLOUDFLARENET - Cloudflare, Inc.",
  "announced": true,
  "query_starttime": "2026-10-25T16:00:00",
  "query_endtime": "2026-10-25T16:00:00",
  "scrapedAt": "2026-10-25T22:45:37.741243+00:00"
}
```

#### Output Fields

| Field | Type | Description |
|---|---|---|
| `resourceType` | string | RIPE resource type, such as `as` or `prefix`. |
| `resource` | string | ASN number or prefix in CIDR notation. |
| `block` | object | Allocation block information in overview results or ASN-related information in prefix results. |
| `holder` | string | Organization or registered holder name. |
| `announced` | boolean | Indicates whether the ASN is announced. |
| `query_starttime` | string | Start time of the RIPEstat query window. |
| `query_endtime` | string | End time of the RIPEstat query window. |
| `scrapedAt` | string | Timestamp when the record was collected. |

### Frequently Asked Questions

**What information does ASN overview mode provide?**

It returns ASN holder information, announcement status, and the associated allocation block.

**Can I collect IPv4 and IPv6 prefixes?**

Yes. Select `announced_prefixes` to retrieve announced prefixes associated with the supplied ASN resources.

**Why is the field named `resourceType` instead of `type`?**

The RIPE resource type is stored in `resourceType` to maintain compatibility with the dataset schema.

### Trademark Notice

RIPE NCC, RIPEstat, and related trademarks belong to their respective owners. This actor is an independent tool and is not affiliated with or endorsed by RIPE NCC.

### Is Web Scraping Legal?

This actor collects publicly accessible ASN registration and announced-prefix information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source's policies.

- **Personal Data:** Network records may contain organization or contact-related information. Handle any personal data in accordance with applicable privacy laws, including GDPR and CCPA where relevant.
- **Copyright and Licensing:** Network facts and registration data may have applicable database or licensing conditions. Review the source's terms and provide attribution where required.
- **Platform Terms and Rate Limits:** Respect RIPEstat's usage policies, request guidance, and applicable data terms.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional about your specific use case.

For more information, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

## `mode` (type: `string`):

What to scrape: ASN holder/announced status, or prefixes announced by each ASN.

## `resources` (type: `array`):

ASNs or prefixes to look up (e.g. AS13335, AS15169).

## `sourceapp` (type: `string`):

sourceapp query param requested by RIPEstat Data API terms.

## `maxItems` (type: `integer`):

Maximum dataset rows to push per run. Hard cap 1000.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds. The actor stops gracefully when this is reached.

## `requestTimeoutSecs` (type: `integer`):

Per-request HTTP timeout for RIPEstat calls.

## `userAgent` (type: `string`):

Identify your scraper in the User-Agent header.

## `proxyConfiguration` (type: `object`):

Optional proxies for requests. RIPEstat is public and usually works without a proxy. Enable if you hit rate limits or IP blocks.

## Actor input object example

```json
{
  "mode": "announced_prefixes",
  "resources": [
    "AS13335"
  ],
  "sourceapp": "",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "userAgent": "BigiByteActorResearch/1.0 (contact: hello@bigibyte.com)",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

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

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "resources": [
        "AS13335"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/ripestat-asn-prefix-scraper").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 = {
    "resources": ["AS13335"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/ripestat-asn-prefix-scraper").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 '{
  "resources": [
    "AS13335"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call b2b_lead_generation/ripestat-asn-prefix-scraper --silent --output-dataset

```

## MCP server setup

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

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/HNrVjDMl7yODom5J0/builds/mnM30nsoeOwbEsosc/openapi.json
