---
title: "Zhihu การค้นหาคำสำคัญ API (V1)"
description: "ค้นหาใน Zhihu โดยใช้คำสำคัญ พร้อมการควบคุมประเภทผลลัพธ์ การจัดเรียง ช่วงเวลา การแสดงหัวข้อ และออฟเซ็ต สำหรับการค้นหาคำตอบ บทความ หรือวิดีโอที่เกี่ยวข้อง"
lastUpdated: false
aiUsagePrompt: true
---

# Zhihu การค้นหาคำสำคัญ API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/zhihu/search/v1\"")'
  :summary='JSON.parse("\"การค้นหาคำสำคัญ (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/zhihu/keyword-search-v1-th.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"TOKEN\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"คำสำคัญสำหรับการค้นหา\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"offset\",\"in\":\"query\",\"description\":\"จุดเริ่มต้น, เริ่มต้นที่ 0.\",\"required\":false,\"schema\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":0}},{\"name\":\"showAllTopics\",\"in\":\"query\",\"description\":\"ว่าจะแสดงหัวข้อทั้งหมดหรือไม่.\\n\\nค่าใช้ได้:\\n- `FALSE`: ไม่แสดงหัวข้อ\\n- `TRUE`: แสดงหัวข้อทั้งหมด\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"FALSE\",\"description\":\"ตัวเลือกการแสดงหัวข้อการค้นหาของ Zhihu\",\"enum\":[\"FALSE\",\"TRUE\"]}},{\"name\":\"vertical\",\"in\":\"query\",\"description\":\"ตัวกรองประเภทของผลลัพธ์.\\n\\nค่าใช้ได้:\\n- `answer`: เฉพาะคำตอบ\\n- `article`: เฉพาะบทความ\\n- `zvideo`: เฉพาะวิดีโอ\",\"required\":false,\"schema\":{\"type\":\"string\",\"description\":\"ประเภทผลการค้นหาของ Zhihu\",\"enum\":[\"answer\",\"article\",\"zvideo\"]}},{\"name\":\"sort\",\"in\":\"query\",\"description\":\"เกณฑ์การจัดเรียง.\\n\\nค่าใช้ได้:\\n- `upvoted_count`: คำตอบที่ได้รับการโหวตมากที่สุด\\n- `created_time`: บทความที่เผยแพร่ล่าสุด\",\"required\":false,\"schema\":{\"type\":\"string\",\"description\":\"เกณฑ์การจัดเรียงการค้นหาของ Zhihu\",\"enum\":[\"upvoted_count\",\"created_time\"]}},{\"name\":\"timeInterval\",\"in\":\"query\",\"description\":\"ตัวกรองช่วงเวลาในการเผยแพร่.\\n\\nค่าใช้ได้:\\n- `a_day`: ภายในหนึ่งวัน\\n- `a_week`: ภายในหนึ่งสัปดาห์\\n- `a_month`: ภายในหนึ่งเดือน\\n- `three_months`: ภายในสามเดือน\\n- `half_a_year`: ภายในครึ่งปี\\n- `a_year`: ภายในหนึ่งปี\",\"required\":false,\"schema\":{\"type\":\"string\",\"description\":\"ช่วงเวลาการเผยแพร่การค้นหาของ Zhihu\",\"enum\":[\"a_day\",\"a_week\",\"a_month\",\"three_months\",\"half_a_year\",\"a_year\"]}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"description\":\"ผลการค้นหาคีย์เวิร์ดและการแสดงผลการแบ่งหน้าเมื่อ payload ที่สำเร็จเป็นอ็อบเจกต์.\",\"properties\":{\"paging\":{\"type\":\"object\",\"description\":\"สถานะการแสดงผลการแบ่งหน้าสำหรับการตอบกลับการค้นหานี้.\",\"properties\":{\"is_end\":{\"type\":\"boolean\",\"description\":\"ว่าการตอบกลับนี้รายงานถึงจุดสิ้นสุดของผลการค้นหาหรือไม่. หยุดเมื่อเป็น true, แม้ว่าจะยังมีหน้าถัดไปอยู่ก็ตาม.\"},\"next\":{\"type\":\"string\",\"description\":\"URL การแสดงผลการแบ่งหน้าที่จูฮูรายงาน. เมื่อ is_end เป็น false, ใช้ค่า offset ที่ส่งกลับมาจาก endpoint นี้ในการเรียกใช้ครั้งต่อไป และคงค่าคีย์เวิร์ดและตัวเลือกไว้ไม่เปลี่ยนแปลง.\"}}},\"data\":{\"type\":\"array\",\"description\":\"หน้าข้อมูลผลการค้นหาที่ส่งกลับมาที่ตำแหน่งนี้ อนุกรมอาจว่างเปล่าได้ ประเภทหน้าข้อมูลและฟิลด์ที่มีอยู่อาจแตกต่างกัน\",\"items\":{\"type\":\"object\",\"description\":\"หน้าต่างผลการค้นหาหนึ่งหน้า\",\"properties\":{\"id\":{\"type\":[\"integer\",\"string\"],\"description\":\"ตัวระบุที่ส่งกลับมาสำหรับหน้าข้อมูลผลการค้นหาด้านนอก หากมี\"},\"type\":{\"type\":\"string\",\"description\":\"ประเภทของหน้าข้อมูลผลการค้นหาด้านนอก\"},\"index\":{\"type\":\"integer\",\"description\":\"อินเด็กซ์ของผลลัพธ์ที่รายงานสำหรับหน้านี้\"},\"highlight\":{\"type\":[\"object\",\"null\"],\"description\":\"ส่วนที่ได้รับการเน้นย้ำของผลลัพธ์ที่ตรงกัน หากมีการระบุ\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"ชื่อเรื่องที่ได้รับการเน้นย้ำในหน้าค้นหา\"},\"description\":{\"type\":\"string\",\"description\":\"คำอธิบายที่ได้รับการเน้นย้ำในหน้าค้นหา\"},\"name\":{\"type\":\"string\",\"description\":\"ชื่อที่ได้รับการเน้นย้ำในหน้าค้นหา\"},\"creator\":{\"type\":\"string\",\"description\":\"ชื่อผู้สร้างที่ได้รับการเน้นย้ำในหน้าค้นหา\"}}},\"object\":{\"type\":\"object\",\"description\":\"เนื้อหาที่แนบมาด้วยกับหน้านี้ เช่น คำตอบ บทความ คำถาม ประวัติ หรือวิดีโอ ฟิลด์จะขึ้นอยู่กับประเภทของเนื้อหา\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ตัวระบุที่ส่งกลับมาสำหรับเนื้อหาที่แนบมาด้วยกับหน้านี้ หากมี\"},\"type\":{\"type\":\"string\",\"description\":\"ประเภทของเนื้อหาที่แนบมาด้วยกับการ์ดนั้น\"},\"title\":{\"type\":\"string\",\"description\":\"ชื่อของเนื้อหาที่แนบมา หากมีการระบุ\"},\"description\":{\"type\":[\"string\",\"object\"],\"description\":\"คำอธิบายที่ส่งกลับสำหรับเนื้อหา บางประเภทของคาร์ดจะมีคำอธิบายที่มีโครงสร้าง\"},\"raw_description\":{\"type\":\"string\",\"description\":\"สตริงคำอธิบายดิบที่ส่งกลับสำหรับเนื้อหาวิดีโอ\"},\"excerpt\":{\"type\":\"string\",\"description\":\"ข้อความตัวอย่างที่ส่งกลับสำหรับเนื้อหา ซึ่งอาจมี HTML\"},\"content\":{\"type\":\"string\",\"description\":\"เนื้อหาสำหรับเนื้อหา ซึ่งอาจมี HTML\"},\"url\":{\"type\":\"string\",\"description\":\"URL ของ Zhihu สำหรับเนื้อหานี้\"},\"redirect_url\":{\"type\":\"string\",\"description\":\"URL ของจุดหมายสำหรับคาร์ด หากมี\"},\"image_url\":{\"type\":\"string\",\"description\":\"URL ของรูปภาพสำหรับคาร์ด\"},\"is_anonymous\":{\"type\":\"boolean\",\"description\":\"สัญญาณการไม่ระบุตัวตนสำหรับเนื้อหา\"},\"created_time\":{\"type\":\"integer\",\"description\":\"เวลาการสร้างสำหรับเนื้อหาในหน่วยวินาที Unix\"},\"updated_time\":{\"type\":\"integer\",\"description\":\"เวลาการอัปเดตล่าสุดสำหรับเนื้อหาในหน่วยวินาที Unix\"},\"voteup_count\":{\"type\":\"integer\",\"description\":\"จำนวนการโหวตสำหรับเนื้อหาหรือโปรไฟล์\"},\"comment_count\":{\"type\":\"integer\",\"description\":\"จำนวนความคิดเห็นสำหรับเนื้อหา\"},\"favorites_count\":{\"type\":\"integer\",\"description\":\"จำนวนการชื่นชอบสำหรับเนื้อหา\"},\"visits_count\":{\"type\":\"integer\",\"description\":\"จำนวนการเยี่ยมชมสำหรับเนื้อหา\"},\"answer_count\":{\"type\":\"integer\",\"description\":\"จำนวนคำตอบสำหรับคำถามหรือโปรไฟล์\"},\"articles_count\":{\"type\":\"integer\",\"description\":\"จำนวนบทความของโปรไฟล์ตามที่รายงาน\"},\"follower_count\":{\"type\":\"integer\",\"description\":\"จำนวนผู้ติดตามสำหรับโปรไฟล์หรือคำถาม\"},\"name\":{\"type\":\"string\",\"description\":\"ชื่อที่แสดงสำหรับผลลัพธ์ของโปรไฟล์\"},\"headline\":{\"type\":\"string\",\"description\":\"หัวข้อของโปรไฟล์ที่ส่งกลับพร้อมกับผลลัพธ์ของโปรไฟล์\"},\"avatar_url\":{\"type\":\"string\",\"description\":\"URL ของรูปภาพโปรไฟล์\"},\"url_token\":{\"type\":\"string\",\"description\":\"ชื่อสาธารณะของโปรไฟล์ที่ใช้ใน URL ของโปรไฟล์บน Zhihu\"},\"question\":{\"type\":\"object\",\"description\":\"คำถามที่เกี่ยวข้องกับผลลัพธ์ของคำตอบ\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ตัวระบุคำถามของ Zhihu\"},\"name\":{\"type\":\"string\",\"description\":\"หัวข้อของคำถามที่ส่งกลับพร้อมกับคำตอบ\"},\"type\":{\"type\":\"string\",\"description\":\"ประเภทของวัตถุคำถามที่เกี่ยวข้อง\"},\"url\":{\"type\":\"string\",\"description\":\"URL ที่ส่งกลับสำหรับคำถามที่เกี่ยวข้อง\"},\"answer_count\":{\"type\":\"integer\",\"description\":\"จำนวนคำตอบที่ส่งกลับสำหรับคำถามที่เกี่ยวข้อง\"}}},\"author\":{\"type\":\"object\",\"description\":\"ประวัติผู้เขียนที่ระบุไว้ในเนื้อหา.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ตัวระบุประวัติผู้เขียน.\"},\"url_token\":{\"type\":\"string\",\"description\":\"ชื่อเรื่องที่เผยแพร่ใน URL ประวัติผู้เขียนบน Zhihu.\"},\"name\":{\"type\":\"string\",\"description\":\"ชื่อที่ปรากฏของผู้เขียน.\"},\"headline\":{\"type\":\"string\",\"description\":\"หัวข้อของประวัติผู้เขียน.\"},\"avatar_url\":{\"type\":\"string\",\"description\":\"URL ของภาพโปรไฟล์ของผู้เขียน.\"},\"url\":{\"type\":\"string\",\"description\":\"URL ที่ส่งกลับสำหรับประวัติผู้เขียน.\"},\"type\":{\"type\":\"string\",\"description\":\"ประเภทของอ็อบเจกต์ประวัติผู้เขียน.\"},\"follower_count\":{\"type\":\"integer\",\"description\":\"จำนวนผู้ติดตามที่ผู้เขียนมี\"},\"voteup_count\":{\"type\":\"integer\",\"description\":\"จำนวนการโหวตที่รายงานสำหรับผู้เขียน.\"}}},\"zvideo_id\":{\"type\":\"string\",\"description\":\"ตัวระบุของโพสต์วิดีโอบน Zhihu.\"},\"video_id\":{\"type\":\"string\",\"description\":\"ตัวระบุสื่อวิดีโอ.\"},\"video_url\":{\"type\":\"string\",\"description\":\"URL ของวิดีโอที่ส่งกลับสำหรับผลลัพธ์.\"},\"video_answer_url\":{\"type\":\"string\",\"description\":\"URL ที่ส่งกลับสำหรับคำตอบที่เกี่ยวข้องกับวิดีโอ หากมี.\"},\"cover_url\":{\"type\":\"string\",\"description\":\"URL ภาพปกวิดีโอ\"},\"creator\":{\"type\":\"string\",\"description\":\"ชื่อของผู้สร้างที่ระบุไว้ในผลลัพธ์ของวิดีโอ.\"},\"created_at\":{\"type\":\"integer\",\"description\":\"เวลาที่สร้างวิดีโอที่ระบุไว้สำหรับวิดีโอ.\"},\"updated_at\":{\"type\":\"integer\",\"description\":\"เวลาที่อัปเดตครั้งล่าสุดสำหรับวิดีโอ.\"},\"duration\":{\"type\":\"number\",\"description\":\"ค่าชั่วโมงที่รายงานสำหรับวิดีโอ\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของวิดีโอในพิกเซล\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของวิดีโอในพิกเซล\"},\"play_count\":{\"type\":\"integer\",\"description\":\"จำนวนครั้งที่วิดีโอถูกเล่นที่ถูกรายงาน.\"},\"playlist\":{\"type\":\"object\",\"description\":\"ตัวเลือกการเล่นที่จัดกลุ่มตามคีย์คุณภาพ ตัวเลือกที่มีอยู่อาจแตกต่างกันในแต่ละวิดีโอ.\",\"properties\":{\"ld\":{\"type\":\"object\",\"description\":\"ตัวเลือกการเล่น LD หากมีการส่งกลับ.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น.\"},\"play_url\":{\"type\":\"string\",\"description\":\"URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก.\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของตัวเลือกการเล่นในพิกเซล.\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของตัวเลือกการเล่นในพิกเซล.\"},\"format\":{\"type\":\"string\",\"description\":\"รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น.\"},\"quality\":{\"type\":\"string\",\"description\":\"ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น.\"}}},\"sd\":{\"type\":\"object\",\"description\":\"ตัวเลือกการเล่น SD หากมีการส่งกลับ.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น.\"},\"play_url\":{\"type\":\"string\",\"description\":\"URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก.\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของตัวเลือกการเล่นในพิกเซล.\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของตัวเลือกการเล่นในพิกเซล.\"},\"format\":{\"type\":\"string\",\"description\":\"รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น.\"},\"quality\":{\"type\":\"string\",\"description\":\"ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น.\"}}},\"hd\":{\"type\":\"object\",\"description\":\"ตัวเลือกการเล่น HD หากมีการส่งกลับ.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น.\"},\"play_url\":{\"type\":\"string\",\"description\":\"URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก.\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของตัวเลือกการเล่นในพิกเซล.\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของตัวเลือกการเล่นในพิกเซล.\"},\"format\":{\"type\":\"string\",\"description\":\"รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น.\"},\"quality\":{\"type\":\"string\",\"description\":\"ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น.\"}}},\"fhd\":{\"type\":\"object\",\"description\":\"ตัวเลือกการเล่น FHD หากมีการส่งกลับ.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น.\"},\"play_url\":{\"type\":\"string\",\"description\":\"URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก.\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของตัวเลือกการเล่นในพิกเซล.\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของตัวเลือกการเล่นในพิกเซล.\"},\"format\":{\"type\":\"string\",\"description\":\"รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น.\"},\"quality\":{\"type\":\"string\",\"description\":\"ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น.\"}}}}},\"video_info\":{\"type\":\"object\",\"description\":\"ข้อมูลสื่อเพิ่มเติมที่มีให้กับวิดีโอ\",\"properties\":{\"video_id\":{\"type\":\"string\",\"description\":\"ตัวระบุสื่อวิดีโอ.\"},\"duration\":{\"type\":\"number\",\"description\":\"ค่าความยาวที่รายงานในข้อมูลวิดีโอ\"},\"width\":{\"type\":\"integer\",\"description\":\"ความกว้างของวิดีโอในพิกเซล\"},\"height\":{\"type\":\"integer\",\"description\":\"ความสูงของวิดีโอในพิกเซล\"},\"play_count\":{\"type\":\"integer\",\"description\":\"จำนวนครั้งที่เล่นที่รายงานในข้อมูลวิดีโอ\"}}}}}}}},\"related_search_result\":{\"type\":\"array\",\"description\":\"ผลการค้นหาที่เกี่ยวข้องที่ Zhihu แสดงเป็นอาร์เรย์สามารถว่างเปล่าได้\"}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"พารามิเตอร์หรือเนื้อหาของคำขอที่ไม่ถูกต้อง\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"ท่อนำข้อมูลหรือ access token ที่ไม่ถูกต้องหรือไม่มีการใช้งาน\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"การอนุญาตถูกปฏิเสธ\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"อัตราการขอหรือจำนวนคำสั่งที่จำกัดในแต่ละวันถูกเกิน\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"ความผิดพลาดของเซิร์ฟเวอร์ภายใน\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"บริการไม่สามารถใช้งานได้ในขณะนี้\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"API สำหรับการผลิตทั่วโลก (ค่าเริ่มต้น)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/zhihu/search/v1\"")' />

<p>ค้นหาใน Zhihu โดยใช้คำสำคัญ พร้อมการควบคุมประเภทผลลัพธ์ การจัดเรียง ช่วงเวลา การแสดงหัวข้อ และออฟเซ็ต สำหรับการค้นหาคำตอบ บทความ หรือวิดีโอที่เกี่ยวข้อง</p>

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

<div class="api-doc-table api-doc-table--params">

| ชื่อ | ตำแหน่ง | ชนิดข้อมูล | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | ใช่ | - | TOKEN |
| <code>keyword</code> | query | <code>string</code> | ใช่ | - | คำสำคัญสำหรับการค้นหา |
| <code>offset</code> | query | <code>integer</code> | ไม่ใช่ | <code>0</code> | จุดเริ่มต้น, เริ่มต้นที่ 0. |
| <code>showAllTopics</code> | query | <code>string</code> | ไม่ใช่ | <code>FALSE</code> | ว่าจะแสดงหัวข้อทั้งหมดหรือไม่.<br /><br><br>ค่าใช้ได้:<br /><br>- <code>FALSE</code>: ไม่แสดงหัวข้อ<br /><br>- <code>TRUE</code>: แสดงหัวข้อทั้งหมด |
| <code>vertical</code> | query | <code>string</code> | ไม่ใช่ | - | ตัวกรองประเภทของผลลัพธ์.<br /><br><br>ค่าใช้ได้:<br /><br>- <code>answer</code>: เฉพาะคำตอบ<br /><br>- <code>article</code>: เฉพาะบทความ<br /><br>- <code>zvideo</code>: เฉพาะวิดีโอ |
| <code>sort</code> | query | <code>string</code> | ไม่ใช่ | - | เกณฑ์การจัดเรียง.<br /><br><br>ค่าใช้ได้:<br /><br>- <code>upvoted_count</code>: คำตอบที่ได้รับการโหวตมากที่สุด<br /><br>- <code>created_time</code>: บทความที่เผยแพร่ล่าสุด |
| <code>timeInterval</code> | query | <code>string</code> | ไม่ใช่ | - | ตัวกรองช่วงเวลาในการเผยแพร่.<br /><br><br>ค่าใช้ได้:<br /><br>- <code>a_day</code>: ภายในหนึ่งวัน<br /><br>- <code>a_week</code>: ภายในหนึ่งสัปดาห์<br /><br>- <code>a_month</code>: ภายในหนึ่งเดือน<br /><br>- <code>three_months</code>: ภายในสามเดือน<br /><br>- <code>half_a_year</code>: ภายในครึ่งปี<br /><br>- <code>a_year</code>: ภายในหนึ่งปี |

</div>

## ตัวอย่างโค้ด

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 คำแนะนำสำหรับ AI]
ฉันต้องการใช้ API "การค้นหาคำสำคัญ (V1)" จาก JustOneAPI.
URL หลัก: https://api.justoneapi.com.
เส้นทาง API: /api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE
เอนด์พอยต์ API: BASE_URL + /api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE
เมธอด HTTP: GET
การยืนยันตัวตน: เพิ่มพารามิเตอร์ "token" เข้าไปใน URL.
คำนิยาม OpenAPI: https://docs.justoneapi.com/openapi/zhihu/keyword-search-v1-th.json

พารามิเตอร์:
- token (query): TOKEN (จำเป็น)
- keyword (query): คำสำคัญสำหรับการค้นหา (จำเป็น)
- offset (query): จุดเริ่มต้น, เริ่มต้นที่ 0.
- showAllTopics (query): ว่าจะแสดงหัวข้อทั้งหมดหรือไม่.

ค่าใช้ได้:
- `FALSE`: ไม่แสดงหัวข้อ
- `TRUE`: แสดงหัวข้อทั้งหมด
- vertical (query): ตัวกรองประเภทของผลลัพธ์.

ค่าใช้ได้:
- `answer`: เฉพาะคำตอบ
- `article`: เฉพาะบทความ
- `zvideo`: เฉพาะวิดีโอ
- sort (query): เกณฑ์การจัดเรียง.

ค่าใช้ได้:
- `upvoted_count`: คำตอบที่ได้รับการโหวตมากที่สุด
- `created_time`: บทความที่เผยแพร่ล่าสุด
- timeInterval (query): ตัวกรองช่วงเวลาในการเผยแพร่.

ค่าใช้ได้:
- `a_day`: ภายในหนึ่งวัน
- `a_week`: ภายในหนึ่งสัปดาห์
- `a_month`: ภายในหนึ่งเดือน
- `three_months`: ภายในสามเดือน
- `half_a_year`: ภายในครึ่งปี
- `a_year`: ภายในหนึ่งปี

รูปแบบที่ส่งกลับ: จัดการ JSON หรือข้อความอย่างปลอดภัยตามค่า Content-Type ที่ได้รับจริง

การจัดการผลตอบกลับและรหัสข้อผิดพลาด:
1. ตรวจสอบผลการทำงานจากฟิลด์ "code" ในผลตอบกลับ (รหัส 0 หมายถึงสำเร็จ)
2. แนะนำให้ตั้งระยะเวลารอ 120 วินาที หาก 120 วินาทีนานเกินไป ให้ตั้งอย่างน้อย 60 วินาที แต่คำขอบางรายการอาจหมดเวลาก่อนได้รับผลลัพธ์
3. รหัสผลลัพธ์:
   - 0: สำเร็จ
   - 100: โทเคนไม่ถูกต้องหรือถูกปิดใช้งาน
   - 301: ดึงข้อมูลไม่สำเร็จ โปรดลองอีกครั้ง
   - 302: เกินขีดจำกัดอัตราการเรียก
   - 303: ใช้โควตารายวันครบแล้ว
   - 400: พารามิเตอร์ไม่ถูกต้อง
   - 500: ข้อผิดพลาดภายในเซิร์ฟเวอร์
   - 600: ไม่มีสิทธิ์เข้าถึง
   - 601: ยอดเงินคงเหลือไม่เพียงพอ
   - 602: ถึงวงเงินของโทเคนแล้ว
4. รหัส 601 หมายถึงยอดเงินที่ใช้ร่วมกันของบัญชีไม่เพียงพอ รหัส 602 หมายถึงโทเคน API ถึงวงเงินสะสมของตนเองแล้ว การกำหนดวงเงินโทเคนจะไม่โอนเงินออกจากยอดเงินที่ใช้ร่วมกันของบัญชี

กรุณาช่วยเขียนสคริปต์ในภาษาโปรแกรมที่ฉันชื่นชอบเพื่อเรียกใช้ API และจัดการการตอบกลับ.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # ให้โดยเซิร์ฟเวอร์ OpenAPI

url = BASE_URL + "/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // ให้โดยเซิร์ฟเวอร์ OpenAPI
const url = BASE_URL + "/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // ให้โดยเซิร์ฟเวอร์ OpenAPI
        final String url = BASE_URL + "/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // ให้โดยเซิร์ฟเวอร์ OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // ให้โดยเซิร์ฟเวอร์ OpenAPI
$url = $BASE_URL . '/api/zhihu/search/v1?token=YOUR_API_KEY&keyword=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/zhihu/keyword-search-v1-th.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[คำนิยาม OpenAPI (JSON)]</a>
</div>

## ฟิลด์ที่ได้รับการตอบกลับ

ฟิลด์สำคัญในผลการตอบกลับที่สำเร็จ (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| เส้นทางฟิลด์ | ชนิดข้อมูล | คำอธิบาย |
| --- | --- | --- |
| <code>data</code> | - | ผลการค้นหาคีย์เวิร์ดและการแสดงผลการแบ่งหน้าเมื่อ payload ที่สำเร็จเป็นอ็อบเจกต์. |
| <code>data.paging</code> | <code>object</code> | สถานะการแสดงผลการแบ่งหน้าสำหรับการตอบกลับการค้นหานี้. |
| <code>data.paging.is_end</code> | <code>boolean</code> | ว่าการตอบกลับนี้รายงานถึงจุดสิ้นสุดของผลการค้นหาหรือไม่. หยุดเมื่อเป็น true, แม้ว่าจะยังมีหน้าถัดไปอยู่ก็ตาม. |
| <code>data.paging.next</code> | <code>string</code> | URL การแสดงผลการแบ่งหน้าที่จูฮูรายงาน. เมื่อ is_end เป็น false, ใช้ค่า offset ที่ส่งกลับมาจาก endpoint นี้ในการเรียกใช้ครั้งต่อไป และคงค่าคีย์เวิร์ดและตัวเลือกไว้ไม่เปลี่ยนแปลง. |
| <code>data.data</code> | <code>array</code> | หน้าข้อมูลผลการค้นหาที่ส่งกลับมาที่ตำแหน่งนี้ อนุกรมอาจว่างเปล่าได้ ประเภทหน้าข้อมูลและฟิลด์ที่มีอยู่อาจแตกต่างกัน |
| <code>data.data[]</code> | <code>object</code> | หน้าต่างผลการค้นหาหนึ่งหน้า |
| <code>data.data[].id</code> | <code>integer &#124; string</code> | ตัวระบุที่ส่งกลับมาสำหรับหน้าข้อมูลผลการค้นหาด้านนอก หากมี |
| <code>data.data[].type</code> | <code>string</code> | ประเภทของหน้าข้อมูลผลการค้นหาด้านนอก |
| <code>data.data[].index</code> | <code>integer</code> | อินเด็กซ์ของผลลัพธ์ที่รายงานสำหรับหน้านี้ |
| <code>data.data[].highlight</code> | <code>object &#124; null</code> | ส่วนที่ได้รับการเน้นย้ำของผลลัพธ์ที่ตรงกัน หากมีการระบุ |
| <code>data.data[].highlight.title</code> | <code>string</code> | ชื่อเรื่องที่ได้รับการเน้นย้ำในหน้าค้นหา |
| <code>data.data[].highlight.description</code> | <code>string</code> | คำอธิบายที่ได้รับการเน้นย้ำในหน้าค้นหา |
| <code>data.data[].highlight.name</code> | <code>string</code> | ชื่อที่ได้รับการเน้นย้ำในหน้าค้นหา |
| <code>data.data[].highlight.creator</code> | <code>string</code> | ชื่อผู้สร้างที่ได้รับการเน้นย้ำในหน้าค้นหา |
| <code>data.data[].object</code> | <code>object</code> | เนื้อหาที่แนบมาด้วยกับหน้านี้ เช่น คำตอบ บทความ คำถาม ประวัติ หรือวิดีโอ ฟิลด์จะขึ้นอยู่กับประเภทของเนื้อหา |
| <code>data.data[].object.id</code> | <code>string</code> | ตัวระบุที่ส่งกลับมาสำหรับเนื้อหาที่แนบมาด้วยกับหน้านี้ หากมี |
| <code>data.data[].object.type</code> | <code>string</code> | ประเภทของเนื้อหาที่แนบมาด้วยกับการ์ดนั้น |
| <code>data.data[].object.title</code> | <code>string</code> | ชื่อของเนื้อหาที่แนบมา หากมีการระบุ |
| <code>data.data[].object.description</code> | <code>string &#124; object</code> | คำอธิบายที่ส่งกลับสำหรับเนื้อหา บางประเภทของคาร์ดจะมีคำอธิบายที่มีโครงสร้าง |
| <code>data.data[].object.raw_description</code> | <code>string</code> | สตริงคำอธิบายดิบที่ส่งกลับสำหรับเนื้อหาวิดีโอ |
| <code>data.data[].object.excerpt</code> | <code>string</code> | ข้อความตัวอย่างที่ส่งกลับสำหรับเนื้อหา ซึ่งอาจมี HTML |
| <code>data.data[].object.content</code> | <code>string</code> | เนื้อหาสำหรับเนื้อหา ซึ่งอาจมี HTML |
| <code>data.data[].object.url</code> | <code>string</code> | URL ของ Zhihu สำหรับเนื้อหานี้ |
| <code>data.data[].object.redirect_url</code> | <code>string</code> | URL ของจุดหมายสำหรับคาร์ด หากมี |
| <code>data.data[].object.image_url</code> | <code>string</code> | URL ของรูปภาพสำหรับคาร์ด |
| <code>data.data[].object.is_anonymous</code> | <code>boolean</code> | สัญญาณการไม่ระบุตัวตนสำหรับเนื้อหา |
| <code>data.data[].object.created_time</code> | <code>integer</code> | เวลาการสร้างสำหรับเนื้อหาในหน่วยวินาที Unix |
| <code>data.data[].object.updated_time</code> | <code>integer</code> | เวลาการอัปเดตล่าสุดสำหรับเนื้อหาในหน่วยวินาที Unix |
| <code>data.data[].object.voteup_count</code> | <code>integer</code> | จำนวนการโหวตสำหรับเนื้อหาหรือโปรไฟล์ |
| <code>data.data[].object.comment_count</code> | <code>integer</code> | จำนวนความคิดเห็นสำหรับเนื้อหา |
| <code>data.data[].object.favorites_count</code> | <code>integer</code> | จำนวนการชื่นชอบสำหรับเนื้อหา |
| <code>data.data[].object.visits_count</code> | <code>integer</code> | จำนวนการเยี่ยมชมสำหรับเนื้อหา |
| <code>data.data[].object.answer_count</code> | <code>integer</code> | จำนวนคำตอบสำหรับคำถามหรือโปรไฟล์ |
| <code>data.data[].object.articles_count</code> | <code>integer</code> | จำนวนบทความของโปรไฟล์ตามที่รายงาน |
| <code>data.data[].object.follower_count</code> | <code>integer</code> | จำนวนผู้ติดตามสำหรับโปรไฟล์หรือคำถาม |
| <code>data.data[].object.name</code> | <code>string</code> | ชื่อที่แสดงสำหรับผลลัพธ์ของโปรไฟล์ |
| <code>data.data[].object.headline</code> | <code>string</code> | หัวข้อของโปรไฟล์ที่ส่งกลับพร้อมกับผลลัพธ์ของโปรไฟล์ |
| <code>data.data[].object.avatar_url</code> | <code>string</code> | URL ของรูปภาพโปรไฟล์ |
| <code>data.data[].object.url_token</code> | <code>string</code> | ชื่อสาธารณะของโปรไฟล์ที่ใช้ใน URL ของโปรไฟล์บน Zhihu |
| <code>data.data[].object.question</code> | <code>object</code> | คำถามที่เกี่ยวข้องกับผลลัพธ์ของคำตอบ |
| <code>data.data[].object.question.id</code> | <code>string</code> | ตัวระบุคำถามของ Zhihu |
| <code>data.data[].object.question.name</code> | <code>string</code> | หัวข้อของคำถามที่ส่งกลับพร้อมกับคำตอบ |
| <code>data.data[].object.question.type</code> | <code>string</code> | ประเภทของวัตถุคำถามที่เกี่ยวข้อง |
| <code>data.data[].object.question.url</code> | <code>string</code> | URL ที่ส่งกลับสำหรับคำถามที่เกี่ยวข้อง |
| <code>data.data[].object.question.answer_count</code> | <code>integer</code> | จำนวนคำตอบที่ส่งกลับสำหรับคำถามที่เกี่ยวข้อง |
| <code>data.data[].object.author</code> | <code>object</code> | ประวัติผู้เขียนที่ระบุไว้ในเนื้อหา. |
| <code>data.data[].object.author.id</code> | <code>string</code> | ตัวระบุประวัติผู้เขียน. |
| <code>data.data[].object.author.url_token</code> | <code>string</code> | ชื่อเรื่องที่เผยแพร่ใน URL ประวัติผู้เขียนบน Zhihu. |
| <code>data.data[].object.author.name</code> | <code>string</code> | ชื่อที่ปรากฏของผู้เขียน. |
| <code>data.data[].object.author.headline</code> | <code>string</code> | หัวข้อของประวัติผู้เขียน. |
| <code>data.data[].object.author.avatar_url</code> | <code>string</code> | URL ของภาพโปรไฟล์ของผู้เขียน. |
| <code>data.data[].object.author.url</code> | <code>string</code> | URL ที่ส่งกลับสำหรับประวัติผู้เขียน. |
| <code>data.data[].object.author.type</code> | <code>string</code> | ประเภทของอ็อบเจกต์ประวัติผู้เขียน. |
| <code>data.data[].object.author.follower_count</code> | <code>integer</code> | จำนวนผู้ติดตามที่ผู้เขียนมี |
| <code>data.data[].object.author.voteup_count</code> | <code>integer</code> | จำนวนการโหวตที่รายงานสำหรับผู้เขียน. |
| <code>data.data[].object.zvideo_id</code> | <code>string</code> | ตัวระบุของโพสต์วิดีโอบน Zhihu. |
| <code>data.data[].object.video_id</code> | <code>string</code> | ตัวระบุสื่อวิดีโอ. |
| <code>data.data[].object.video_url</code> | <code>string</code> | URL ของวิดีโอที่ส่งกลับสำหรับผลลัพธ์. |
| <code>data.data[].object.video_answer_url</code> | <code>string</code> | URL ที่ส่งกลับสำหรับคำตอบที่เกี่ยวข้องกับวิดีโอ หากมี. |
| <code>data.data[].object.cover_url</code> | <code>string</code> | URL ภาพปกวิดีโอ |
| <code>data.data[].object.creator</code> | <code>string</code> | ชื่อของผู้สร้างที่ระบุไว้ในผลลัพธ์ของวิดีโอ. |
| <code>data.data[].object.created_at</code> | <code>integer</code> | เวลาที่สร้างวิดีโอที่ระบุไว้สำหรับวิดีโอ. |
| <code>data.data[].object.updated_at</code> | <code>integer</code> | เวลาที่อัปเดตครั้งล่าสุดสำหรับวิดีโอ. |
| <code>data.data[].object.duration</code> | <code>number</code> | ค่าชั่วโมงที่รายงานสำหรับวิดีโอ |
| <code>data.data[].object.width</code> | <code>integer</code> | ความกว้างของวิดีโอในพิกเซล |
| <code>data.data[].object.height</code> | <code>integer</code> | ความสูงของวิดีโอในพิกเซล |
| <code>data.data[].object.play_count</code> | <code>integer</code> | จำนวนครั้งที่วิดีโอถูกเล่นที่ถูกรายงาน. |
| <code>data.data[].object.playlist</code> | <code>object</code> | ตัวเลือกการเล่นที่จัดกลุ่มตามคีย์คุณภาพ ตัวเลือกที่มีอยู่อาจแตกต่างกันในแต่ละวิดีโอ. |
| <code>data.data[].object.playlist.ld</code> | <code>object</code> | ตัวเลือกการเล่น LD หากมีการส่งกลับ. |
| <code>data.data[].object.playlist.ld.url</code> | <code>string</code> | URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.ld.play_url</code> | <code>string</code> | URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก. |
| <code>data.data[].object.playlist.ld.width</code> | <code>integer</code> | ความกว้างของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.ld.height</code> | <code>integer</code> | ความสูงของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.ld.format</code> | <code>string</code> | รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.ld.quality</code> | <code>string</code> | ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.sd</code> | <code>object</code> | ตัวเลือกการเล่น SD หากมีการส่งกลับ. |
| <code>data.data[].object.playlist.sd.url</code> | <code>string</code> | URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.sd.play_url</code> | <code>string</code> | URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก. |
| <code>data.data[].object.playlist.sd.width</code> | <code>integer</code> | ความกว้างของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.sd.height</code> | <code>integer</code> | ความสูงของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.sd.format</code> | <code>string</code> | รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.sd.quality</code> | <code>string</code> | ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.hd</code> | <code>object</code> | ตัวเลือกการเล่น HD หากมีการส่งกลับ. |
| <code>data.data[].object.playlist.hd.url</code> | <code>string</code> | URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.hd.play_url</code> | <code>string</code> | URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก. |
| <code>data.data[].object.playlist.hd.width</code> | <code>integer</code> | ความกว้างของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.hd.height</code> | <code>integer</code> | ความสูงของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.hd.format</code> | <code>string</code> | รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.hd.quality</code> | <code>string</code> | ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.fhd</code> | <code>object</code> | ตัวเลือกการเล่น FHD หากมีการส่งกลับ. |
| <code>data.data[].object.playlist.fhd.url</code> | <code>string</code> | URL ของสื่อที่ส่งกลับสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.fhd.play_url</code> | <code>string</code> | URL ของการเล่นที่ส่งกลับสำหรับตัวเลือก. |
| <code>data.data[].object.playlist.fhd.width</code> | <code>integer</code> | ความกว้างของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.fhd.height</code> | <code>integer</code> | ความสูงของตัวเลือกการเล่นในพิกเซล. |
| <code>data.data[].object.playlist.fhd.format</code> | <code>string</code> | รูปแบบสื่อที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.playlist.fhd.quality</code> | <code>string</code> | ป้ายกำกับคุณภาพที่รายงานสำหรับตัวเลือกการเล่น. |
| <code>data.data[].object.video_info</code> | <code>object</code> | ข้อมูลสื่อเพิ่มเติมที่มีให้กับวิดีโอ |
| <code>data.data[].object.video_info.video_id</code> | <code>string</code> | ตัวระบุสื่อวิดีโอ. |
| <code>data.data[].object.video_info.duration</code> | <code>number</code> | ค่าความยาวที่รายงานในข้อมูลวิดีโอ |
| <code>data.data[].object.video_info.width</code> | <code>integer</code> | ความกว้างของวิดีโอในพิกเซล |
| <code>data.data[].object.video_info.height</code> | <code>integer</code> | ความสูงของวิดีโอในพิกเซล |
| <code>data.data[].object.video_info.play_count</code> | <code>integer</code> | จำนวนครั้งที่เล่นที่รายงานในข้อมูลวิดีโอ |
| <code>data.related_search_result</code> | <code>array</code> | ผลการค้นหาที่เกี่ยวข้องที่ Zhihu แสดงเป็นอาร์เรย์สามารถว่างเปล่าได้ |

</div>

## ตัวอย่างผลการตอบกลับ

<ApiExampleSection :api='JSON.parse("\"/api/zhihu/search/v1\"")' />

