> For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.eagle.cool/web-api/ja-jp/api/library.md).

# Library

## エンドポイント一覧

| メソッド | エンドポイント                   | 説明             |
| ---- | ------------------------- | -------------- |
| GET  | `/api/v2/library/info`    | ライブラリのメタデータを取得 |
| GET  | `/api/v2/library/history` | ライブラリ履歴リストを取得  |
| POST | `/api/v2/library/switch`  | 指定のライブラリに切り替え  |
| GET  | `/api/v2/library/icon`    | ライブラリのアイコンを取得  |

***

## GET /api/v2/library/info <a href="#info" id="info"></a>

現在開いている Eagle ライブラリのメタデータ（名前、パス、設定など）を返します。

### レスポンス

```json
{
    "status": "success",
    "data": {
        "name": "My Design Library",
        "path": "D:\\Eagle Libraries\\My Design Library.library",
        "modificationTime": 1700000000000,
        "applicationVersion": "4.0",
        "folders": [],
        "smartFolders": [],
        "quickAccess": [],
        "tagGroups": []
    }
}
```

### 例

```javascript
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
```

***

## GET /api/v2/library/history <a href="#history" id="history"></a>

ライブラリの履歴リストを取得します。ページネーションされた結果を返します。

### クエリパラメータ

* `offset` integer（任意）-- ページネーションオフセット、デフォルト `0`
* `limit` integer（任意）-- ページネーションリミット、デフォルト `50`、最大 `1000`

### レスポンス

```json
{
    "status": "success",
    "data": {
        "data": [
            {
                "name": "My Design Library",
                "path": "D:\\Eagle Libraries\\My Design Library.library"
            }
        ],
        "total": 3,
        "offset": 0,
        "limit": 50
    }
}
```

### 例

```javascript
await fetch("http://localhost:41595/api/v2/library/history").then(r => r.json());

// ページネーション付き
await fetch("http://localhost:41595/api/v2/library/history?offset=0&limit=10").then(r => r.json());
```

***

## POST /api/v2/library/switch <a href="#switch" id="switch"></a>

指定のライブラリに切り替えます。

### リクエストボディ

* `libraryPath` string（必須）-- 切り替え先のライブラリパス

### レスポンス

```json
{
    "status": "success",
    "data": true
}
```

### 例

```javascript
await fetch("http://localhost:41595/api/v2/library/switch", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
        libraryPath: "D:\\Eagle Libraries\\My Design Library.library"
    })
}).then(r => r.json());
```

***

## GET /api/v2/library/icon <a href="#icon" id="icon"></a>

ライブラリのアイコンを取得します。

### クエリパラメータ

* `libraryPath` string（必須）-- ライブラリのパス

### レスポンス

アイコンの画像データを返します。

### 例

```javascript
await fetch("http://localhost:41595/api/v2/library/icon?libraryPath=D%3A%5CEagle%20Libraries%5CMy%20Design%20Library.library")
    .then(r => r.blob());
```

***

## ライブラリのプロパティ <a href="#properties" id="properties"></a>

ライブラリオブジェクトには以下のプロパティが含まれます：

| プロパティ                | 型         | 説明                        |
| -------------------- | --------- | ------------------------- |
| `name`               | string    | ライブラリの表示名                 |
| `path`               | string    | `.library` ディレクトリへのフルパス   |
| `modificationTime`   | integer   | 最終変更タイムスタンプ               |
| `applicationVersion` | string    | このライブラリを作成した Eagle のバージョン |
| `folders`            | Object\[] | トップレベルのフォルダ構造             |
| `smartFolders`       | Object\[] | スマートフォルダの設定               |
| `quickAccess`        | Object\[] | クイックアクセスのアイテム             |
| `tagGroups`          | Object\[] | タググループの定義                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.eagle.cool/web-api/ja-jp/api/library.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
