# ดึงข้อมูล Pantip｜กระทู้ ความคิดเห็น Social Listening (`claude_code_reviewer/pantip-scraper`) Actor

ดึงข้อมูลจาก Pantip เว็บบอร์ดที่ใหญ่ที่สุดของไทย โดยไม่ต้องล็อกอินหรือใช้ API — ค้นหากระทู้ทั้งเว็บด้วยคีย์เวิร์ด พร้อมเนื้อหากระทู้และความคิดเห็นทั้งหมด (รวมคอมเมนต์ย่อย) ผู้เขียน แท็ก คะแนน และเวลา ส่งออกเป็น JSON/CSV/Excel เหมาะสำหรับ social listening มอนิเตอร์แบรนด์ และวิจัยตลาดไทย

- **URL**: https://apify.com/claude\_code\_reviewer/pantip-scraper.md
- **Developed by:** [Chad](https://apify.com/claude_code_reviewer) (community)
- **Categories:** AI, News, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 搜尋主題

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## เครื่องมือดึงข้อมูล Pantip｜กระทู้ ความคิดเห็น และ Social Listening (ไม่ต้องใช้ API)

ดึงเนื้อหาสาธารณะจาก **Pantip (pantip.com)** — เว็บบอร์ดสนทนาที่ใหญ่ที่สุดและมีทราฟฟิกสูงสุดแห่งหนึ่งของไทย: **ค้นหากระทู้ทั้งเว็บด้วยคีย์เวิร์ด** และ **ดึงเนื้อหากระทู้พร้อมความคิดเห็นทั้งหมด (รวมคอมเมนต์ย่อย)**. ทำงานผ่าน endpoint สาธารณะ ไม่ต้องล็อกอิน ไม่ต้องใช้ token ไม่ต้องเปิดเบราว์เซอร์ (HTTP ล้วน). วางคีย์เวิร์ด topic ID หรือ URL แบบเป็นชุด ได้ข้อมูล snake\_case ที่มีโครงสร้าง เติม `null` เมื่อไม่มีค่า และแนบ `scraped_at` แบบ ISO 8601 ทุกแถว.

เหมาะสำหรับ: **social listening / มอนิเตอร์แบรนด์** ในตลาดไทย, เสียงผู้บริโภคและกระแสคู่แข่ง, ปฏิกิริยาต่อสินค้าที่เพิ่งเปิดตัว, และงานวิจัยตลาด.

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

| ฟิลด์ | ชนิด | คำอธิบาย |
|---|---|---|
| `topic_id` | string | Topic ID (คือ `topic/{id}` ใน URL) |
| `site` | string | ค่าคงที่ `"pantip"` |
| `comment_id` | string | null | แถวความคิดเห็นเป็น `{topic_id}-{ชั้น}`; แถวกระทู้/ค้นหาเป็น null |
| `floor` | string | null | ชั้นของความคิดเห็น; คอมเมนต์ย่อยเป็น `{เลขคอมเมนต์}-{เลขรีพลาย}` |
| `is_reply` | boolean | เป็นคอมเมนต์ย่อยหรือไม่ (มีความหมายเฉพาะแถวความคิดเห็น) |
| `title` | string | null | ชื่อกระทู้ (แถวค้นหา/แถวกระทู้) |
| `author` | string | null | ชื่อผู้ตั้งกระทู้/ผู้คอมเมนต์ |
| `author_id` | string | null | ID สมาชิก |
| `content` | string | null | เนื้อหากระทู้หรือความคิดเห็น (แปลง HTML เป็นข้อความล้วน); แถวค้นหาเป็น null |
| `content_images` | array | URL รูปภาพในเนื้อหา (สติกเกอร์/รูปแนบ) |
| `tags` | array | แท็กของกระทู้ (แถวกระทู้); แถวค้นหาเป็น array ว่าง |
| `comment_count` | number | null | จำนวนความคิดเห็นที่แสดงบนการ์ดผลค้นหา |
| `score` | number | null | คะแนนโหวตของความคิดเห็น (Pantip good\_bad\_vote.point) |
| `created_at` | string | null | เวลาตั้งกระทู้/คอมเมนต์ (ISO 8601; การ์ดค้นหามีความละเอียดระดับวัน) |
| `topic_url` | string | null | ลิงก์กระทู้ |
| `source_mode` | string | `search` หรือ `topic` |
| `source_query` | string | คีย์เวิร์ดหรือ topic ID ที่ตรงกัน |
| `scraped_at` | string | เวลาที่ดึงข้อมูล (ISO 8601) |

### โหมด

| โหมด | อินพุต | ผลลัพธ์ | การคิดเงิน |
|---|---|---|---|
| `search` (ค่าเริ่มต้น) | `keywords[]` (ค้นหาทั้งเว็บ), `dateFrom`, `maxItems` | รายการกระทู้ต่อคีย์เวิร์ด | `search-listing` $0.002/รายการ |
| `topic` | `topicIds[]`／`topicUrls[]`, `maxItems` (ลิมิตความคิดเห็นต่อกระทู้) | เนื้อหากระทู้ + ความคิดเห็นทั้งหมด (รวมคอมเมนต์ย่อย) | `product-detail` $0.008/กระทู้ ＋ `review-item` $0.003/ความเห็น |

### ฟิลด์อินพุต

| ฟิลด์ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| `mode` | string | `search` | `search` (ค้นหาทั้งเว็บ) หรือ `topic` (กระทู้เต็ม) |
| `keywords` | array | — | คีย์เวิร์ดค้นหา (ไทย/อังกฤษ/ชื่อแบรนด์) โหมด `search` ต้องกรอกอย่างน้อยหนึ่ง |
| `topicIds` | array | — | Topic ID (ตัวเลข) ใช้กับโหมด `topic` |
| `topicUrls` | array | — | URL กระทู้แบบเต็ม ดึง ID อัตโนมัติ |
| `bulkInput` | string | — | หนึ่งบรรทัดต่อรายการ; `search` = คีย์เวิร์ด, `topic` = ID/URL |
| `maxItems` | integer | 50 | `search`: จำนวนกระทู้ต่อคีย์เวิร์ด; `topic`: จำนวนความคิดเห็นต่อกระทู้ (เนื้อหากระทู้คืนเสมอ) สูงสุด 500 |
| `dateFrom` | string | — | ใช้กับ `search`; สัมพัทธ์ `3d`／`12h`／`2w` หรือเจาะจง `MM/DD/YY` |
| `proxyConfiguration` | object | Apify datacenter | เปิดเป็นค่าเริ่มต้น; ไม่ใช้ proxy จะแชร์ IP ขาออกและเสี่ยงถูกจำกัดอัตรา |

### ตัวอย่าง JSON

**1) ค้นหากระแสแบรนด์**

```json
{ "mode": "search", "keywords": ["iPhone", "Samsung"], "maxItems": 10 }
```

**2) เอาเฉพาะกระทู้ใน 30 วันล่าสุด**

```json
{ "mode": "search", "keywords": ["โตโยต้า"], "maxItems": 20, "dateFrom": "30d" }
```

**3) ดึงกระทู้เต็ม (เนื้อหา + ความคิดเห็นทั้งหมด)**

```json
{ "mode": "topic", "topicIds": ["44209153"], "maxItems": 200 }
```

**4) ดึงหลายกระทู้ด้วย URL**

```json
{ "mode": "topic", "bulkInput": "https://pantip.com/topic/44209153\nhttps://pantip.com/topic/44008597" }
```

**5) แยกความคิดเห็นทีละแถว (รวมคอมเมนต์ย่อย)**

```json
{ "mode": "topic", "topicIds": ["44209153"], "maxItems": 500 }
```

### ข้อควรทราบ

- **`search` เป็นการค้นหาคีย์เวิร์ดทั้งเว็บ Pantip** (ไม่ใช่การกรองภายในห้อง) แต่ v1 คืนผล**หน้าแรก**ต่อคีย์เวิร์ด (ราว 10 รายการที่เกี่ยวข้องที่สุด); การค้นหาหลายหน้าใช้ API ที่ต้องยืนยันตัวตนของ Pantip จึงจัดเป็น v1.1 ตั้งเวลารันเป็นระยะและใช้ `dateFrom` เพื่อเก็บกระทู้ใหม่ ก็มอนิเตอร์ได้ต่อเนื่อง
- **การแบ่งหน้าความคิดเห็นในโหมด `topic`**: Pantip แสดง 100 ความเห็นต่อหน้า ระบบจะไล่หน้าให้อัตโนมัติจนถึง `maxItems` กระทู้ยอดนิยมกระทู้เดียวอาจมีความเห็นหลักพัน ควรใช้ `maxItems` ควบคุมต้นทุน
- ความคิดเห็นที่เป็นสติกเกอร์/รูปล้วน ฟิลด์ `content` จะเป็น null และ URL รูปอยู่ใน `content_images`
- เวลา: เนื้อหากระทู้และความคิดเห็นเป็นเวลาที่แม่นยำ; การ์ดผลค้นหาเป็นความละเอียดระดับวัน (วันที่พุทธศักราชของไทย แปลงเป็นคริสต์ศักราชแล้ว)
- ค่าเริ่มต้นใช้ Apify datacenter proxy; ทดสอบในเครื่องตั้ง `proxyConfiguration.useApifyProxy = false` ได้

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

- **ต้องล็อกอินหรือใช้ API key ไหม?** ไม่ต้อง ดึงเฉพาะเนื้อหาสาธารณะ
- **ดึงความคิดเห็นได้ไหม?** ได้ โหมด `topic` จะคืนเนื้อหากระทู้และความคิดเห็นทั้งหมด (รวมคอมเมนต์ย่อย) แยกทีละแถว
- **มอนิเตอร์เฉพาะบางคีย์เวิร์ดได้ไหม?** ได้ ใช้โหมด `search` กรอกคีย์เวิร์ด แล้วตั้ง `dateFrom` เพื่อมอนิเตอร์แบบประหยัดที่สุด
- **รูปแบบผลลัพธ์?** ส่งออกผ่าน Apify Dataset เป็น JSON／CSV／Excel／HTML／API

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

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

***

*คีย์เวิร์ด: ดึงข้อมูล Pantip, Pantip scraper, สแครป Pantip, เว็บบอร์ดไทย, Thai forum, social listening ไทย, มอนิเตอร์แบรนด์, ฟังเสียงโซเชียล, sentiment, วิจัยตลาด, pantip.com, กระทู้, ความคิดเห็น, คอมเมนต์.*

# Actor input Schema

## `mode` (type: `string`):

ต้องการดึงอะไร? เลือกหนึ่งโหมด แล้วกรอกเฉพาะช่องที่เกี่ยวข้องด้านล่าง

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

คีย์เวิร์ดที่ต้องการค้นหา (ไทย อังกฤษ หรือชื่อแบรนด์) แต่ละคีย์เวิร์ดจะค้นหาทั้งเว็บ Pantip หนึ่งครั้ง ใช้กับโหมดค้นหาทั้งเว็บ หมายเหตุ: v1 คืนผลหน้าแรกของการค้นหาต่อคีย์เวิร์ด (ราว 10 รายการที่เกี่ยวข้องที่สุด) การค้นหาหลายหน้าเป็น v1.1

## `topicIds` (type: `array`):

Topic ID ของ Pantip (ตัวเลข คือ topic/{id} ใน URL) เช่น 44209153 ใช้กับโหมดกระทู้เต็ม

## `topicUrls` (type: `array`):

URL กระทู้ Pantip แบบเต็ม เช่น https://pantip.com/topic/44209153 ระบบจะดึง topic ID ออกให้อัตโนมัติ

## `bulkInput` (type: `string`):

**หนึ่งบรรทัดต่อหนึ่งรายการ** กด Enter ขึ้นบรรทัดใหม่ ไม่ต้องใส่เครื่องหมายคำพูดหรือจุลภาค โหมดค้นหาจะถือเป็นคีย์เวิร์ด โหมดกระทู้เต็มจะถือเป็น topic ID หรือ URL และรวมเข้ากับช่องด้านบนโดยอัตโนมัติตอนรัน วิธีเร็วที่สุดคือคัดลอกทั้งคอลัมน์จาก Google Sheet / Excel มาวาง

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

โหมดค้นหา: จำนวนกระทู้สูงสุดต่อคีย์เวิร์ด โหมดกระทู้เต็ม: จำนวนความคิดเห็นสูงสุดต่อกระทู้ (เนื้อหากระทู้จะคืนเสมอ ไม่นับรวมในลิมิตนี้) สูงสุด 500

## `dateFrom` (type: `string`):

ใช้กับโหมดค้นหา พิจารณาจากวันที่ตั้งกระทู้ (การ์ดผลค้นหา Pantip มีความละเอียดระดับวัน) รูปแบบ: เวลาสัมพัทธ์ 3d (ภายใน 3 วัน), 12h, 2w หรือวันที่แบบเจาะจง MM/DD/YY เว้นว่าง = ไม่กรอง เหมาะกับการตั้งเวลามอนิเตอร์เพื่อเอาเฉพาะกระทู้ใหม่

## `proxyConfiguration` (type: `object`):

ค่าเริ่มต้นใช้ Apify datacenter proxy: หากไม่ใช้ proxy จะแชร์ IP ขาออกกับรันอื่นบนแพลตฟอร์ม เสี่ยงถูกเว็บบอร์ดจำกัดอัตรา (429, หน้าไม่ครบ) การตอบกลับมีขนาดเล็ก ค่า traffic ของ proxy แทบไม่มีนัยสำคัญ ปิดเฉพาะเมื่อมี proxy ของตัวเองหรือทดสอบในเครื่อง

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "iPhone"
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "mode": "search",
    "keywords": [
        "iPhone"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("claude_code_reviewer/pantip-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 = {
    "mode": "search",
    "keywords": ["iPhone"],
}

# Run the Actor and wait for it to finish
run = client.actor("claude_code_reviewer/pantip-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 '{
  "mode": "search",
  "keywords": [
    "iPhone"
  ]
}' |
apify call claude_code_reviewer/pantip-scraper --silent --output-dataset

```

## MCP server setup

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