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

# バッチ情報

> バッチのステータスと進捗情報を取得します。バッチのコンテンツを取得するには、[こちら](/api-reference/batches/items)を参照してください。

<Tip>
  **カスタムデータを添付:** `metadata` パラメーターを使用して、バッチにキーと値のペアを保存します。詳細は[メタデータ](/api-reference/common/metadata)を参照してください。
</Tip>


## OpenAPI

````yaml ja/openapi/batches.json GET /v1/batches/{batch_id}
openapi: 3.0.3
info:
  title: バッチ API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/batches/{batch_id}:
    get:
      summary: バッチ情報を取得
      description: '`batch_id`を使用して特定のバッチに関する情報を取得します。'
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
          description: 情報を取得するバッチのID。
      responses:
        '200':
          description: バッチ情報を含む成功したレスポンス。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: バッチ ID
                  object:
                    type: string
                    description: オブジェクトの種類。このエンドポイントでは "batch" だよ。
                  status:
                    type: string
                    description: '`in_progress` または `completed`'
                  created:
                    type: number
                    description: 作成されたエポック
                  total_urls:
                    type: number
                    description: バッチ内のURLの数
                  completed_urls:
                    type: number
                    description: 完了したURLの数
                  parser:
                    type: string
                  country:
                    type: string
                  metadata:
                    $ref: '#/components/schemas/Metadata'
                  webhook:
                    type: string
                    description: 完了通知を受け取るためのWebhook URL
                  credits_consumed:
                    type: integer
                    nullable: true
                    description: このリクエストで消費されたクレジットの数。実行完了後に設定されるよ。クレジットは請求の基準だよ。
                  cost_usd:
                    type: number
                    nullable: true
                    description: >-
                      このリクエストのUSDでの推定コスト。実行完了後に設定されるよ。消費されたクレジットとプランのレートから計算されるよ
                      — 99%の精度だけど、credits_consumedが正確な値だよ。
        '401':
          description: >-
            認証情報が欠落しているか無効です。詳細は
            [Unauthorized](/api-reference/errors/unauthorized) を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: invalid_api_key
                type: https://docs.olostep.com/api-reference/errors/unauthorized
                status: 401
                title: 認証されていません
                detail: Your API key is invalid
                created: 1704067200
                metadata: {}
        '404':
          description: >-
            提供されたIDに対するバッチが見つかりません。詳細は[見つかりません](/api-reference/errors/not_found)を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: batch_not_found
                type: https://docs.olostep.com/api-reference/errors/not_found
                status: 404
                title: 見つかりません
                detail: Batch not found
                created: 1704067200
                metadata: {}
        '500':
          description: >-
            内部サーバーエラー。詳細は [Internal Error](/api-reference/errors/internal_error)
            を参照してください。
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: internal_server_error
                type: https://docs.olostep.com/api-reference/errors/internal_error
                status: 500
                title: 内部サーバーエラー
                detail: An unexpected error occurred
                created: 1704067200
                metadata: {}
      security:
        - Authorization: []
components:
  schemas:
    Metadata:
      type: object
      description: >-
        オブジェクトに関する追加情報を保存するためのキーと値のペアのセット。Stripeのアプローチに従い、検証ルールがあります：最大50キー、キーは最大40文字（角括弧なし）、値は最大500文字、すべての値は文字列として保存されます。
      additionalProperties:
        type: string
        maxLength: 500
        description: メタデータの値（最大500文字）。数値とブール値は自動的に文字列に変換されます。
      maxProperties: 50
      example:
        order_id: '12345'
        customer_name: John Doe
        priority: high
        processed: 'true'
      x-validation-rules:
        max_keys: 50
        key_max_length: 40
        key_forbidden_chars:
          - '['
          - ']'
        value_max_length: 500
        value_types:
          - string
          - number (coerced)
          - boolean (coerced)
    Error:
      type: object
      description: RFC 7807 問題の詳細エラーレスポンス
      properties:
        id:
          type: string
          description: ユニークなエラー識別子
        object:
          type: string
          enum:
            - error
          description: 常に 'error'
        code:
          type: string
          description: 機械可読なエラーコード
        type:
          type: string
          format: uri
          description: 問題タイプを識別するURI参照
        status:
          type: integer
          description: HTTPステータスコード
        title:
          type: string
          description: 短い、人間が読める要約
        detail:
          type: string
          description: 人間が読める説明
        created:
          type: integer
          description: Unixタイムスタンプ
        metadata:
          $ref: '#/components/schemas/Metadata'
        errors:
          type: array
          description: 追加のエラー詳細のオプション配列
          items: {}
      required:
        - id
        - object
        - code
        - type
        - status
        - title
        - detail
        - created
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer <token>形式のBearer認証ヘッダー。<token>はあなたの認証トークンです。

````