# การตั้งงาน Google AI Mode SERP

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/serp/google/ai_mode/task_post`

**Tags:** DataForSEO

เข้าคิวคำตอบ AI Mode ของ Google สำหรับคำค้น พร้อมแหล่งที่มาที่อ้างถึงบน Google และคืน `id` ของงานใน `tasks[0].id` ห่อด้วย envelope ของ DataForSEO: ข้อมูลอยู่ใน `tasks[0].result` ผลลัพธ์อยู่ใน `tasks[0].status_code` — คำขอที่ถูกปฏิเสธยังคงคืน HTTP 200 คู่แฝดแบบเรียลไทม์ตอบทันทีและง่ายกว่าสำหรับคำขอเดียว ให้เข้าคิวเมื่อทั้งชุดใช้เวลานานกว่าการเรียกเครื่องมือหนึ่งครั้ง

### ข้อมูลอ้างอิงราคา

- การวัดปริมาณการใช้งาน: ต้นทุนการตอบกลับที่รายงาน
- ค่าประมาณคำขออ้างอิง: USD 0.02
- ตัวคูณอ้างอิงสำหรับลูกค้า: 1.0 ห้ามนำไปใช้ซ้ำกับยอดที่เรียกเก็บจากลูกค้าแล้ว

เป็นข้อมูลเมตาอ้างอิงเท่านั้น ไม่ใช่ใบเสนอราคาสำหรับบัญชี ไม่ใช่ราคาที่รับประกัน และไม่ใช่เพดานการใช้จ่าย เครดิตของทรัพยากรไม่ใช่เครดิต Felo ยอดเรียกเก็บขั้นสุดท้ายเป็นไปตามบันทึกการเรียกเก็บเงินของ Felo

## Related links

- [บทความ Help Center](<https://dataforseo.com/help-center/rules-and-limitations-of-keyword-and-keywords-fields-in-dataforseo-apis>)
- [Google Search Help](<https://support.google.com/websearch/answer/16011537?hl=en&co=GENIE.Platform%3DAndroid#>)
- [ราคา](<https://dataforseo.com/pricing/serp/google-ai-mode-serp-api>)
- [Help Center](<https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api>)
- [เยี่ยมชม Help Center เพื่อดูข้อมูลเพิ่มเติม&gt;&gt;](<https://dataforseo.com/help-center/pixel-ranking-in-serp-api>)

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "keyword": {
            "type": "string",
            "description": "<p><em>คีย์เวิร์ด</em><p><strong>ฟิลด์ที่จำเป็น</strong><p>ระบุได้<strong>สูงสุด 700 อักขระ</strong>ในฟิลด์ <code>keyword</code><p>%## ทั้งหมดจะถูกถอดรหัส (อักขระ ‘+’ จะถูกถอดรหัสเป็นอักขระเว้นวรรค)<p>หากต้องการใช้ “%” ใน <code>keyword</code> ให้ระบุเป็น “%25”;<p>หากต้องการใช้ “+” ใน <code>keyword</code> ให้ระบุเป็น “%2B”</p><br><p>ดูรายละเอียดกฎและข้อจำกัดของฟิลด์ <code>keyword</code> และ <code>keywords</code> ใน DataForSEO API ได้ใน บทความ Help Center</p>"
          },
          "location_code": {
            "type": "integer",
            "description": "<p><em>รหัสสถานที่ของเครื่องมือค้นหา</em><p><strong>ฟิลด์ที่จำเป็นหากไม่ได้ระบุ</strong> <code>location_name</code>&nbsp;หรือ <code>location_coordinate</code><p><strong>หากใช้ฟิลด์นี้ ไม่จำเป็นต้องระบุ <code>location_name</code> หรือ <code>location_coordinate</code></strong><p>คุณสามารถรับรายการสถานที่ของเครื่องมือค้นหาที่ใช้ได้พร้อม <code>location_code</code> ได้โดยส่งคำขอแยกไปที่ <code>https://api.dataforseo.com/v3/serp/google/locations</code><p><strong>หมายเหตุ:</strong> ดูGoogle Search Help สำหรับรายการประเทศที่ AI Mode เปิดให้ใช้งานในปัจจุบัน</p>"
          },
          "language_code": {
            "type": "string",
            "description": "<p><em>รหัสภาษาของเครื่องมือค้นหา</em><p>ฟิลด์ที่จำเป็นหากไม่ได้ระบุ <code>language_name</code>;<p>หากใช้ฟิลด์นี้ ไม่จำเป็นต้องระบุ <code>language_name</code>;<p>คุณสามารถรับรายการภาษาของเครื่องมือค้นหาที่ใช้ได้พร้อม <code>language_code</code>&nbsp;โดยส่งคำขอแยกไปที่ <code>https://api.dataforseo.com/v3/serp/google/ai_mode/languages</code></p>"
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>ลำดับความสำคัญของงาน</em><p>ฟิลด์ที่ไม่บังคับ<p>รับค่าต่อไปนี้ได้:<p>1 – ลำดับความสำคัญการทำงานปกติ (กำหนดเป็นค่าเริ่มต้น)<p>2 – ลำดับความสำคัญการทำงานสูง</p><br>งานที่มีลำดับความสำคัญการทำงานสูงจะถูกเรียกเก็บเงินเพิ่ม<p>ค่าใช้จ่ายสามารถคำนวณได้ที่หน้าราคา"
          },
          "device": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>ประเภทอุปกรณ์</em><p>ฟิลด์ที่ไม่บังคับ<p>คืนผลลัพธ์สำหรับประเภทอุปกรณ์เฉพาะ<p>รับค่าได้:<code>desktop</code>, <code>mobile</code><p>ค่าเริ่มต้น: <code>desktop</code></p>"
          },
          "pingback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>URL แจ้งเตือนเมื่องานเสร็จสิ้น</em><p>ฟิลด์ที่ไม่บังคับ<p>เมื่องานเสร็จสิ้น เราจะแจ้งให้คุณทราบผ่านคำขอ GET ที่ส่งไปยัง URL ที่คุณระบุ<p>คุณสามารถใช้สตริง ‘$id’ เป็นตัวแปร <code>$id</code> และ ‘$tag’ เป็นตัวแปร <code>$tag</code> แบบ urlencoded เราจะกำหนดค่าที่จำเป็นก่อนส่งคำขอ<p>ตัวอย่าง:<p><code>http://your-server.com/pingscript?id=$id</code><p><code>http://your-server.com/pingscript?id=$id&amp;tag=$tag</code><p><strong>หมายเหตุ:</strong> อักขระพิเศษใน <code>pingback_url</code> จะถูก urlencoded;<p>กล่าวคือ อักขระ <code>#</code> จะถูกเข้ารหัสเป็น <code>%23</code></p><br><p>อ่านเพิ่มเติมได้ที่Help Center ของเรา</p>"
          },
          "postback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>URL สำหรับส่งผลลัพธ์ของงาน</em><p>ฟิลด์ที่ไม่บังคับ<p>เมื่องานเสร็จสิ้น เราจะส่งคำขอ POST พร้อมผลลัพธ์ที่บีบอัดในรูปแบบ <code>gzip</code> ไปยัง <code>postback_url</code> ที่คุณระบุ<p>ใช้สตริง ‘$id’ เป็นตัวแปร <code>$id</code> และ ‘$tag’ เป็นตัวแปร <code>$tag</code> แบบ urlencoded เราจะตั้งค่าที่จำเป็นก่อนส่งคำขอ<p>ตัวอย่าง:<p><code>http://your-server.com/postbackscript?id=$id</code><p><code>http://your-server.com/postbackscript?id=$id&amp;tag=$tag</code><p><strong>หมายเหตุ:</strong> อักขระพิเศษใน <code>postback_url</code> จะถูกเข้ารหัส URL;<p>เช่น อักขระ <code>#</code> จะถูกเข้ารหัสเป็น <code>%23</code></p><br><p>ดูข้อมูลเพิ่มเติมได้ที่Help Center ของเรา</p>"
          },
          "postback_data": {
            "type": "string",
            "description": "<p><em>ชนิดข้อมูลของ postback_url</em><p><strong>ฟิลด์ที่จำเป็นหากระบุ <code>postback_url</code></strong><p>สอดคล้องกับฟังก์ชันที่คุณใช้ในการตั้งงาน<p>ค่าที่เป็นไปได้:<p><code>advanced</code>, <code>html</code></p>"
          },
          "location_name": {
            "type": "string",
            "description": "<p><em>ชื่อเต็มของสถานที่ของเครื่องมือค้นหา</em><p><strong>ฟิลด์ที่จำเป็นหากไม่ได้ระบุ</strong> <code>location_code</code> หรือ <code>location_coordinate</code><p><strong>หากใช้ฟิลด์นี้ ไม่จำเป็นต้องระบุ <code>location_code</code> หรือ <code>location_coordinate</code></strong><p>คุณสามารถรับรายการสถานที่ของเครื่องมือค้นหาที่ใช้ได้พร้อม <code>location_name</code> ได้โดยส่งคำขอแยกไปที่ <code>https://api.dataforseo.com/v3/serp/google/locations</code><p><strong>หมายเหตุ:</strong> ดูGoogle Search Help สำหรับรายการประเทศที่ AI Mode เปิดให้ใช้งานในปัจจุบัน</p>"
          },
          "language_name": {
            "type": "string",
            "description": "<p><em>ชื่อเต็มของภาษาของเครื่องมือค้นหา</em><p>ฟิลด์ที่จำเป็นหากไม่ได้ระบุ <code>language_code</code>;<p>หากใช้ฟิลด์นี้ ไม่จำเป็นต้องระบุ <code>language_code</code>;<p>คุณสามารถรับรายการภาษาของเครื่องมือค้นหาที่ใช้ได้พร้อม <code>language_name</code> ได้โดยส่งคำขอแยกไปที่ <code>https://api.dataforseo.com/v3/serp/google/ai_mode/languages</code>;</p>\n"
          },
          "os": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>ระบบปฏิบัติการของอุปกรณ์</em><p>ฟิลด์ที่ไม่บังคับ<p>หากระบุ <code>desktop</code> ในฟิลด์ <code>device</code> ให้เลือกจากค่าต่อไปนี้: <code>windows</code>, <code>macos</code><p>ค่าเริ่มต้น: <code>windows</code><p>หากระบุ <code>mobile</code> ในฟิลด์ <code>device</code> ให้เลือกจากค่าต่อไปนี้: <code>android</code>, <code>ios</code><p>ค่าเริ่มต้น: <code>android</code></p>"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>ตัวระบุงานที่ผู้ใช้กำหนด</em><p>ฟิลด์ที่ไม่บังคับ<p><em>จำกัดอักขระ 255 ตัว</em><p>คุณสามารถใช้พารามิเตอร์นี้เพื่อระบุงานและจับคู่กับผลลัพธ์<p>คุณจะพบค่า <code>tag</code> ที่ระบุในออบเจกต์ <code>data</code> ของการตอบกลับ"
          },
          "calculate_rectangles": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<p><em>คำนวณอันดับพิกเซลสำหรับองค์ประกอบ SERP ในผลลัพธ์ขั้นสูง</em><p>ฟิลด์ไม่บังคับ<p>อันดับพิกเซลหมายถึงระยะห่างระหว่างสแน็ปช็อตผลลัพธ์กับมุมบนซ้ายของหน้าจอ;<p>เยี่ยมชม Help Center เพื่อดูข้อมูลเพิ่มเติม&gt;&gt;<p>โดยค่าเริ่มต้น พารามิเตอร์ถูกตั้งเป็น <code>false</code><p><strong>หมายเหตุ:</strong> หากตั้งเป็น <code>true</code> ค่าบริการต่องานจะคูณด้วย 2</p>"
          },
          "browser_screen_width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>ความกว้างหน้าจอเบราว์เซอร์</em><p>ฟิลด์ที่ไม่บังคับ<p>คุณสามารถตั้งความกว้างหน้าจอเบราว์เซอร์แบบกำหนดเองเพื่อคำนวณอันดับพิกเซลสำหรับอุปกรณ์เฉพาะ;<p>ระบุได้ในช่วงต่อไปนี้: <code>240-9999</code>;<p>โดยค่าเริ่มต้น พารามิเตอร์ถูกตั้งเป็น:<p><code>1920</code> สำหรับ <code>desktop</code>;<p><code>360</code> สำหรับ <code>mobile</code> บน <code>android</code>;<p><code>375</code> สำหรับ <code>mobile</code> บน <code>iOS</code>;<p><strong>หมายเหตุ:</strong> หากต้องการใช้พารามิเตอร์นี้ ให้ตั้ง <code>calculate_rectangles</code> เป็น <code>true</code></p>",
            "format": "int64"
          },
          "browser_screen_height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>ความสูงหน้าจอเบราว์เซอร์</em><p>ฟิลด์ที่ไม่บังคับ<p>คุณสามารถตั้งความสูงหน้าจอเบราว์เซอร์แบบกำหนดเองเพื่อคำนวณอันดับพิกเซลสำหรับอุปกรณ์เฉพาะ;<p>ระบุได้ในช่วงต่อไปนี้: <code>240-9999</code>;<p>โดยค่าเริ่มต้น พารามิเตอร์ถูกตั้งเป็น:<p><code>1080</code> สำหรับ <code>desktop</code>;<p><code>640</code> สำหรับ <code>mobile</code> บน <code>android</code>;<p><code>812</code> สำหรับ <code>mobile</code> บน <code>iOS</code>;<p><strong>หมายเหตุ:</strong> หากต้องการใช้พารามิเตอร์นี้ ให้ตั้ง <code>calculate_rectangles</code> เป็น <code>true</code></p>"
          },
          "browser_screen_resolution_ratio": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>อัตราส่วนความละเอียดหน้าจอเบราว์เซอร์</em><p>ฟิลด์ที่ไม่บังคับ<p>คุณสามารถตั้งอัตราส่วนความละเอียดหน้าจอเบราว์เซอร์แบบกำหนดเองเพื่อคำนวณอันดับพิกเซลสำหรับอุปกรณ์เฉพาะ;<p>ระบุได้ในช่วงต่อไปนี้: <code>0.5-3</code>;<p>โดยค่าเริ่มต้น พารามิเตอร์ถูกตั้งเป็น:<p><code>1</code> สำหรับ <code>desktop</code>;<p><code>3</code> สำหรับ <code>mobile</code> บน <code>android</code>;<p><code>3</code> สำหรับ <code>mobile</code> บน <code>iOS</code>;<p><strong>หมายเหตุ:</strong> หากต้องการใช้พารามิเตอร์นี้ ให้ตั้ง <code>calculate_rectangles</code> เป็น <code>true</code></p>"
          },
          "location_coordinate": {
            "type": "string",
            "description": "<p><em>พิกัด GPS ของสถานที่</em><p><strong>ฟิลด์ที่จำเป็นหากไม่ได้ระบุ</strong> <code>location_name</code>&nbsp;หรือ <code>location_code</code><p><strong>หากใช้ฟิลด์นี้ ไม่จำเป็นต้องระบุ <code>location_name</code> หรือ <code>location_code</code></strong><p>ต้องระบุพารามิเตอร์ <code>location_coordinate</code> ในรูปแบบ <em>\"latitude,longitude,zoom\"</em><p>หากไม่ได้ระบุ <em>\"zoom\"</em> ระบบจะใช้ <em>9z</em> เป็นค่าเริ่มต้น<p>จำนวนหลักทศนิยมสูงสุดสำหรับ <em>\"latitude\"</em> และ <em>\"longitude\"</em>: 7<p>ค่าต่ำสุดสำหรับ <em>\"zoom\"</em>: 4z<p>ค่าสูงสุดสำหรับ <em>\"zoom\"</em>: 18z<p>ตัวอย่าง:<p><code class=\"long-string\">52.6178549,-155.352142,18z</code></p>"
          }
        },
        "example": [
          {
            "language_code": "en",
            "location_code": 2840,
            "keyword": "what is google ai mode"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "language_code": "en",
      "location_code": 2840,
      "keyword": "what is google ai mode"
    }
  ]
}
```

## Responses

### 200 — ดำเนินการสำเร็จ

Headers:
- `X-Request-Id` (string) — ตัวระบุคำขอที่ต้องระบุเมื่อติดต่อฝ่ายสนับสนุนของ Felo

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_SerpGoogleAiModeTaskPostResponseInfo"
    }
  ]
}
```

### 400 — ไม่สามารถประมวลผลคำขอได้ ตรวจสอบพารามิเตอร์ของคำขอ

### 401 — จำเป็นต้องใช้คีย์ API ของ Felo ที่ถูกต้อง

### 402 — ไม่สามารถดำเนินการตามคำขอได้ เนื่องจากไม่เป็นไปตามข้อกำหนดด้านการเรียกเก็บเงิน

### 403 — บัญชีไม่ได้รับอนุญาตให้ดำเนินการนี้

### 429 — ถึงขีดจำกัดคำขอหรือการใช้จ่ายแล้ว

### 502 — บริการไม่สามารถดำเนินการตามคำขอให้เสร็จสิ้นได้

### 503 — API หรือบริการเรียกเก็บเงินไม่พร้อมใช้งานชั่วคราว

### 504 — บริการหมดเวลาระหว่างประมวลผลคำขอ

### default — การตอบกลับข้อผิดพลาด; การตอบกลับที่ส่งผ่านจากต้นทางอาจใช้รูปแบบของผู้ให้บริการ

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวอร์ชันปัจจุบันของ API"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "รหัสสถานะทั่วไป\nคุณสามารถดูรายการรหัสการตอบกลับทั้งหมดได้ที่นี่"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "ข้อความข้อมูลทั่วไป\nคุณสามารถดูรายการข้อความข้อมูลทั่วไปทั้งหมดได้ที่นี่"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวลาดำเนินการทั้งหมด (วินาที)"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ค่าใช้จ่ายรวมของงาน, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนงานในอาร์เรย์ tasks",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนงานในอาร์เรย์ tasks ที่ส่งคืนพร้อมข้อผิดพลาด",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "ตัวระบุงาน\nตัวระบุงานที่ไม่ซ้ำกันในระบบของเราในรูปแบบ UUID"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "รหัสสถานะของงาน\nสร้างโดย DataForSEO โดยอยู่ในช่วงต่อไปนี้ได้: 10000-60000\nคุณสามารถดูรายการรหัสการตอบกลับทั้งหมดได้ที่นี่"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "ข้อความข้อมูลของงาน\nคุณสามารถดูรายการข้อความข้อมูลทั่วไปทั้งหมดได้ที่นี่"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "เวลาดำเนินการ, วินาที"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ค่าใช้จ่ายรวมของงาน, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "จำนวนองค์ประกอบในอาร์เรย์ result",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "พาธ URL"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "มีพารามิเตอร์เดียวกับที่คุณระบุในคำขอ POST"
    }
  }
}
```

### Response36Afe1097B20_SerpGoogleAiModeTaskPostResponseInfo

`#/components/schemas/Response36Afe1097B20_SerpGoogleAiModeTaskPostResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_SerpGoogleAiModeTaskPostTaskInfo"
              }
            ]
          },
          "description": "<em>อาร์เรย์ของงาน</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_SerpGoogleAiModeTaskPostTaskInfo

`#/components/schemas/Response36Afe1097B20_SerpGoogleAiModeTaskPostTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "object",
            "null"
          ],
          "description": "<em>อาร์เรย์ของผลลัพธ์</em><br>ในกรณีนี้ ค่าจะเป็น <code>null</code>"
        }
      }
    }
  ]
}
```
