# Vietnam Company Lookup by Tax Code (MST / Mã số thuế) (`truongnat/vietnam-company-registry-scraper`) Actor

Bulk-verify Vietnamese companies by tax code (MST / mã số thuế): official legal name, English name, short name, tax status (active, suspended, closed), registered address and province. Branch codes supported, check-digit validation, invalid codes free. No login.

- **URL**: https://apify.com/truongnat/vietnam-company-registry-scraper.md
- **Developed by:** [Dao Quang Truong](https://apify.com/truongnat) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 company records

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 Company Lookup by Tax Code (MST / Mã số thuế)

Bulk-verify Vietnamese companies by **tax code (MST, mã số thuế)**. Paste a list of tax codes and get back a clean, normalized record for each company: official Vietnamese legal name, international (English) name, short name, tax status (active / suspended / closed), registered address, ward and province.

Data comes from the **General Department of Taxation (Tổng cục Thuế / GDT)** taxpayer registry, read through a public lookup API. No login, no captcha, no browser.

### Use cases

- **KYC / KYB & onboarding** – check that a supplier or customer's MST exists and is active before you sign or pay.
- **E-invoicing (hóa đơn điện tử)** – fill the buyer's legal name and address from the MST automatically.
- **CRM & lead-list hygiene** – enrich and clean thousands of tax codes in one run; flag closed or suspended companies.
- **Compliance monitoring** – re-run your vendor list regularly and alert on status changes.

### Input

| Field | Description |
|---|---|
| `taxCodes` | List of tax codes. 10-digit company codes (`0100109106`), branch codes (`0100109106-523` or `0100109106523`) and 12-digit household-business IDs. Spaces/dots ignored, duplicates removed. |
| `activeOnly` | Keep only active companies (filtered-out companies are free). |
| `provinces` | Optional province filter, e.g. `Hà Nội`, `Ho Chi Minh` (diacritics optional). |
| `includeNotFound` | Add free rows for invalid / not-found codes so you can reconcile your list (default on). |
| `xinvoiceClientId` / `xinvoiceApiKey` | Optional: your own free Xinvoice API credentials. Adds organization type and managing tax office. |

Example:

```json
{ "taxCodes": ["0100109106", "0300588569", "0101248141", "0100109106-523"] }
```

Every code is checked against the official MST **check digit** first. Typos are flagged as `INVALID_TAX_CODE` instantly and never charged.

### Output

```json
{
  "taxCode": "0300588569",
  "lookupResult": "FOUND",
  "isBranch": false,
  "parentTaxCode": null,
  "name": "CÔNG TY CỔ PHẦN SỮA VIỆT NAM",
  "internationalName": "VIETNAM DAIRY PRODUCTS JOINT STOCK COMPANY",
  "shortName": "VINAMILK",
  "status": "NNT đang hoạt động",
  "statusCode": "ACTIVE",
  "isActive": true,
  "address": "10 Tân Trào, Phường Tân Mỹ, TP Hồ Chí Minh",
  "ward": "Phường Tân Mỹ",
  "province": "Hồ Chí Minh",
  "organizationType": null,
  "taxOffice": null,
  "sourceUpdatedAt": "2026-10-10T00:20:34.000Z",
  "source": "vietqr",
  "url": "https://api.vietqr.io/v2/business/0300588569"
}
```

`statusCode` is one of `ACTIVE`, `TEMPORARILY_SUSPENDED`, `CEASED_PENDING_CLOSURE`, `CLOSED`, `NOT_AT_REGISTERED_ADDRESS`, `PENDING_VERIFICATION`, `TRANSFERRED`, `OTHER`; the raw Vietnamese status is kept in `status`. A `RUN_SUMMARY` record (found / not found / invalid / errors) is saved to the key-value store.

### Pricing

Pay per event: **$3.00 per 1,000 companies found** ($2.00 per 1,000 on Gold plans and above) + $0.005 per run start. Invalid codes, not-found codes and filtered-out companies are **free**.

### Speed

The public registry API is rate-limited, so the actor runs politely at roughly **1,000 tax codes per 25–30 minutes**. Run large lists in the background or split them across scheduled runs.

### Data & privacy

- Only public taxpayer registry data is returned. No phone numbers, emails or other personal contact details are collected.
- Records reflect the tax authority's published data, which the lookup API syncs periodically (`sourceUpdatedAt`). For legally binding verification, confirm on the official portals (tracuunnt.gdt.gov.vn, dangkykinhdoanh.gov.vn).
- Not affiliated with the General Department of Taxation, VietQR, Casso or Xinvoice.

### Limitations

- Lookup is **by tax code only**. Searching by company name, legal representative, registration date and industry (VSIC) codes are not available from compliant public APIs and are not included.
- The keyless VietQR endpoint has announced it will be retired on 01/03/2027 in favour of Xinvoice. Add your free Xinvoice credentials to keep runs working after that date; the actor will be updated accordingly.

### FAQ

**Can I look up branches?** Yes: use `0100109106-523` or `0100109106523`.

**Why was my code marked INVALID_TAX_CODE?** Its last digit doesn't match the official MST checksum (usually a typo), or it doesn't have 10/13/12 digits.

**Is the data official?** It is the GDT taxpayer registry as published, relayed by a public API, so it can lag the tax authority by a few weeks.

# Actor input Schema

## `taxCodes` (type: `array`):

One tax code per line. 10-digit company codes (0100109106), branch codes (0100109106-523 or 0100109106523) and 12-digit household-business IDs are supported. Spaces and dots are ignored, duplicates are removed, and codes with a wrong check digit are rejected without being charged.

## `activeOnly` (type: `boolean`):

Keep only companies whose tax status is active (NNT đang hoạt động). Filtered-out companies are not charged.

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

Keep only companies whose registered address is in one of these provinces, e.g. "Hà Nội", "Ho Chi Minh", "Đà Nẵng". Diacritics optional. Filtered-out companies are not charged.

## `includeNotFound` (type: `boolean`):

Add a row for every tax code that is invalid or not found, so you can reconcile your list. These rows are free.

## `xinvoiceClientId` (type: `string`):

Optional. Your own free Xinvoice API client-id (xinvoice.vn/apis/tra-cuu-ma-so-thue). When set, records also include organization type and managing tax office.

## `xinvoiceApiKey` (type: `string`):

Optional. The api-key that goes with your Xinvoice client-id.

## `delayMs` (type: `integer`):

Minimum pause between requests to the public lookup API. The API is rate-limited; lower values only cause retries.

## Actor input object example

```json
{
  "taxCodes": [
    "0100109106",
    "0300588569",
    "0101248141",
    "0100109106-523"
  ],
  "activeOnly": false,
  "includeNotFound": true,
  "delayMs": 1500
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "taxCodes": [
        "0100109106",
        "0300588569",
        "0101248141",
        "0100109106-523"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("truongnat/vietnam-company-registry-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 = { "taxCodes": [
        "0100109106",
        "0300588569",
        "0101248141",
        "0100109106-523",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("truongnat/vietnam-company-registry-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 '{
  "taxCodes": [
    "0100109106",
    "0300588569",
    "0101248141",
    "0100109106-523"
  ]
}' |
apify call truongnat/vietnam-company-registry-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,truongnat/vietnam-company-registry-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/Dfxkl3T7FbQ13L3gg/builds/k0mPXRGvoaZe1oNgV/openapi.json
