# Zalo Scraper (`chrisdev_6278/zalo-scraper`) Actor

Scrape Zalo group members with user ID, avatar, display name, and admin roles. Export chat history to JSON and Vietnamese-safe CSV. QR login with session caching. Ideal for Vietnam B2B lead generation, sales outreach, and CRM sync.

- **URL**: https://apify.com/chrisdev_6278/zalo-scraper.md
- **Developed by:** [Christian Obi](https://apify.com/chrisdev_6278) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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

## Zalo Scraper: Export Group Members & Chat Messages

**Zalo Scraper** extracts **members of any Zalo group** you belong to — user ID, display name, Zalo name, avatar and **admin/owner role** — and **exports Zalo chat messages** with attachments. Download results as **JSON, CSV, Excel, XML or HTML**, or send them to Google Sheets, HubSpot, Zapier and Make.

Zalo is Vietnam's #1 messaging app with 75M+ users. No official API exposes group members or chat exports — this Actor does it in a few clicks.

### What can Zalo Scraper do?

- 👥 **Scrape Zalo group members** — full roster of large groups, in batches, with roles.
- 💬 **Export Zalo chat history** — group or 1:1, with attachment links, quotes and timestamps.
- 🔐 **QR login, saved sessions** — scan once; later runs and schedules reuse the session.
- 🇻🇳 **Vietnamese-safe CSV** — UTF-8 BOM so Excel shows Vietnamese characters correctly.
- ⏱️ **Schedule & integrate** — run daily, call via API, push to webhooks, Zapier, Make, Google Sheets.

### Who uses it?

- **Lead generation & sales** in Vietnam — build prospect lists from niche business groups.
- **Community managers** — audit members, find admins, track group growth.
- **Researchers & agencies** — archive conversations for analysis or compliance.
- **CRM sync** — keep Zalo community members in HubSpot, Salesforce or Sheets.

### How to scrape a Zalo group (3 steps)

1. Click **Try for free**, choose **Group members**, paste the **Group ID**.
2. Click **Start**. Open the **Log** tab (or **Storage → Key-value store → LOGIN_QR**) and scan the QR code with the Zalo app on your phone within 3 minutes.
3. Download your data from the **Output** tab. Next runs with the same *Account name* skip the QR step.

### Input example

```json
{ "exportMode": "groupRoster", "groupId": "5218441270240257610", "maxMembers": 0, "accountAlias": "sales_team" }
```

### Output example — group members

| displayName | zaloName | userId | role | isAdmin |
|---|---|---|---|---|
| Nguyễn Văn An | an.nguyen | 1234567890123456789 | owner | true |
| Trần Thị Bình | binh.tran | 9876543210987654321 | member | false |

```json
{ "groupId": "5218441270240257610", "groupName": "Cộng đồng Startup HCM", "userId": "1234567890123456789", "displayName": "Nguyễn Văn An", "zaloName": "an.nguyen", "avatarUrl": "https://s120-ava-talk.zadn.vn/...", "isOwner": true, "isAdmin": true, "role": "owner" }
```

### Output example — chat messages

```json
{ "threadId": "5218441270240257610", "msgId": "8386248334874", "timestamp": "2026-10-23T11:02:15.000Z", "senderId": "1234567890123456789", "senderName": "Nguyễn Văn An", "msgType": "webchat", "text": "Xin chào mọi người!", "attachmentUrl": "" }
```

Every run also saves ready-made `.json` and `.csv` files in the key-value store.

### How much does it cost?

Pay only for results: you are charged **per exported row** (one member or one message). Set a **maximum cost per run** in the run options and the Actor stops cleanly at that budget. Apify's free plan credit lets you scrape your first groups at no cost.

### Limitations — please read

- **Chat history comes from Zalo Web sync.** Zalo stores history on your phone, so only messages synced to Zalo Web (typically recent ones, or messages received after login) can be exported. Group member scraping is not affected.
- You can only scrape groups the logged-in account is a member of.
- Sessions can expire; enable **Force new QR login** to log in again.

### FAQ

**Is scraping Zalo legal?** The Actor only accesses data your own account can already see. You are responsible for complying with Zalo's terms and data protection laws (e.g. Vietnam's Decree 13/2023, GDPR). Don't use the data for spam. We recommend a secondary account.

**Where do I find the group ID?** In Zalo Web, open the group; the numeric ID appears in group info / the URL. You can also export it via a chat history run.

**Can I use it via API?** Yes — every Apify Actor has a REST API, plus Python/JS clients. See the **API** tab.

**Found a bug or need a feature?** Open an issue in the **Issues** tab — we reply fast.

***

*Keywords: Zalo scraper, Zalo group member extractor, Zalo chat export, Zalo API, Zalo data, Vietnam leads, quét thành viên nhóm Zalo, xuất tin nhắn Zalo.*

# Actor input Schema

## `exportMode` (type: `string`):

<b>Group members</b>: every member of a group with user ID, name, avatar and admin/owner role.<br><b>Chat messages</b>: messages and attachments from a group or 1:1 chat that are synced to Zalo Web.

## `groupId` (type: `string`):

Numeric Zalo group ID, e.g. <code>5218441270240257610</code>. Required for Group members; also used for group Chat messages. Find it in Zalo Web: open the group, the ID is in the URL / group info.

## `threadId` (type: `string`):

User ID of a private conversation (Chat messages only). Ignored when Group ID is set.

## `maxMembers` (type: `integer`):

Maximum group members to export. 0 = all members.

## `limit` (type: `integer`):

Maximum messages to export in Chat messages mode (newest first).

## `accountAlias` (type: `string`):

Any label for the Zalo account you log in with, e.g. <code>sales_team</code>. The login is saved under this name and reused, so you only scan the QR once. Use different names for different accounts.

## `forceReauth` (type: `boolean`):

Ignore the saved session and show a fresh QR code (use when switching accounts or if the session expired).

## Actor input object example

```json
{
  "exportMode": "groupRoster",
  "maxMembers": 100,
  "limit": 500,
  "accountAlias": "default",
  "forceReauth": false
}
```

# Actor output Schema

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

All scraped rows (group members or chat messages) in the default dataset.

## `files` (type: `string`):

JSON and UTF-8 BOM CSV exports (roster-\* / chat-\*) in the default key-value store.

## `summary` (type: `string`):

OUTPUT record with row count and export file names.

# 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 = {
    "exportMode": "groupRoster",
    "maxMembers": 100,
    "accountAlias": "default"
};

// Run the Actor and wait for it to finish
const run = await client.actor("chrisdev_6278/zalo-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 = {
    "exportMode": "groupRoster",
    "maxMembers": 100,
    "accountAlias": "default",
}

# Run the Actor and wait for it to finish
run = client.actor("chrisdev_6278/zalo-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 '{
  "exportMode": "groupRoster",
  "maxMembers": 100,
  "accountAlias": "default"
}' |
apify call chrisdev_6278/zalo-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chrisdev_6278/zalo-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/C5yNSIExXSNutxoCv/builds/JMDP7YD5xKSXsjog4/openapi.json
