# Thailand News Collector: 25+ Sources, Full Text (`bite-sized-insights/thailand-news-scraper`) Actor

Collect full-text articles from over 25 English- and Thai-language Thailand news outlets in one run. Filter by keyword and date, and optionally add sentiment, tags, summaries, 5W1H, language detection and text repair.

- **URL**: https://apify.com/bite-sized-insights/thailand-news-scraper.md
- **Developed by:** [bite-sized-insights](https://apify.com/bite-sized-insights) (community)
- **Categories:** News, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.17 / 1,000 articles

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

**รวบรวมและดึงบทความข่าวฉบับเต็มจาก 20+ แหล่งข่าวไทย** ครอบคลุมสำนักข่าวภาษาอังกฤษ หนังสือพิมพ์ภาษาไทย สื่อดิจิทัล สื่อธุรกิจ และสื่อเทคโนโลยี ได้ข้อมูลบทความแบบมีโครงสร้าง ทั้งหัวข้อ เนื้อหาเต็ม ผู้เขียน วันที่เผยแพร่ และอื่นๆ อัปเดตทุกครั้งที่รัน

ไม่ต้องล็อกอิน ไม่ต้องจัดการ API key แค่ตั้งค่าฟิลเตอร์แล้วเริ่มรวบรวมบทความได้เลย

### ทำไมข่าวไทย?

ประเทศไทยมีภูมิทัศน์สื่อที่หลากหลาย ตั้งแต่สำนักข่าวภาษาอังกฤษระดับนานาชาติไปจนถึงหนังสือพิมพ์ท้องถิ่น สื่อดิจิทัลรุ่นใหม่ และสื่อภาคประชาสังคม Actor นี้รวมแหล่งข่าวสำคัญไว้ในที่เดียว ช่วยให้:

- **ติดตามข่าว:** ตรวจสอบการรายงานข่าวจากสื่อไทยแบบเรียลไทม์
- **วิเคราะห์ความรู้สึก:** ป้อนข้อมูลบทความแบบมีโครงสร้างเข้าสู่ NLP pipeline
- **ข่าวกรองตลาด:** ติดตามพัฒนาการด้านธุรกิจ เศรษฐกิจ และการเมือง
- **วิจัยเชิงวิชาการ:** รวบรวมคลังข้อมูลข่าวขนาดใหญ่จากแหล่งข่าวไทย
- **รวบรวมเนื้อหา:** สร้าง news feed หรือ dashboard สำหรับข่าวไทย

เมื่อค้นหาคำสำคัญใน Google News คุณไม่มีทางรู้ว่าอัลกอริทึมเลือกสำนักข่าวใดขึ้นมาแสดงด้วยเหตุผลอะไร และผลลัพธ์ที่ได้ก็มีเพียงพาดหัวข่าวกับลิงก์เท่านั้น ไม่ใช่เนื้อหาฉบับเต็ม Actor นี้ทำงานจากรายชื่อ 25 แหล่งข่าวไทยที่คัดสรรไว้อย่างชัดเจน ตรวจสอบและเปิด/ปิดได้เป็นรายแหล่ง พร้อมส่งคืนเนื้อหาบทความแบบเต็มทุกครั้ง

### เริ่มต้นอย่างรวดเร็ว

#### ค่าเริ่มต้น: ดึง 100 บทความล่าสุด

```json
{
  "limit": 100
}
```

#### ค้นหาหัวข้อเฉพาะ

```json
{
  "search_query": "เศรษฐกิจ",
  "limit": 100
}
```

#### บทความจากช่วงวันที่กำหนด

```json
{
  "start_date": "2026-02-01",
  "end_date": "2026-02-15",
  "limit": 500
}
```

#### รวม: ค้นหาภายในช่วงวันที่

```json
{
  "search_query": "การเมือง",
  "start_date": "2026-02-01",
  "limit": 200
}
```

#### เลือกแหล่งข่าวเฉพาะ

```json
{
  "limit": 100,
  "khaosod_english": true,
  "thai_enquirer": true,
  "matichon": false,
  "khaosod": false
}
```

#### ไม่จำกัด (ดึงบทความทั้งหมดที่มี)

```json
{
  "limit": 0
}
```

### พารามิเตอร์อินพุต

| พารามิเตอร์ | ประเภท | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|-------------|--------|--------|------------|----------|
| `search_query` | string | ไม่ | - | กรองบทความด้วยคำค้นหา เฉพาะบทความที่หัวข้อ เนื้อหา หรือ URL มีคำค้นหานี้จะถูกส่งกลับ (สูงสุด 100 ตัวอักษร) |
| `start_date` | date | ไม่ | - | เฉพาะบทความที่เผยแพร่ตั้งแต่วันที่นี้ (YYYY-MM-DD) ต้องไม่เป็นวันที่ในอนาคต |
| `end_date` | date | ไม่ | - | เฉพาะบทความที่เผยแพร่ก่อนหรือในวันที่นี้ (YYYY-MM-DD) ต้องไม่เก่ากว่า 5 ปี |
| `limit` | integer | ไม่ | 100 | จำนวนบทความสูงสุดที่จะส่งกลับ ตั้ง `0` สำหรับไม่จำกัด สูงสุด: 10,000 |
| `with_sentiment` | boolean | ไม่ | `false` | เพิ่มคะแนนความรู้สึก (sentiment) ให้แต่ละบทความ (เชิงบวก/เชิงลบ/เป็นกลาง พร้อมค่าความเชื่อมั่น) $0.20 / 1,000 บทความ |
| `with_tags` | boolean | ไม่ | `false` | เพิ่มแท็กหมวดหมู่ที่สร้างโดย LLM ให้แต่ละบทความ $1.50 / 1,000 บทความ |
| `with_summary` | boolean | ไม่ | `false` | เพิ่มบทสรุปแบบย่อที่สร้างโดย LLM ให้แต่ละบทความ $2.50 / 1,000 บทความ |
| `with_5w1h` | boolean | ไม่ | `false` | เพิ่มการดึงข้อมูล Who/What/When/Where/Why/How ให้แต่ละบทความ ต้องมีเนื้อหาบทความอย่างน้อย 50 ตัวอักษร $4.00 / 1,000 บทความ |
| `with_language_detection` | boolean | ไม่ | `false` | ตรวจจับภาษาของเนื้อหาแต่ละบทความ (รหัสภาษา ค่าความเชื่อมั่น ภาษาที่เป็นไปได้) เก็บแยกไว้ใน `detected_language` ส่วน `language` ที่แหล่งข่าวระบุจะไม่ถูกเปลี่ยน $0.10 / 1,000 บทความ |
| `with_fix_text` | boolean | ไม่ | `false` | แก้ไขข้อความที่เพี้ยน (mojibake, การเข้ารหัสผิดพลาด) ในแต่ละบทความ ข้อความที่แก้ไขแล้วจะอยู่ใน `fixed_text` ส่วน `text` ไม่เปลี่ยนแปลง และ add-on อื่นจะวิเคราะห์ข้อความที่แก้ไขแล้ว คิดค่าบริการเฉพาะบทความที่ข้อความถูกแก้ไขจริง (`changed` เป็น true) $1.25 / 1,000 บทความ |

#### รายละเอียดการกรอง

- **คำค้นหา** (สูงสุด 100 ตัวอักษร) จับคู่กับหัวข้อและเนื้อหาเต็มของบทความ (ไม่แยกตัวพิมพ์เล็ก-ใหญ่)
- **ฟิลเตอร์วันที่** ใช้กับฟิลด์ `date_publish` ของบทความ บทความที่ไม่มีวันที่เผยแพร่จะถูกรวมไว้
- **ฟิลเตอร์ถูกส่งต่อไปยัง news API:** `search_query`, `start_date` และ `end_date` จะถูกส่งไปยัง news API ซึ่งนำไปใช้ขณะประมวลผลบทความ
- เมื่อใช้ `search_query` actor อาจประมวลผลบทความมากกว่าจำนวนผลลัพธ์สุดท้าย เนื่องจากบทความจะถูกกรองหลังจากการดึงข้อมูล

#### การเลือกแหล่งข่าว

แหล่งข่าวแต่ละแห่งสามารถเปิด-ปิดได้ทีละแหล่ง **แหล่งข่าวทั้งหมดเปิดใช้งานตามค่าเริ่มต้น** ตั้งค่าแหล่งข่าวเป็น `false` เพื่อไม่รวมในการรัน

ดูรายชื่อแหล่งข่าวทั้งหมดที่ส่วน [แหล่งข่าวที่รองรับ](#แหล่งข่าวที่รองรับ)

### แหล่งข่าวที่รองรับ

Actor ติดตาม 25 สำนักข่าวในประเทศไทย ครอบคลุมการเมือง ธุรกิจ เทคโนโลยี สังคม และอื่นๆ

#### English-Language News

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Khaosod English | khaosodenglish.com | ฉบับภาษาอังกฤษของหนังสือพิมพ์ข่าวสด |
| Thai Enquirer | thaienquirer.com | สำนักข่าวออนไลน์ภาษาอังกฤษ เน้นการเมืองและธุรกิจไทย |
| Prachatai English | prachataienglish.com | ฉบับภาษาอังกฤษของประชาไท เน้นสิทธิมนุษยชนและประชาธิปไตย |
| Thaiger | thethaiger.com | สำนักข่าวออนไลน์ภาษาอังกฤษ ครอบคลุมข่าวไทยและอาเซียน |

#### English-Language Regional

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Chiang Rai Times | chiangraitimes.com | ข่าวเชียงรายและภาคเหนือภาษาอังกฤษ |
| The Pattaya News | thepattayanews.com | ข่าวพัทยาและชลบุรีภาษาอังกฤษ |

#### English-Language Business

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Thailand Business News | thailand-business-news.com | ข่าวธุรกิจและเศรษฐกิจไทยภาษาอังกฤษ |

#### Thai-Language Newspapers (หนังสือพิมพ์ไทย)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Matichon (มติชน) | matichon.co.th | หนังสือพิมพ์รายวันชั้นนำ เน้นข่าวการเมืองและสังคม |
| Khaosod (ข่าวสด) | khaosod.co.th | หนังสือพิมพ์รายวัน ข่าวเด่นและข่าวสังคม |
| Thai Post (ไทยโพสต์) | thaipost.net | หนังสือพิมพ์รายวัน เน้นข่าวการเมืองและเศรษฐกิจ |

#### Thai-Language Business (ธุรกิจ)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Prachachat (ประชาชาติธุรกิจ) | prachachat.net | ข่าวธุรกิจและเศรษฐกิจชั้นนำในเครือมติชน |
| Brand Inside | brandinside.asia | สื่อออนไลน์ด้านธุรกิจ สตาร์ทอัพ และเทคโนโลยี |

#### Thai-Language Digital Media (สื่อดิจิทัล)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| THE STANDARD | thestandard.co | สื่อออนไลน์ยุคใหม่ ครอบคลุมข่าว ธุรกิจ และวัฒนธรรม |
| The MATTER | thematter.co | สื่อออนไลน์เน้นเนื้อหาเชิงลึกด้านสังคมและการเมือง |
| THE MOMENTUM | themomentum.co | สื่อออนไลน์เน้นไลฟ์สไตล์ สังคม และวัฒนธรรม |

#### Thai-Language Civil Society (สิทธิมนุษยชน)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Prachatai (ประชาไท) | prachatai.com | สื่อภาคประชาสังคม เน้นสิทธิมนุษยชนและประชาธิปไตย |
| iLaw | ilaw.or.th | โครงการอินเทอร์เน็ตเพื่อกฎหมายประชาชน ติดตามกฎหมายและสิทธิเสรีภาพ |

#### Thai-Language Technology (เทคโนโลยี)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| Beartai | beartai.com | สื่อเทคโนโลยี รีวิวสินค้า และข่าวไอที |
| Siamphone | siamphone.com | เว็บไซต์มือถือและเทคโนโลยีอันดับต้นๆ ของไทย |

#### Thai-Language Portal (พอร์ทัล)

| แหล่งข่าว | โดเมน | คำอธิบาย |
|-----------|-------|----------|
| ไทยรัฐ (Thairath) | thairath.co.th | หนังสือพิมพ์และเว็บไซต์ข่าวที่มีผู้อ่านมากที่สุดของไทย ครอบคลุมข่าวทั่วไป การเมือง และอาชญากรรม |

### ตัวอย่างผลลัพธ์

แต่ละบทความถูกส่งกลับเป็น object แบบมีโครงสร้างพร้อมเนื้อหาเต็มและ metadata:

```json
{
  "url": "https://www.bangkokpost.com/thailand/general/1234567/example-article",
  "article_title": "ตัวอย่างหัวข้อข่าว",
  "authors": ["Author Name"],
  "date_publish": "2026-02-15T10:30:00",
  "article_description": "สรุปเนื้อหาบทความ",
  "text": "เนื้อหาเต็มของบทความที่ดึงออกมา...",
  "language": "th",
  "image_url": "https://static.bangkokpost.com/image.jpg",
  "source_domain": "www.bangkokpost.com",
  "type": "article",
  "sentiment": null,
  "tags": null,
  "summary": null,
  "five_w1h": null,
  "detected_language": null,
  "fixed_text": null,
  "error": null
}
```

#### ฟิลด์ผลลัพธ์

| ฟิลด์ | ประเภท | คำอธิบาย |
|-------|--------|----------|
| `url` | string | URL เต็มของบทความ |
| `article_title` | string | หัวข้อบทความ |
| `authors` | array | รายชื่อผู้เขียน |
| `date_publish` | string | วันที่เผยแพร่ (ISO 8601) |
| `article_description` | string | สรุปบทความ / meta description |
| `text` | string | เนื้อหาเต็มของบทความ |
| `language` | string | รหัสภาษา (เช่น `th`, `en`) |
| `image_url` | string | URL ของรูปภาพหลักในบทความ |
| `source_domain` | string | ชื่อโดเมนของแหล่งข่าว |
| `type` | string | Page type: `article`, `video` or `audio`. Video and audio pages (iPlayer, Sounds, video player pages, podcast episodes) have little or no text - filter on `type` to keep articles only |
| `error` | string | เป็น `null` เสมอ (สงวนไว้สำหรับใช้ในอนาคต) - บทความที่ดึงไม่สำเร็จจะถูกข้ามไป ไม่ได้ถูกส่งออกพร้อม error |
| `sentiment` | object | ผลลัพธ์การวิเคราะห์ความรู้สึก - เป็น `null` ยกเว้นมีการร้องขอ `with_sentiment` และสำเร็จ |
| `tags` | object | ผลลัพธ์การดึงแท็ก - เป็น `null` ยกเว้นมีการร้องขอ `with_tags` และสำเร็จ |
| `summary` | object | ผลลัพธ์การสรุปบทความ - เป็น `null` ยกเว้นมีการร้องขอ `with_summary` และสำเร็จ |
| `five_w1h` | object | ผลลัพธ์การดึงข้อมูล 5W1H - เป็น `null` ยกเว้นมีการร้องขอ `with_5w1h` และสำเร็จ |
| `detected_language` | object | ผลลัพธ์การตรวจจับภาษา - เป็น `null` ยกเว้นมีการร้องขอ `with_language_detection` และสำเร็จ |
| `fixed_text` | object | ผลลัพธ์การแก้ไขข้อความ - เป็น `null` ยกเว้นมีการร้องขอ `with_fix_text` และสำเร็จ |

#### บทความที่ดึงไม่สำเร็จ

บทความที่ไม่สามารถดึงข้อมูลได้ (paywall, timeout, การบล็อก ฯลฯ) จะถูกข้ามไปอย่างเงียบ ๆ และจะไม่ปรากฏใน dataset ผลลัพธ์เลย มีเพียงบทความที่ดึงข้อมูลสำเร็จ (มีข้อความที่ไม่ว่างเปล่า) เท่านั้นที่จะถูกส่งออก

### ราคา

Actor นี้ใช้ระบบเรียกเก็บเงินแบบ pay-per-event ของ Apify

| Event | ค่าใช้จ่าย | คำอธิบาย |
|-------|-----------|----------|
| Actor start | $0.0002 | คิดค่าบริการหนึ่งครั้งต่อการรัน |
| Article | $1.80 / 1,000 บทความ | คิดค่าบริการต่อบทความที่ดึงสำเร็จ |
| Sentiment add-on | $0.20 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะเมื่อ `with_sentiment` สำเร็จ |
| Tags add-on | $1.50 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะเมื่อ `with_tags` สำเร็จ |
| Summary add-on | $2.50 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะเมื่อ `with_summary` สำเร็จ |
| 5W1H add-on | $4.00 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะเมื่อ `with_5w1h` สำเร็จ |
| Language detection add-on | $0.10 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะเมื่อ `with_language_detection` สำเร็จ |
| Fix text add-on | $1.25 / 1,000 บทความ | ฟีเจอร์เสริม คิดค่าบริการเฉพาะบทความที่ข้อความถูกแก้ไขจริง (`changed` เป็น true) เมื่อ `with_fix_text` สำเร็จ |

**รายละเอียดการเรียกเก็บเงิน:**

- **คิดค่าบริการเฉพาะบทความที่สำเร็จ:** การดึงที่ล้มเหลวไม่เสียค่าใช้จ่าย
- **ฟีเจอร์เสริมเป็นออปชันและคิดค่าบริการแยกต่างหาก:** แต่ละฟีเจอร์เสริม `with_*` จะคิดค่าบริการเฉพาะบทความที่เสริมข้อมูลสำเร็จเท่านั้น - รายการที่ถูกข้าม (สั้นเกินไป) หรือล้มเหลวไม่เสียค่าใช้จ่าย
- **แผนฟรี:** รันฟรี 5 ครั้งต่อบัญชี แต่ละครั้งจำกัด 10 บทความ ส่วนแผนแบบชำระเงินไม่จำกัด
- **ไม่มีขั้นต่ำ:** จ่ายเฉพาะที่ใช้
- **ควบคุมงบประมาณ:** ตั้งวงเงินใช้จ่ายในบัญชี Apify ของคุณ
- **ส่วนลด:** สมาชิก Gold, Silver และ Bronze ของ Apify ได้รับส่วนลด

### API Integration

#### เรียกผ่าน Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/bite-sized-insights~thailand-news-scraper/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"limit": 100, "search_query": "เศรษฐกิจ", "start_date": "2026-02-01"}'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("bite-sized-insights/thailand-news-scraper").call(
    run_input={
        "limit": 100,
        "search_query": "เศรษฐกิจ",
        "start_date": "2026-02-01",
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("error"):
        continue
    print(f"[{item['source_domain']}] {item['article_title']}")
    print(f"  {item['url']}")
    print(f"  Published: {item['date_publish']}")
    print()
```

#### JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('bite-sized-insights/thailand-news-scraper').call({
    limit: 100,
    search_query: 'การเมือง',
    start_date: '2026-02-01',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items
    .filter(item => !item.error)
    .forEach(item => {
        console.log(`[${item.source_domain}] ${item.article_title}`);
        console.log(`  ${item.url}`);
    });
```

### กรณีการใช้งาน

- **Dashboard ติดตามข่าว:** รวมหัวข้อข่าวจากสื่อไทยทั้งหมดไว้ในฟีดเดียว สำหรับนักข่าว นักวิเคราะห์ หรือทีม PR
- **NLP และวิเคราะห์ความรู้สึก:** ดึงบทความเต็มในปริมาณมากเพื่อฝึก language model หรือรัน sentiment classifier
- **ข่าวกรองเชิงแข่งขัน:** ติดตามการรายงานข่าวของบริษัท แบรนด์ หรืออุตสาหกรรมในสื่อไทย
- **วิจัยเชิงวิชาการ:** สร้างคลังข้อมูลข่าวสำหรับภาษาศาสตร์ รัฐศาสตร์ หรือสื่อศึกษา
- **ความเสี่ยงและ compliance:** ติดตามพัฒนาการทางการเมืองและเศรษฐกิจที่อาจส่งผลต่อการดำเนินธุรกิจ

### การใช้งานขั้นสูง

#### ตั้งเวลาติดตาม

ตั้งค่าการรันซ้ำเพื่อสร้างคลังข่าวต่อเนื่อง:

1. ไปที่แท็บ **Schedules** ของ actor
2. สร้างตารางเวลาใหม่ (เช่น ทุก 6 ชั่วโมง)
3. กำหนด input ตามจำนวนที่ต้องการ
4. ผลลัพธ์สะสมใน dataset สำหรับการวิเคราะห์ย้อนหลัง

#### เชื่อมต่อกับ Google Sheets

ส่งออกผลลัพธ์ไปยัง Google Sheets โดยตรง:

1. รัน actor
2. ไปที่ dataset
3. คลิก **Export** > **Google Sheets**

### รายละเอียดทางเทคนิค

#### วิธีการทำงาน

1. **ค้นพบ:** Actor ค้นหา URL บทความจากแหล่งข่าว
2. **กรองล่วงหน้า:** กรองบทความเบื้องต้นจาก metadata (วันที่, คำค้นหาในหัวข้อ) เพื่อข้ามการดาวน์โหลดที่ไม่จำเป็น
3. **ตัดซ้ำ:** ลบ URL ที่ซ้ำกันข้ามแหล่งข่าว และจัดเรียงบทความแบบ round-robin เพื่อกระจายแหล่งข่าวอย่างสม่ำเสมอ
4. **ดึงข้อมูล:** ดาวน์โหลดและแยกวิเคราะห์บทความเป็นชุดเพื่อดึงเนื้อหาแบบมีโครงสร้าง
5. **กรองหลังดึง:** กรองบทความอีกครั้งจากเนื้อหาเต็ม (วันที่ + คำค้นหาในหัวข้อและเนื้อหา)
6. **ผลลัพธ์:** ส่งข้อมูลไปยัง Apify dataset ของคุณ

#### ประสิทธิภาพ

- **ประมวลผลเป็นชุด:** การรันขนาดใหญ่ถูกแบ่งเป็นชุดอัตโนมัติเพื่อความเสถียร
- **ทนต่อข้อผิดพลาด:** หากแหล่งข่าวหนึ่งล้มเหลว แหล่งอื่นยังทำงานต่อ
- **หน่วยความจำ:** 256-512 MB ต่อการรัน

#### การจัดการข้อผิดพลาด

| ประเภท Error | พฤติกรรม |
|-------------|---------|
| แหล่งข่าวไม่พร้อมใช้งาน | ข้ามไป แหล่งอื่นทำงานต่อ |
| ดาวน์โหลดบทความล้มเหลว | ส่งกลับพร้อมข้อความ error |
| Rate limit (429) | ลองใหม่อัตโนมัติด้วย exponential backoff |
| Server error (5xx) | ลองใหม่อัตโนมัติ (3 ครั้ง) |

### ส่งออกข้อมูล

ผลลัพธ์สามารถส่งออกได้หลายรูปแบบ:

- **JSON** - ข้อมูลแบบมีโครงสร้างเต็ม
- **CSV** - แปลงเป็นแบบแบนสำหรับ spreadsheet
- **Excel** - ดาวน์โหลด .xlsx โดยตรง
- **XML** - สำหรับระบบเก่า

```bash
## JSON
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&token=YOUR_TOKEN"

## CSV
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=csv&token=YOUR_TOKEN"
```

### คำถามที่พบบ่อย

#### แต่ละการรันได้บทความกี่บทความ?

ขึ้นอยู่กับว่าแหล่งข่าวเผยแพร่อะไรบ้างเมื่อเร็วๆ นี้ การรันทั่วไปด้วย `limit: 0` จะได้หลายร้อยถึงหลายพันบทความจากทุกแหล่งข่าว

#### รายชื่อแหล่งข่าวอัปเดตบ่อยแค่ไหน?

แหล่งข่าวได้รับการคัดสรรและอัปเดตเป็นระยะ หากต้องการแนะนำแหล่งข่าว สามารถเปิด issue ใน repository ของ actor

#### Actor เก็บบทความย้อนหลังไหม?

ไม่ แต่ละการรันจะค้นพบบทความที่มีอยู่ในปัจจุบันจาก source feed หากต้องการสร้างคลังข่าวย้อนหลัง ให้ตั้งค่าการรันตามตารางเวลา

#### บทความเป็นภาษาอะไร?

บทความมีทั้งภาษาไทยและภาษาอังกฤษ ขึ้นอยู่กับแหล่งข่าว ภาษาของบทความระบุในฟิลด์ `language`

#### กรองด้วยคำค้นหาหรือวันที่ได้ไหม?

ได้ ใช้ `search_query` เพื่อกรองบทความด้วยคำค้นหา (จับคู่กับหัวข้อและเนื้อหาเต็ม) ใช้ `start_date` และ `end_date` เพื่อจำกัดบทความในช่วงวันที่ สามารถรวมฟิลเตอร์เหล่านี้ได้

#### กรองตามแหล่งข่าวได้ไหม?

ได้ แหล่งข่าวแต่ละแห่งมี toggle ใน input (เช่น `matichon`, `the_standard`) ตั้งค่าแหล่งข่าวเป็น `false` เพื่อไม่รวม แหล่งข่าวทั้งหมดเปิดใช้งานตามค่าเริ่มต้น คุณยังสามารถกรอง dataset ผลลัพธ์ด้วย `source_domain` หลังจากการรันเสร็จ

#### จะเกิดอะไรขึ้นถ้าแหล่งข่าวออฟไลน์?

Actor จะทำงานต่อกับแหล่งข่าวอื่นทั้งหมด แหล่งข่าวที่ล้มเหลวจะถูกบันทึก log แต่ไม่หยุดการรัน

#### ทำไม actor ประมวลผลบทความมากกว่า limit เมื่อใช้ search?

เมื่อตั้ง `search_query` actor จำเป็นต้องดาวน์โหลดและดึงบทความเพื่อตรวจสอบเนื้อหาเต็มกับคำค้นหา `limit` ควบคุมจำนวนบทความที่ตรงกันที่คุณได้รับ แต่อาจมีบทความมากกว่านั้นถูกประมวลผลเบื้องหลัง

### ข้อจำกัดความรับผิดชอบ

Actor นี้ดึงบทความข่าวที่เผยแพร่สาธารณะจากหน้าเว็บสาธารณะ ไม่ข้าม paywall การยืนยันตัวตน หรือข้อจำกัดการเข้าถึง ใช้ข้อมูลตามกฎหมายที่เกี่ยวข้องและข้อกำหนดการให้บริการของสำนักข่าวแต่ละแห่ง

***

**ต้องการความช่วยเหลือ?** เปิด issue ใน repository ของ actor หรือติดต่อฝ่ายสนับสนุนผ่าน Apify Console

# Actor input Schema

## `search_query` (type: `string`):

Filter articles by keyword. Only articles matching any word of the query in title, text, description or URL (case-insensitive) will be returned. Might process a lot of articles in the background.

## `start_date` (type: `string`):

Only include articles published on or after this date. Must not be in the future.

## `end_date` (type: `string`):

Only include articles published up to this date (taken as 00:00:00 when no time is given). Must not be older than 5 years.

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

Maximum number of articles to return (0 = unlimited). The actual number of processed articles might be higher if date and/or query filters are in use.

## `khaosod_english` (type: `boolean`):

Include articles from Khaosod English (khaosodenglish.com)

## `thai_enquirer` (type: `boolean`):

Include articles from Thai Enquirer (thaienquirer.com)

## `prachatai_english` (type: `boolean`):

Include articles from Prachatai English (prachataienglish.com)

## `thaiger` (type: `boolean`):

Include articles from Thaiger (thethaiger.com)

## `chiang_rai_times` (type: `boolean`):

Include articles from Chiang Rai Times (chiangraitimes.com)

## `pattaya_news` (type: `boolean`):

Include articles from The Pattaya News (thepattayanews.com)

## `thailand_business_news` (type: `boolean`):

Include articles from Thailand Business News (thailand-business-news.com)

## `matichon` (type: `boolean`):

Include articles from Matichon (matichon.co.th)

## `khaosod` (type: `boolean`):

Include articles from Khaosod (khaosod.co.th)

## `thai_post` (type: `boolean`):

Include articles from Thai Post (thaipost.net)

## `prachachat` (type: `boolean`):

Include articles from Prachachat (prachachat.net)

## `brand_inside` (type: `boolean`):

Include articles from Brand Inside (brandinside.asia)

## `the_standard` (type: `boolean`):

Include articles from THE STANDARD (thestandard.co)

## `the_matter` (type: `boolean`):

Include articles from The MATTER (thematter.co)

## `the_momentum` (type: `boolean`):

Include articles from THE MOMENTUM (themomentum.co)

## `prachatai` (type: `boolean`):

Include articles from Prachatai (prachatai.com)

## `ilaw` (type: `boolean`):

Include articles from iLaw (ilaw.or.th)

## `beartai` (type: `boolean`):

Include articles from Beartai (beartai.com)

## `siamphone` (type: `boolean`):

Include articles from Siamphone (siamphone.com)

## `thairath` (type: `boolean`):

Include articles from Thairath (thairath.co.th)

## `with_sentiment` (type: `boolean`):

Add a sentiment score to each article (positive/negative/neutral + confidence). $0.20 / 1,000 articles.

## `with_tags` (type: `boolean`):

Add LLM-generated category tags to each article. $1.50 / 1,000 articles.

## `with_summary` (type: `boolean`):

Add an LLM-generated compact summary to each article. $2.50 / 1,000 articles.

## `with_5w1h` (type: `boolean`):

Add Who/What/When/Where/Why/How extraction to each article. Requires at least 50 characters of article text. $4.00 / 1,000 articles.

## `with_language_detection` (type: `boolean`):

Detect the language of each article's text (code, confidence, candidates) into a separate detected_language field; the source-declared language stays unchanged. $0.10 / 1,000 articles.

## `with_fix_text` (type: `boolean`):

Repair garbled text (mojibake) in each article. The repaired text is returned in fixed_text, text stays unchanged, and other add-ons then analyse the fixed text. Charged only for articles whose text was actually repaired. $1.25 / 1,000 articles.

## Actor input object example

```json
{
  "limit": 100,
  "khaosod_english": true,
  "thai_enquirer": true,
  "prachatai_english": true,
  "thaiger": true,
  "chiang_rai_times": true,
  "pattaya_news": true,
  "thailand_business_news": true,
  "matichon": true,
  "khaosod": true,
  "thai_post": true,
  "prachachat": true,
  "brand_inside": true,
  "the_standard": true,
  "the_matter": true,
  "the_momentum": true,
  "prachatai": true,
  "ilaw": true,
  "beartai": true,
  "siamphone": true,
  "thairath": true,
  "with_sentiment": false,
  "with_tags": false,
  "with_summary": false,
  "with_5w1h": false,
  "with_language_detection": false,
  "with_fix_text": false
}
```

# Actor output Schema

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

Extracted news articles with title, text, authors, publish date, and source domain

# 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 = {
    "limit": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("bite-sized-insights/thailand-news-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 = { "limit": 100 }

# Run the Actor and wait for it to finish
run = client.actor("bite-sized-insights/thailand-news-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 '{
  "limit": 100
}' |
apify call bite-sized-insights/thailand-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bite-sized-insights/thailand-news-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/YriHG59cgHPgOZRx3/builds/gq9icgIC6JTNFMBhh/openapi.json
