コンテンツへスキップ

ブラウザーのユーザーエージェントを取得

Request

指定した OS とブラウザーブランドに合致するユーザーエージェントを生成します。

  • 前提条件:Firefox は Windows または macOS のみで有効です。osVersion は対応リリースのいずれかである必要があります。
  • 副作用:ありませんが、結果は決定的ではありません — 同じリクエストでも毎回異なるユーザーエージェントが返ります。キャッシュキーには使わないでください。
  • 完了シグナル:同期的です。リトライは安全です。
  • Open API:ユーザーエージェントの生成には公開済みカーネルのみが使われ、クライアント情報は読み取りません。
Security
OpenApiBearer
Bodyapplication/jsonrequired
osinteger(OperatingSystem)required

オペレーティングシステム:

  • 1 — Windows
  • 2 — macOS
  • 3 — Android
  • 4 — iOS
  • 5 — Linux
Enum:12345
Example:1
osVersionstring

オペレーティングシステムのバージョン。既定値は空文字列です。

Enum:"""Windows 7""Windows 8""Windows 10""Windows 11""macOS 12""macOS 13""macOS 14"
Example:"Windows 11"
vendorinteger(BrowserType)required

ブラウザー種別:

  • 1 — Chrome
  • 2 — Firefox
Enum:12
Example:1
mobileDevicestring

モバイル端末の機種 ID。Android と iOS のプロファイルで使用します。

Example:"pixel_8"
systemBitTypeinteger(SystemBitType)

システムのビット数。デフォルトは 1:

  • 0 — 32 ビット
  • 1 — 64 ビット
Default:1
Enum:01
Example:1
architectureinteger(Architecture)

CPU アーキテクチャ。デフォルトは 0:

  • 0 — x86
  • 1 — ARM
Default:0
Enum:01
Example:0
curl -i -X POST \
  https://api.morelogin.com/env/advanced/ua/get \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "os": 1,
    "osVersion": "Windows 11",
    "vendor": 1,
    "systemBitType": 1,
    "architecture": 0
  }'

Responses

成功

Bodyapplication/json
codeintegerrequired

Return result code. 0 means success; other codes indicate exceptions.

Example:0
msgstring or nullrequired

Error message. Usually null on success.

Example:null
requestIdstring

Operation request ID. This field may be present when the request passes through the API gateway.

Example:"1d4f3ea968664593860b94b35d4ebf5e"
dataobjectrequired
Response
{ "code": 0, "msg": null, "requestId": "0d8b6f1c-9f4e-4d02-9d1a-7c3f5a1b2c3d", "data": { "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", "resolution": { … }, "mobileDevice": null } }