{
  "openapi": "3.0.1",
  "info": {
    "title": "ดึงข้อมูล Pantip｜กระทู้ ความคิดเห็น Social Listening",
    "description": "ดึงข้อมูลจาก Pantip เว็บบอร์ดที่ใหญ่ที่สุดของไทย โดยไม่ต้องล็อกอินหรือใช้ API — ค้นหากระทู้ทั้งเว็บด้วยคีย์เวิร์ด พร้อมเนื้อหากระทู้และความคิดเห็นทั้งหมด (รวมคอมเมนต์ย่อย) ผู้เขียน แท็ก คะแนน และเวลา ส่งออกเป็น JSON/CSV/Excel เหมาะสำหรับ social listening มอนิเตอร์แบรนด์ และวิจัยตลาดไทย",
    "version": "1.0",
    "x-build-id": "JpEFCQdI9J8kYTWb6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/claude_code_reviewer~pantip-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-claude_code_reviewer-pantip-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/claude_code_reviewer~pantip-scraper/runs": {
      "post": {
        "operationId": "runs-sync-claude_code_reviewer-pantip-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/claude_code_reviewer~pantip-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-claude_code_reviewer-pantip-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "🎯 โหมด",
            "enum": [
              "search",
              "topic"
            ],
            "type": "string",
            "description": "ต้องการดึงอะไร? เลือกหนึ่งโหมด แล้วกรอกเฉพาะช่องที่เกี่ยวข้องด้านล่าง",
            "default": "search"
          },
          "keywords": {
            "title": "🔍 คีย์เวิร์ดค้นหา",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "คีย์เวิร์ดที่ต้องการค้นหา (ไทย อังกฤษ หรือชื่อแบรนด์) แต่ละคีย์เวิร์ดจะค้นหาทั้งเว็บ Pantip หนึ่งครั้ง ใช้กับโหมดค้นหาทั้งเว็บ หมายเหตุ: v1 คืนผลหน้าแรกของการค้นหาต่อคีย์เวิร์ด (ราว 10 รายการที่เกี่ยวข้องที่สุด) การค้นหาหลายหน้าเป็น v1.1",
            "items": {
              "type": "string"
            }
          },
          "topicIds": {
            "title": "💬 Topic ID",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Topic ID ของ Pantip (ตัวเลข คือ topic/{id} ใน URL) เช่น 44209153 ใช้กับโหมดกระทู้เต็ม",
            "items": {
              "type": "string"
            }
          },
          "topicUrls": {
            "title": "💬 URL กระทู้",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "URL กระทู้ Pantip แบบเต็ม เช่น https://pantip.com/topic/44209153 ระบบจะดึง topic ID ออกให้อัตโนมัติ",
            "items": {
              "type": "string"
            }
          },
          "bulkInput": {
            "title": "📋 วางแบบเป็นชุด",
            "type": "string",
            "description": "**หนึ่งบรรทัดต่อหนึ่งรายการ** กด Enter ขึ้นบรรทัดใหม่ ไม่ต้องใส่เครื่องหมายคำพูดหรือจุลภาค โหมดค้นหาจะถือเป็นคีย์เวิร์ด โหมดกระทู้เต็มจะถือเป็น topic ID หรือ URL และรวมเข้ากับช่องด้านบนโดยอัตโนมัติตอนรัน วิธีเร็วที่สุดคือคัดลอกทั้งคอลัมน์จาก Google Sheet / Excel มาวาง"
          },
          "maxItems": {
            "title": "📊 จำนวนสูงสุด",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "โหมดค้นหา: จำนวนกระทู้สูงสุดต่อคีย์เวิร์ด โหมดกระทู้เต็ม: จำนวนความคิดเห็นสูงสุดต่อกระทู้ (เนื้อหากระทู้จะคืนเสมอ ไม่นับรวมในลิมิตนี้) สูงสุด 500",
            "default": 50
          },
          "dateFrom": {
            "title": "📅 เอาเฉพาะรายการหลังเวลานี้ (ไม่บังคับ)",
            "type": "string",
            "description": "ใช้กับโหมดค้นหา พิจารณาจากวันที่ตั้งกระทู้ (การ์ดผลค้นหา Pantip มีความละเอียดระดับวัน) รูปแบบ: เวลาสัมพัทธ์ 3d (ภายใน 3 วัน), 12h, 2w หรือวันที่แบบเจาะจง MM/DD/YY เว้นว่าง = ไม่กรอง เหมาะกับการตั้งเวลามอนิเตอร์เพื่อเอาเฉพาะกระทู้ใหม่"
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy (เปิด Apify datacenter proxy เป็นค่าเริ่มต้น)",
            "type": "object",
            "description": "ค่าเริ่มต้นใช้ Apify datacenter proxy: หากไม่ใช้ proxy จะแชร์ IP ขาออกกับรันอื่นบนแพลตฟอร์ม เสี่ยงถูกเว็บบอร์ดจำกัดอัตรา (429, หน้าไม่ครบ) การตอบกลับมีขนาดเล็ก ค่า traffic ของ proxy แทบไม่มีนัยสำคัญ ปิดเฉพาะเมื่อมี proxy ของตัวเองหรือทดสอบในเครื่อง",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}