# Vietnam Business Directory Scraper — Company Registry Data (`haketa/vietnam-business-scraper`) Actor

Scrape Vietnam company directory data by province: company name, tax code (Mã số thuế), address, province, registration date, status and main industry. For B2B, lead-gen and market research. Independent tool, not affiliated with any registry.

- **URL**: https://apify.com/haketa/vietnam-business-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.
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

## Vietnam Business Directory Scraper — Company Registry Data

> **Extract Vietnam company directory data at scale: company name, tax code (Mã số thuế), registered address, province, registration date, status and main industry.** Scrape by province or keyword and get clean JSON/CSV/Excel in seconds. Built for B2B lead generation, KYC, market research and enrichment.

[![Companies](https://img.shields.io/badge/Vietnam-Company%20Data-da251d)]()
[![Tax Code](https://img.shields.io/badge/Tax%20Code%20%2B%20Address-2da44e)]()
[![B2B & KYC](https://img.shields.io/badge/B2B%20%2F%20Lead--Gen%20%2F%20KYC-8250df)]()
[![Export](https://img.shields.io/badge/Export-JSON%20%2F%20CSV%20%2F%20Excel-fb8500)]()

***

### What This Actor Does

This Actor turns Vietnam's public company directory into a structured dataset. For each company it returns:

- **Identity** — company name, **tax code (Mã số thuế)**, directory ID
- **Location** — registered address and province/city
- **Registration** — registration date
- **Details (optional)** — status (active / dissolved) and main industry

Scrape by one or many provinces (or a keyword), and it paginates through the full list — 20 companies per page — deduped by tax code.

***

### Why Use This

- **Company data at scale.** Name, tax code, address and province for companies across any Vietnamese province — a strong base for B2B, KYC and market mapping.
- **Tax code included.** The tax code (Mã số thuế) is the key identifier for Vietnamese businesses — perfect for matching, enrichment and verification.
- **Province-level coverage.** Target specific cities/provinces (Hanoi, Ho Chi Minh City, Da Nang…) or sweep many at once.
- **Fast and cheap.** Pure-HTTP over SSR HTML — no headless browser, no residential proxy.

***

### Quick Start

#### Run it in the console (no code)

1. Add one or more **Provinces** (e.g. `Ha-Noi`, `TP-Ho-Chi-Minh`, `Da-Nang`).
2. Optionally enable **Include details** for status and main industry.
3. Set **Max companies**, click **Start**, then export as **JSON, CSV, Excel or HTML**, or push to Google Sheets, a webhook or a database.

#### Run it via API (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "provinces": ["Ha-Noi", "TP-Ho-Chi-Minh"],
    "maxItems": 1000,
}

run = client.actor("YOUR_USERNAME/vietnam-business-scraper").call(run_input=run_input)

for c in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(c["name"], "·", c["taxCode"], "·", c["province"])
```

#### Build a company dataset with tax codes (Python)

```python
run = client.actor("YOUR_USERNAME/vietnam-business-scraper").call(run_input={
    "provinces": ["Da-Nang"],
    "includeDetails": True,
    "maxItems": 2000,
})
companies = [c for c in client.dataset(run["defaultDatasetId"]).iterate_items() if c.get("taxCode")]
active = [c for c in companies if "Đang hoạt động" in (c.get("status") or "")]
print(len(companies), "companies,", len(active), "active")
```

***

### Input Parameters

| Field | Type | Description |
|---|---|---|
| `provinces` | array | Province slugs (e.g. `Ha-Noi`, `TP-Ho-Chi-Minh`, `Da-Nang`). |
| `keyword` | string | Optional keyword to search companies by name. |
| `startUrls` | array | Direct listing URLs (alternative to provinces). |
| `includeDetails` | boolean | Fetch status & main industry per company. Default `false`. |
| `maxItems` | integer | Max companies across all provinces. `0` = no limit. |
| `maxPages` | integer | Max pages per province (20 per page). Default `50`. |
| `proxyConfiguration` | object | Apify Proxy. Datacenter is enough and enabled by default. |

**Common province slugs:** `Ha-Noi`, `TP-Ho-Chi-Minh`, `Da-Nang`, `Hai-Phong`, `Can-Tho`, `Bac-Ninh`, `Binh-Duong`, `Dong-Nai`, `Quang-Ninh`.

***

### Output

Each company is one record:

```json
{
  "companyId": "38123",
  "name": "CÔNG TY CỔ PHẦN DỊCH VỤ VÀ SẢN XUẤT NGUYỄN ĐỨC MINH",
  "taxCode": "0111138123",
  "address": "Khu lò gạch số 2, Thôn Phúc Am, Xã Hồng Vân, Hà Nội",
  "province": "Hà Nội",
  "registrationDate": "23/07/2025",
  "status": "Đang hoạt động",
  "mainIndustry": "Bán lẻ hàng hóa khác ...",
  "detailUrl": "https://infodoanhnghiep.com/thong-tin/...-38123.html"
}
```

Without `includeDetails`, each record still has name, tax code, address, province and registration date.

***

### Use Cases

#### 1. B2B lead generation

Build targeted company lists by province with tax code and address — a base for sales, outreach and account lists.

#### 2. KYC & due diligence

Verify Vietnamese businesses by tax code, address and status (active/dissolved) for onboarding and compliance.

#### 3. Market & competitive research

Map company density and new registrations by province and industry to understand a market.

#### 4. Data enrichment

Match and enrich CRM/ERP records with tax codes, addresses and registration data.

#### 5. Monitoring new companies

Track newly registered companies by province and date for timely outreach.

***

### Tips

- **Provinces:** use the slug form (`Ha-Noi`, `TP-Ho-Chi-Minh`). Add several to sweep a region.
- **`includeDetails`** adds status and main industry (one request per company) — enable when you need them.
- **`maxItems: 0`** paginates to the end (20 per page); each province has many pages.
- **Schedule it** with Apify Schedules to capture newly registered companies.

***

### Frequently Asked Questions

**Do I need an account?**
No. The Actor reads publicly visible directory data — no login required.

**What is the tax code (Mã số thuế)?**
It's the unique business identifier for Vietnamese companies — the key field for matching and verification.

**Is contact info (phone/email) included?**
The directory exposes name, tax code, address, province, date, status and industry. Phone/email are not part of the public listing.

**What export formats are supported?**
JSON, CSV, Excel, HTML, or via API — plus Google Sheets, webhooks, Make and Zapier.

***

### Legal & Responsible Use

This Actor is an independent tool and is **not affiliated with, endorsed by, or sponsored by** any government registry or directory. All trademarks are the property of their respective owners.

It collects only publicly available company information. You are responsible for how you use the data. Please:

- Comply with applicable data-protection laws and each source's Terms of Service.
- Do not use the data for spam, harassment, or any unlawful purpose.
- Use reasonable request volumes and scheduling.

# Actor input Schema

## `provinces` (type: `array`):

Vietnam province slugs to scrape (e.g. Ha-Noi, TP-Ho-Chi-Minh, Da-Nang, Hai-Phong, Can-Tho, Bac-Ninh). Each is paginated.

## `keyword` (type: `string`):

Free-text keyword to search companies by name (optional).

## `startUrls` (type: `array`):

Direct listing URLs (e.g. https://infodoanhnghiep.com/Ha-Noi/). Use instead of province names.

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

Fetch each company's detail page for status (active/dissolved) and main industry. Slower (one request per company).

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

Maximum companies across all provinces. 0 = no limit.

## `maxPages` (type: `integer`):

Maximum result pages per province (20 companies per page).

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

Apify Proxy. Datacenter is enough and enabled by default.

## Actor input object example

```json
{
  "provinces": [
    "Ha-Noi",
    "TP-Ho-Chi-Minh"
  ],
  "includeDetails": true,
  "maxItems": 100,
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `companyId` (type: `string`):

Directory ID

## `name` (type: `string`):

Company name

## `taxCode` (type: `string`):

Tax code / business ID

## `address` (type: `string`):

Registered address

## `province` (type: `string`):

Province/city

## `registrationDate` (type: `string`):

Registration date

## `status` (type: `string`):

Active/dissolved status

## `mainIndustry` (type: `string`):

Main business industry

## `detailUrl` (type: `string`):

Company detail URL

## `scrapedAt` (type: `string`):

ISO timestamp

# 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 = {
    "provinces": [
        "Ha-Noi",
        "TP-Ho-Chi-Minh"
    ],
    "includeDetails": true,
    "maxItems": 100,
    "maxPages": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/vietnam-business-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 = {
    "provinces": [
        "Ha-Noi",
        "TP-Ho-Chi-Minh",
    ],
    "includeDetails": True,
    "maxItems": 100,
    "maxPages": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/vietnam-business-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 '{
  "provinces": [
    "Ha-Noi",
    "TP-Ho-Chi-Minh"
  ],
  "includeDetails": true,
  "maxItems": 100,
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call haketa/vietnam-business-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/vietnam-business-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/4SfRHHB17c24jpQ6F/builds/zrChBr7YmpXHXyhRK/openapi.json
