# Thai Royal Gazette Alerts in English (Laws, EHS, Business) (`chatuporn/thai-royal-gazette-alerts`) Actor

New Thai laws and notices from the Royal Gazette (ราชกิจจานุเบกษา) by topic, with English labels: environment, pollution, hazardous substances, product standards, labour, tax. For factory EHS and ISO 14001/45001 legal registers. Alerts to Slack, Telegram, LINE, webhook.

- **URL**: https://apify.com/chatuporn/thai-royal-gazette-alerts.md
- **Developed by:** [Chatuporn Duangthong](https://apify.com/chatuporn) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Thai Royal Gazette Alerts in English (Laws, EHS, Business)

**Know when Thailand changes a rule that affects you.** This Actor reads every new item published in the Thai Royal Gazette (ราชกิจจานุเบกษา), labels it by topic in English, filters out the noise and sends you what matters: to Slack, Discord, Telegram, LINE, a webhook, or a dataset you can export to Excel.

Built for **factory EHS managers and ISO 14001 / ISO 45001 legal registers**, compliance and HR teams, law firms and foreign investors who need to follow Thai regulation without reading 3,000 Gazette items a month.

### Why use this

- **The noise is gone.** About two thirds of the Gazette are bankruptcy and court notices. They are left out by default, so a factory sees roughly 50–100 relevant items a month instead of 3,000.
- **English labels.** Every item gets English topics (e.g. *Waste and hazardous substances*, *Product standards (TISI)*, *Labour and professions*), the document type (*Act*, *Royal Decree*, *Ministerial Regulation*, *Notification*) and the Gazette part. Titles stay in Thai, as published.
- **Ready-made presets.**
  - **Factory EHS / ISO 14001 & 45001:** environment, all pollution types, waste and hazardous substances, climate, industry, product standards, labour, social security, energy, electricity, petroleum, buildings, disasters, food and drugs, mining.
  - **Doing business in Thailand:** commerce, tax and customs, investment and SEZs, international trade, labour, finance, securities, banking, insurance, accounting, standards, consumer protection, digital and IP.
- **Only new rules if you want.** One switch keeps Acts, Royal Decrees, Ministerial Regulations and rule-making notices, and drops appointments and registrations.
- **Thai keyword search that works.** Spaces and letter case are ignored, so `วัตถุอันตราย` also matches `วัตถุ อันตราย`.
- **The text when you need it.** Optionally add the start of each item's text, extracted from the PDF, plus the link to the official PDF.
- **Each item once.** Schedule the Actor (daily or weekly); with *Only items not delivered before* on, you get each item once.

### Examples

**Weekly EHS digest for a factory, to Telegram**

```json
{ "preset": "factory_ehs", "lookbackDays": 7, "telegramBotToken": "...", "telegramChatId": "..." }
```

**New Ministerial Regulations and Acts only, any topic**

```json
{ "preset": "", "onlyLaws": true, "lookbackDays": 30 }
```

**Everything from the Department of Industrial Works or the Pollution Control Department**

```json
{ "preset": "", "agencyContains": "กรมโรงงานอุตสาหกรรม", "lookbackDays": 30 }
```

**Minimum wage, social security and hazardous substances, to Slack**

```json
{ "preset": "", "keywords": ["ค่าจ้างขั้นต่ำ", "ประกันสังคม", "วัตถุอันตราย"], "webhookUrl": "https://hooks.slack.com/services/..." }
```

### Output

```json
{
  "id": "2026-10-29-00136135",
  "title": "กฎกระทรวงกำหนดให้ผลิตภัณฑ์อุตสาหกรรมแผงเซลล์แสงอาทิตย์ชนิดผลึกซิลิคอนต้องเป็นไปตามมาตรฐาน พ.ศ. ๒๕๖๙",
  "docType": "กฎกระทรวง",
  "docTypeEn": "Ministerial Regulation",
  "isLaw": true,
  "publishDate": "2026-10-29",
  "gazettePart": "ก",
  "gazettePartEn": "Part A: legislation",
  "specialIssue": false,
  "volume": "143",
  "issue": "68",
  "page": "6",
  "agency": null,
  "govLevel": null,
  "action": "rulemaking",
  "actionEn": "New or amended rule",
  "topics": [
    { "slug": "industry", "en": "Industry", "th": "อุตสาหกรรม" },
    { "slug": "standards", "en": "Product standards (TISI)", "th": "มาตรฐานผลิตภัณฑ์" }
  ],
  "matchedTopics": ["industry", "standards"],
  "matchedKeywords": [],
  "pdfUrl": "https://ratchakitcha.soc.go.th/documents/136135.pdf",
  "textExcerpt": "หน้า ๖ เล่ม ๑๔๓ ตอนที่ ๖๘ ก ราชกิจจานุเบกษา ๒๙ ตุลาคม ๒๕๖๙ กฎกระทรวง ..."
}
```

### Good to know

- **Freshness.** The source mirror is updated daily, usually one or two days after the Gazette publishes an item.
- **Agency is not always known.** The source fills `agency` for notices; for Acts and Ministerial Regulations it is often empty, and the title says who issued it.
- **Topics come from the source dataset's classifier.** It is good but not perfect: a few items are tagged with a broad topic (e.g. rules of a professional council under *Labour and professions*). Use exclude keywords to tune a feed.
- **Not legal advice, and not a legal register.** The Actor tells you what was published. Whether an item applies to your site, and what you must do, still needs a person to decide. Titles are not translated; topic and type labels are.
- **Personal data.** Bankruptcy and court notices name individuals; they are excluded by default and no personal fields are extracted from them.

### Data source and licence

Royal Gazette items published by the Secretariat of the Cabinet (ratchakitcha.soc.go.th), via the open dataset **open-law-data-thailand/soc-ratchakitcha** on Hugging Face (CC BY 4.0). Laws, regulations and official announcements are not copyright works under section 7 of the Thai Copyright Act B.E. 2537. Every item carries a `source` field; please keep the attribution when you republish.

This Actor is not affiliated with or endorsed by any Thai government agency.

# Actor input Schema

## `preset` (type: `string`):

A ready-made set of topics. Factory EHS covers environment, pollution, waste and hazardous substances, industry, product standards, labour, energy, buildings and disasters. Topics below are added to the preset.

## `topics` (type: `array`):

Keep items with at least one of these topics (from the dataset's classification).

## `keywords` (type: `array`):

Thai words in the title or issuing agency, e.g. วัตถุอันตราย, โรงงาน, ค่าจ้างขั้นต่ำ, ระยอง. Spaces and letter case are ignored.

## `excludeKeywords` (type: `array`):

Skip items whose title or agency contains any of these.

## `agencyContains` (type: `string`):

e.g. กรมโรงงานอุตสาหกรรม, กรมควบคุมมลพิษ, กระทรวงแรงงาน.

## `onlyNewRules` (type: `boolean`):

Acts, royal decrees, ministerial regulations and items classified as rule-making. Skips appointments, registrations and similar notices.

## `onlyLaws` (type: `boolean`):

Stricter than the option above.

## `gazetteParts` (type: `array`):

Empty = all parts.

## `excludeTopics` (type: `array`):

Skip items with these topics.

## `includeCourtAndBankruptcy` (type: `boolean`):

About two thirds of all Gazette items are bankruptcy and court notices; they are left out unless you turn this on or pick those topics.

## `lookbackDays` (type: `integer`):

How many days of publications to check. The source is updated daily, usually 1-2 days after publication.

## `onlyNew` (type: `boolean`):

Remembers what earlier runs with the same filters returned. Keep on when you schedule the Actor.

## `includeText` (type: `boolean`):

Adds textExcerpt (Thai, extracted from the PDF). Slower: the monthly text files are 25-55 MB.

## `textChars` (type: `integer`):

Used with 'Add the start of the text'.

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

0 = no limit.

## `webhookUrl` (type: `string`):

Slack and Discord webhook URLs get readable messages; any other URL gets a JSON POST with all items. Optional: items are always in the dataset, and Apify integrations (email, Google Sheets, Zapier, Make) work too.

## `telegramBotToken` (type: `string`):

From @BotFather. Needs the chat ID below.

## `telegramChatId` (type: `string`):

Your chat, group or channel ID.

## `lineChannelAccessToken` (type: `string`):

Messaging API channel access token of your LINE Official Account. Needs the recipient ID below.

## `lineTo` (type: `string`):

The user ID (U...) or group ID (C...) to push to.

## Actor input object example

```json
{
  "preset": "factory_ehs",
  "onlyNewRules": false,
  "onlyLaws": false,
  "includeCourtAndBankruptcy": false,
  "lookbackDays": 7,
  "onlyNew": true,
  "includeText": false,
  "textChars": 1500,
  "maxItems": 500
}
```

# Actor output Schema

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

Every item with all fields.

## `overview` (type: `string`):

Date, type, title, agency, topics and PDF link.

# 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 = {
    "preset": "factory_ehs"
};

// Run the Actor and wait for it to finish
const run = await client.actor("chatuporn/thai-royal-gazette-alerts").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 = { "preset": "factory_ehs" }

# Run the Actor and wait for it to finish
run = client.actor("chatuporn/thai-royal-gazette-alerts").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 '{
  "preset": "factory_ehs"
}' |
apify call chatuporn/thai-royal-gazette-alerts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chatuporn/thai-royal-gazette-alerts"
        }
    }
}
```

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/esoefZjQLiDqcqTSG/builds/SlWOkjGmjN6p6Pjvd/openapi.json
