> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactセッションの作成

> コードで操作できるスタンドアロンのInteractブラウザセッションを開始します（事前のスクレイピングは不要です）。

<div id="headers">
  ## ヘッダー
</div>

| ヘッダー            | 値                  |
| --------------- | ------------------ |
| `Authorization` | `Bearer <API_KEY>` |
| `Content-Type`  | `application/json` |

<div id="request-body">
  ## リクエストボディ
</div>

| Parameter             | Type    | Required | Default | Description                                                                                            |
| --------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `ttl`                 | number  | No       | 600     | セッション全体の有効期間（秒）（30〜3600）                                                                               |
| `activityTtl`         | number  | No       | 300     | セッションが破棄されるまでの非アクティブ状態の継続時間（秒）（10〜3600）                                                                |
| `profile`             | object  | No       | —       | セッション間での永続的なストレージを有効化します。後述を参照してください。                                                                  |
| `profile.name`        | string  | Yes\*    | —       | プロファイルの名前（1〜128文字）。同じ名前のセッションはストレージを共有します。                                                             |
| `profile.saveChanges` | boolean | No       | `true`  | `true` の場合、ブラウザの状態は終了時にプロファイルへ保存されます。既存データの読み込みのみを行いたい場合は `false` を設定してください。保存処理を行えるセッションは同時に 1 つだけです。 |

<div id="response">
  ## レスポンス
</div>

| フィールド                    | 型       | 説明                                      |
| ------------------------ | ------- | --------------------------------------- |
| `success`                | boolean | セッションが作成されたかどうか                         |
| `id`                     | string  | セッションの一意の識別子                            |
| `cdpUrl`                 | string  | CDP 接続用の WebSocket URL                  |
| `liveViewUrl`            | string  | セッションをリアルタイムで閲覧するための URL                |
| `interactiveLiveViewUrl` | string  | セッションをリアルタイムで操作（クリック、入力、スクロール）するための URL |
| `expiresAt`              | string  | TTL に基づいてセッションの有効期限が切れる時刻               |

<div id="example-request">
  ### リクエストの例
</div>

```bash theme={null}
curl -X POST "https://api.firecrawl.dev/v2/interact" \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ttl": 120
  }'
```

<div id="example-response">
  ### レスポンス例
</div>

```json theme={null}
{
  "success": true,
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "cdpUrl": "wss://cdp-proxy.firecrawl.dev/cdp/550e8400-e29b-41d4-a716-446655440000",
  "liveViewUrl": "https://liveview.firecrawl.dev/550e8400-e29b-41d4-a716-446655440000",
  "interactiveLiveViewUrl": "https://liveview.firecrawl.dev/550e8400-e29b-41d4-a716-446655440000?interactive=true"
}
```

> Firecrawl APIキーが必要なAI agentですか？自動オンボーディング手順については、[firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) を参照してください。


## OpenAPI

````yaml ja/api-reference/v2-openapi.json POST /interact
openapi: 3.0.0
info:
  contact:
    email: support@firecrawl.dev
    name: Firecrawl Support
    url: https://firecrawl.dev/support
  description: Firecrawlのサービスを利用して、Webスクレイピングやクロールを行うためのAPIです。
  title: Firecrawl API
  version: v2
servers:
  - url: https://api.firecrawl.dev/v2
security:
  - bearerAuth: []
paths:
  /interact:
    post:
      tags:
        - Interact
      summary: Interactセッションを作成
      operationId: createBrowserSession
      requestBody:
        content:
          application/json:
            schema:
              properties:
                activityTtl:
                  description: 非アクティブ状態が続いた場合にセッションが破棄されるまでの時間（秒）
                  maximum: 3600
                  minimum: 10
                  type: integer
                profile:
                  description: >-
                    Interactセッション間で永続ストレージを有効にします。あるセッションで保存したデータは、同じ名前を使って後続のセッションで読み込めます。
                  properties:
                    name:
                      description: プロファイル名。同じ名前のセッションはストレージを共有します。
                      maxLength: 128
                      minLength: 1
                      type: string
                    saveChanges:
                      default: true
                      description: >-
                        true
                        の場合、終了時にブラウザの状態がプロファイルへ保存されます。既存のデータを読み込むだけで書き込みを行わない場合は、false
                        に設定します。保存しないセッションは複数同時に許可されますが、保存するセッションは同時に 1 つだけです。
                      type: boolean
                  required:
                    - name
                  type: object
                streamWebView:
                  default: true
                  description: ブラウザのライブビューをストリーミングするかどうか
                  type: boolean
                ttl:
                  default: 300
                  description: InteractセッションのTTL（秒）
                  maximum: 3600
                  minimum: 30
                  type: integer
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  cdpUrl:
                    description: Chrome DevTools Protocol にアクセスするための WebSocket URL
                    type: string
                  expiresAt:
                    description: TTLに基づくセッションの有効期限
                    format: date-time
                    type: string
                  id:
                    description: 一意のセッション識別子
                    type: string
                  interactiveLiveViewUrl:
                    description: Interactセッションをリアルタイムで操作するためのURL（クリック、入力、スクロール）
                    type: string
                  liveViewUrl:
                    description: Interactセッションをリアルタイムで表示するためのURL
                    type: string
                  success:
                    type: boolean
                type: object
          description: Interactセッションが正常に作成されました
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Payment required to access this resource.
                    type: string
                type: object
          description: 支払いが必要です
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````