# B2BStars / Kompass Company Scraper (`luzodi/b2bstars-kompass-scraper`) Actor

Scrape B2B company contact data from b2bstars.com (Kompass partner): name, address, phone, website, sectors, and more.

- **URL**: https://apify.com/luzodi/b2bstars-kompass-scraper.md
- **Developed by:** [Luuk Zoutendijk](https://apify.com/luzodi) (community)
- **Categories:** Lead generation, Integrations
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 full company profiles

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## B2BStars / Kompass Company Scraper

Extract structured B2B company data from [b2bstars.com](https://www.b2bstars.com) — a Kompass partner site with millions of companies across Europe. Search by keyword, sector, or country and collect contact details, firmographics, and more at scale.

### What it does

This Actor crawls B2BStars search results and visits each company profile to extract:

| Field | Description | Requires `includeDetails` |
|---|---|---|
| `companyName` | Official registered company name | No |
| `city` | City | No |
| `country` | Country (ISO code) | No |
| `sectors` | Comma-separated industry sectors | No |
| `rating` | Kompass star rating (0–5) | No |
| `url` | B2BStars profile URL | No |
| `website` | Company website URL | Yes |
| `phone` | Phone number | Yes |
| `email` | Email address | Yes |
| `address` | Street address | Yes |
| `employees` | Employee count or range (e.g. `10-49`) | Yes |
| `revenue` | Annual revenue or turnover range | Yes |
| `yearOfEstablishment` | Year the company was founded | Yes |
| `description` | Company description text | Yes |
| `fax` | Fax number | Yes |

### Input

| Parameter | Type | Default | Description |
|---|---|---|---|
| `searchUrls` | string\[] | `[]` | Direct b2bstars.com search URLs. If provided, all other parameters are ignored. |
| `searchQueries` | string\[] | `[]` | List of keywords to search. Each runs as a separate search. Overrides `searchQuery`. |
| `searchQuery` | string | `""` | Single keyword or sector to search for. |
| `countries` | string\[] | `["NL"]` | ISO country codes to filter. Supports all Kompass countries (NL, DE, FR, BE, GB, ES, IT, …). |
| `maxResults` | integer | `100` | Maximum total companies to scrape across all queries and pages. |
| `includeDetails` | boolean | `true` | Visit each profile page for full contact and firmographic data. Disable for fast, basic-only runs. |

#### Example — single query

```json
{
  "searchQuery": "software",
  "countries": ["NL"],
  "maxResults": 50
}
```

#### Example — multiple queries across countries

```json
{
  "searchQueries": ["software", "construction", "logistics"],
  "countries": ["NL", "DE", "BE"],
  "maxResults": 500
}
```

#### Example — fast mode (basic data only, no profile visits)

```json
{
  "searchQuery": "accountant",
  "countries": ["NL"],
  "maxResults": 200,
  "includeDetails": false
}
```

#### Example — direct URL

```json
{
  "searchUrls": [
    "https://www.b2bstars.com/nl/kompass/company?q=engineering&countries=DE"
  ]
}
```

### Output

Results are stored in the **Dataset** tab. Each item is one company:

```json
{
  "companyName": "Qlic Internet Solutions B.V.",
  "city": "Amsterdam",
  "country": "NL",
  "sectors": "Internet services, Software development",
  "rating": 3,
  "url": "https://www.b2bstars.com/nl/kompass/company/qlic-internet-solutions-bv",
  "website": "https://qlic.nl",
  "phone": "+31 20 123 4567",
  "email": "info@qlic.nl",
  "address": "Herengracht 182",
  "employees": "10-49",
  "revenue": "€1M - €5M",
  "yearOfEstablishment": "2005",
  "description": "Full-service digital agency specialising in web development and e-commerce."
}
```

Export as **JSON**, **CSV**, or **Excel** from the Apify Console or via the API.

### Pricing

This Actor uses **pay-per-event** pricing — you pay only for what you actually scrape.

| Mode | Events charged | Cost per 1,000 companies |
|---|---|---|
| Basic (`includeDetails: false`) | `company-found` | **$2.00** |
| Full details (`includeDetails: true`) | `company-found` + `company-profile` | **$5.00** |

No charge for starting a run. Costs are transparent and predictable.

### Use cases

- **Sales prospecting** — Build targeted B2B lead lists filtered by sector, size, and country
- **Market research** — Map competitors and suppliers across European markets
- **CRM enrichment** — Fill gaps in existing company records with verified contact data
- **Partner sourcing** — Find distributors or suppliers by product category and region
- **Bulk data collection** — Run multiple queries in one job with `searchQueries`

### AI agent instructions

This Actor is designed for use inside AI/LLM agent workflows. The structured JSON output is suitable for downstream processing, filtering, and enrichment tasks.

#### Suggested task descriptions for AI agents

> Use the `luzodi/b2bstars-kompass-scraper` Actor to find B2B companies. Pass a `searchQuery`, an array of `countries`, and set `maxResults`. The output dataset contains one JSON object per company with fields: `companyName`, `website`, `email`, `phone`, `city`, `country`, `sectors`, `employees`, `revenue`, `yearOfEstablishment`. Use the Apify API to start a run and poll for completion, then retrieve the dataset items.

#### Starting a run via Apify API

```http
POST https://api.apify.com/v2/acts/luzodi~b2bstars-kompass-scraper/runs
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "searchQuery": "software",
  "countries": ["NL", "DE"],
  "maxResults": 100,
  "includeDetails": true
}
```

#### Retrieving results

```http
GET https://api.apify.com/v2/acts/luzodi~b2bstars-kompass-scraper/runs/last/dataset/items
Authorization: Bearer YOUR_API_TOKEN
```

#### Output schema (TypeScript)

```ts
interface Company {
  companyName: string;
  city: string;
  country: string;
  sectors: string;
  rating: number;
  url: string;
  // Present when includeDetails is true:
  website?: string;
  phone?: string;
  email?: string;
  address?: string;
  employees?: string;
  revenue?: string;
  yearOfEstablishment?: string;
  description?: string;
  fax?: string;
}
```

#### Integration notes for AI agents

- `maxResults` controls the total output size — set it to match your downstream needs to avoid over-scraping
- Use `includeDetails: false` when you only need company names and sectors for a quick lookup
- Use `searchQueries` to batch multiple keywords into a single run instead of chaining separate runs
- The `email` and `phone` fields may be empty if the company has not published contact details on B2BStars
- `sectors` is a comma-separated string — split on `", "` to get an array

### Running locally

#### Requirements

- Python 3.10+
- [Apify CLI](https://docs.apify.com/cli)

#### Installation

```bash
git clone https://github.com/LuukZout/luzodi.git
cd luzodi
python -m venv .venv
.venv\Scripts\activate        # Windows
source .venv/bin/activate     # macOS / Linux
pip install -r requirements.txt
playwright install chromium
```

#### Run locally

Edit `storage/key_value_stores/default/INPUT.json` with your search parameters, then:

```bash
apify run
```

> **Note:** Running locally without a proxy may result in rate limiting. Deploy to Apify for reliable results using their residential proxy network.

#### Deploy to Apify

```bash
apify login
apify push
```

### Notes

- Phone numbers may be empty if hidden behind the B2BStars paywall
- The Actor applies stealth techniques to bypass bot detection
- Pagination is handled automatically up to `maxResults`
- Multiple `searchQueries` run sequentially and share the `maxResults` budget

### Built by

**Luzodi** — [github.com/LuukZout/luzodi](https://github.com/LuukZout/luzodi)

# Actor input Schema

## `searchUrls` (type: `array`):

One or more b2bstars.com search result URLs. If provided, all other inputs below are ignored. Example: https://www.b2bstars.com/nl/kompass/company?q=software\&countries=NL

## `searchQueries` (type: `array`):

List of keywords to search for (e.g. 'software', 'construction', 'accountant'). Each query runs as a separate search. Takes precedence over the single Search query field below.

## `searchQuery` (type: `string`):

Single keyword, sector, or company name to search for. Use Search queries above for multiple keywords in one run.

## `countries` (type: `array`):

ISO country codes to filter results. The Kompass database covers 70+ countries — add as many as needed (e.g. NL, DE, FR, BE, GB, ES, IT). Ignored if Search URLs is provided.

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

Maximum total number of companies to scrape across all queries and pages.

## `includeDetails` (type: `boolean`):

Visit each company profile page to extract website, phone, email, employees, revenue, founding year, and more. Slower but much richer data. Disable for a fast run returning only basic listing data (name, city, country, sectors, rating).

## Actor input object example

```json
{
  "searchUrls": [],
  "searchQueries": [],
  "searchQuery": "software",
  "countries": [
    "NL"
  ],
  "maxResults": 50,
  "includeDetails": true
}
```

# Actor output Schema

## `results` (type: `string`):

JSON array of company objects. Basic fields: companyName, city, country, sectors, rating, url. Detail fields (includeDetails=true): website, phone, email, address, fax, employees, revenue, yearOfEstablishment, 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 = {
    "searchUrls": [],
    "searchQueries": [],
    "searchQuery": "software",
    "countries": [
        "NL"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("luzodi/b2bstars-kompass-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 = {
    "searchUrls": [],
    "searchQueries": [],
    "searchQuery": "software",
    "countries": ["NL"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("luzodi/b2bstars-kompass-scraper").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 '{
  "searchUrls": [],
  "searchQueries": [],
  "searchQuery": "software",
  "countries": [
    "NL"
  ],
  "maxResults": 50
}' |
apify call luzodi/b2bstars-kompass-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=luzodi/b2bstars-kompass-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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