# ChatWork Room Data Extractor (`cloud9_ai/chatwork-scraper`) Actor

Extract ChatWork room data via API: messages, members, tasks, file metadata. Export chat history, analyze team communication, automate workflow reports. Japan's leading business chat platform for enterprise collaboration.

- **URL**: https://apify.com/cloud9\_ai/chatwork-scraper.md
- **Developed by:** [cloud9](https://apify.com/cloud9_ai) (community)
- **Categories:** Integrations, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## ChatWork Scraper

Extract conversations, member lists, and tasks from ChatWork rooms via the ChatWork API v2. Export team collaboration data for analysis, archiving, and integration.

### Features

- **Extract Room Data**: Retrieve all room information including message counts, file counts, and task counts
- **Message Export**: Fetch and export messages with sender details, timestamps, and message bodies
- **Member Management**: Extract room member lists with roles, departments, and organization info
- **Task Tracking**: Download tasks with assignments, deadlines, and status information
- **Flexible Filtering**: Target specific rooms or process all rooms in your workspace
- **Configurable Limits**: Control message retrieval limits (1-1000 per room)
- **Rate Limiting**: Built-in delays to respect ChatWork API rate limits
- **Structured Output**: JSON format ready for integration with downstream tools

### Use Cases

- **Team Communication Audit**: Extract and analyze conversation history for compliance and documentation
- **Knowledge Base Building**: Export team discussions and decisions for internal wikis and knowledge repositories
- **Project Handover**: Collect room data, members, and task status for project transitions
- **Data Backup**: Create comprehensive backups of ChatWork conversations and collaboration data
- **Analytics Integration**: Export team communication metrics to BI tools and analytics platforms
- **Migration Support**: Prepare ChatWork data for integration with other communication platforms

### Input

```json
{
  "apiToken": "your-chatwork-api-token",
  "roomIds": ["123456", "789012"],
  "includeMessages": true,
  "includeMembers": true,
  "includeTasks": true,
  "messageLimit": 100
}
````

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `apiToken` | string | Yes | - | ChatWork API token for authentication. Get this from ChatWork Account Settings > API Token |
| `roomIds` | array | No | - | Specific room IDs to scrape. If empty, all accessible rooms will be fetched |
| `includeMessages` | boolean | No | true | Whether to fetch messages for each room |
| `includeMembers` | boolean | No | false | Whether to fetch member list for each room |
| `includeTasks` | boolean | No | false | Whether to fetch tasks for each room |
| `messageLimit` | integer | No | 100 | Maximum number of messages to fetch per room (1-1000) |

### Output

```json
{
  "roomId": 123456,
  "roomName": "Development Team",
  "roomType": "group",
  "role": "admin",
  "messageCount": 1520,
  "fileCount": 45,
  "taskCount": 12,
  "lastUpdateTime": "2024-02-12T15:30:45.000Z",
  "messages": [
    {
      "messageId": "msg123456",
      "senderName": "John Doe",
      "senderId": 98765,
      "body": "Great work on the project!",
      "sendTime": "2024-02-12T14:20:00.000Z",
      "updateTime": "2024-02-12T14:21:00.000Z"
    }
  ],
  "members": [
    {
      "accountId": 98765,
      "name": "John Doe",
      "chatworkId": "john.doe",
      "role": "admin",
      "organizationName": "Engineering",
      "department": "Backend Team"
    }
  ],
  "tasks": [
    {
      "taskId": 54321,
      "body": "Review pull request",
      "assignedTo": "Jane Smith",
      "assignedBy": "John Doe",
      "status": "open",
      "limitTime": "2024-02-15T17:00:00.000Z",
      "limitType": "time"
    }
  ]
}
```

### Pricing

**$2.50 per 1,000 API calls**

#### Example Costs

| Scenario | API Calls | Cost |
|----------|-----------|------|
| 10 rooms, messages only | 11 | $0.03 |
| 50 rooms with members | 101 | $0.25 |
| 100 rooms with messages + members + tasks | 301 | $0.75 |
| 500 rooms, all data types | 1,501 | $3.75 |

**Note**: Each room data fetch = 1 call, each message fetch = 1 call, each member fetch = 1 call, each task fetch = 1 call.

### Tips

1. **Get Your API Token**: Log in to ChatWork, go to Account Settings > API Token tab, and copy your personal API token
2. **Start with Small Tests**: Use `roomIds` parameter to test with 1-2 rooms before processing all rooms
3. **Control Message Volume**: Adjust `messageLimit` based on your needs. Lower values (50-100) are faster; higher values (500+) extract more history
4. **Optimize with Flags**: Disable `includeMembers` and `includeTasks` if you only need messages to reduce API calls
5. **Handle Rate Limits**: The scraper includes 500ms delays between API requests to respect ChatWork's rate limits
6. **Room IDs as Strings**: Convert numeric room IDs to strings when specifying in `roomIds` array
7. **Export Frequency**: Consider scheduling this actor to run daily or weekly for backup and monitoring use cases

### Integrations

Export your extracted ChatWork data to:

- **Google Sheets**: Use Apify's Google Sheets integration to automatically append rows
- **Excel/CSV**: Download dataset as CSV and open in Excel or Google Sheets
- **Webhooks**: Send data to your custom webhooks for real-time processing
- **REST API**: Query extracted data via Apify's API
- **Zapier/Make**: Connect via webhooks to automate downstream workflows
- **Data Warehouse**: Export to BigQuery, Snowflake, or PostgreSQL
- **Slack**: Post summaries to Slack channels using webhooks

### Support

For issues, feature requests, or questions:

- Check the [Apify community forum](https://apify.com/community)
- Review [ChatWork API documentation](https://developer.chatwork.com/docs/overview)
- Open an issue on the [project repository](https://github.com/your-org/chatwork-scraper)

### License

Apache-2.0 License

# Actor input Schema

## `apiToken` (type: `string`):

ChatWork API token for authentication

## `roomIds` (type: `array`):

Specific room IDs to scrape. If empty, all rooms will be fetched.

## `includeMessages` (type: `boolean`):

Whether to fetch messages for each room

## `includeMembers` (type: `boolean`):

Whether to fetch member list for each room

## `includeTasks` (type: `boolean`):

Whether to fetch tasks for each room

## `messageLimit` (type: `integer`):

Maximum number of messages to fetch per room (default: 100)

## Actor input object example

```json
{
  "includeMessages": true,
  "includeMembers": false,
  "includeTasks": false,
  "messageLimit": 100
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("cloud9_ai/chatwork-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("cloud9_ai/chatwork-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 '{}' |
apify call cloud9_ai/chatwork-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ChatWork Room Data Extractor",
        "description": "Extract ChatWork room data via API: messages, members, tasks, file metadata. Export chat history, analyze team communication, automate workflow reports. Japan's leading business chat platform for enterprise collaboration.",
        "version": "0.1",
        "x-build-id": "fqCiwUXyY7wVCCgH0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/cloud9_ai~chatwork-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-cloud9_ai-chatwork-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/cloud9_ai~chatwork-scraper/runs": {
            "post": {
                "operationId": "runs-sync-cloud9_ai-chatwork-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/cloud9_ai~chatwork-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-cloud9_ai-chatwork-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "apiToken"
                ],
                "properties": {
                    "apiToken": {
                        "title": "API Token",
                        "type": "string",
                        "description": "ChatWork API token for authentication"
                    },
                    "roomIds": {
                        "title": "Room IDs",
                        "type": "array",
                        "description": "Specific room IDs to scrape. If empty, all rooms will be fetched.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeMessages": {
                        "title": "Include Messages",
                        "type": "boolean",
                        "description": "Whether to fetch messages for each room",
                        "default": true
                    },
                    "includeMembers": {
                        "title": "Include Members",
                        "type": "boolean",
                        "description": "Whether to fetch member list for each room",
                        "default": false
                    },
                    "includeTasks": {
                        "title": "Include Tasks",
                        "type": "boolean",
                        "description": "Whether to fetch tasks for each room",
                        "default": false
                    },
                    "messageLimit": {
                        "title": "Message Limit",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of messages to fetch per room (default: 100)",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
