# useragent ดึง User-Agent

> GET https://api.yescaptcha.com/useragent คืนค่า User-Agent ของเบราว์เซอร์ที่แนะนำให้ใช้ (ข้อความธรรมดา) ฟิลด์ userAgent ของงาน hCaptcha รับเฉพาะค่านี้เท่านั้น

Source: https://docs.yescaptcha.com/th/api/useragent/ · Last verified: 2026-10-15

> This page was machine-translated from the Chinese version. If anything differs, the Chinese version prevails: https://docs.yescaptcha.com/zh/api/useragent/

`/useragent` คืนค่า User-Agent ของเบราว์เซอร์ที่แนะนำให้ใช้ในปัจจุบัน เป็นข้อความธรรมดา ไม่ต้องใช้ `clientKey` และไม่หักพอยต์ ฟิลด์ `userAgent` ของงาน [hCaptcha](https://docs.yescaptcha.com/th/tasks/hcaptcha.md) รับเฉพาะค่านี้เท่านั้น และการใช้ค่านี้ตอนเข้าเว็บไซต์เป้าหมายก็ช่วยให้ token ผ่านการตรวจสอบได้ง่ายขึ้น

- GET `https://api.yescaptcha.com/useragent` (endpoint ทั่วโลก)
- GET `https://cn.yescaptcha.com/useragent` (endpoint จีน)

## ตัวอย่าง

```bash
curl -s https://api.yescaptcha.com/useragent
```

ผลลัพธ์ที่ได้ (ค่าของวันที่ 2026-10-15 ซึ่งจะเปลี่ยนไปตามเวอร์ชันของเบราว์เซอร์):

```text
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36
```

> **หมายเหตุ:** ค่าที่คืนมาอาจเปลี่ยนแปลงได้ตลอดเวลา อย่าฝังไว้ในโค้ด ให้เรียกขอค่าหนึ่งครั้งทุกครั้งที่โปรแกรมเริ่มทำงาน

-   หากผลลัพธ์ที่ได้มี `userAgent` ให้ใช้ค่าในผลลัพธ์นั้นตอนส่ง token
