> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# 履歴項目を取得

GET https://api.elevenlabs.io/v1/history/{history_item_id}

履歴項目を取得します。

Reference: https://elevenlabs.io/docs/api-reference/history/get

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `history_item_id` (string, required) — 使用する履歴アイテムのID。履歴アイテムの一覧は、[生成済みアイテムを取得](/docs/api-reference/history/list)エンドポイントで取得できます。

## Response

### 200

成功レスポンス。

- `history_item_id` (string, required) — 履歴項目のID。
- `date_unix` (integer, required) — 項目が作成された時点のUnixタイムスタンプ。
- `character_count_change_from` (integer, required) — 変更前の文字数。
- `character_count_change_to` (integer, required) — 変更後の文字数。
- `content_type` (string, required) — 生成されたアイテムのコンテンツタイプ。
- `state` (any, required)
- `request_id` (string, optional, nullable) — リクエストのID。
- `voice_id` (string, optional, nullable) — 使用した音声のID。
- `model_id` (string, optional, nullable) — モデルのID。
- `voice_name` (string, optional, nullable) — 音声の名前。
- `voice_category` (enum, optional, nullable) — 音声のカテゴリです。'premade'、'cloned'、'generated'、または'professional'のいずれかです。
  - Allowed values: `premade`, `cloned`, `generated`, `professional`
- `text` (string, optional, nullable) — オーディオアイテムの生成に使用したテキストです。
- `settings` (map from string to any, optional, nullable) — 履歴項目の設定。
- `share_link_id` (string, optional, nullable) — 共有リンクのID。
- `source` (enum, optional, nullable) — 履歴項目のソース。TTS（テキスト読み上げ）、STS（スピーチtoテキスト）、AN（オーディオネイティブ）、プロジェクト、吹き替え、PlayAPI、PD（発音辞書）、またはConvAI（Agents Platform）のいずれかです。
  - Allowed values: `TTS`, `STS`, `Projects`, `PD`, `AN`, `Dubbing`, `PlayAPI`, `ConvAI`, `VoiceGeneration`, `InVPC`, `Flows`, `VoicePreview`
- `alignments` (HistoryAlignmentsResponseModel, optional, nullable) — 履歴アイテムのアラインメント。
- `dialogue` (list of DialogueInputResponseModel, optional, nullable) — オーディオアイテムの生成に使用したダイアログ（音声とテキストのペア）。これを設定すると、最上位の`text`および`voice_id`フィールドは空になります。
- `output_format` (string, optional, nullable) — オーディオが元々生成された出力形式。

## Errors

### 422 Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### HistoryAlignmentsResponseModel

- `alignment` (HistoryAlignmentResponseModel, required) — テキストのアラインメント。
- `normalized_alignment` (HistoryAlignmentResponseModel, required) — テキストの正規化されたアラインメント。

### DialogueInputResponseModel

- `text` (string, required) — 対話入力行のテキスト。
- `voice_id` (string, required) — この会話入力行に使用する音声のID。
- `voice_name` (string, required) — この会話入力行に使用する音声の名前。

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### HistoryAlignmentResponseModel

- `characters` (list of string, required) — アラインメント内の文字。
- `character_start_times_seconds` (list of double, required) — 文字の開始時刻（秒）。
- `character_end_times_seconds` (list of double, required) — 文字の終了時刻（秒）。

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "history_item_id": "ja9xsmfGhxYcymxGcOGB",
  "date_unix": 1714650306,
  "character_count_change_from": 17189,
  "character_count_change_to": 17231,
  "content_type": "audio/mpeg",
  "state": null,
  "request_id": "BF0BZg4IwLGBlaVjv9Im",
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "model_id": "eleven_multilingual_v2",
  "voice_name": "Rachel",
  "voice_category": "premade",
  "text": "Hello, world!",
  "settings": {
    "similarity_boost": 0.5,
    "stability": 0.71,
    "style": 0,
    "use_speaker_boost": true
  },
  "source": "TTS"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```