# Table of Contents
- [Introduction | Web API](#introduction-web-api)
- [Smart Folder | Web API](#smart-folder-web-api)
- [API Playground | Web API](#api-playground-web-api)
- [Folder | Web API](#folder-web-api)
- [Item | Web API](#item-web-api)
- [Tag Group | Web API](#tag-group-web-api)
- [AI Search | Web API](#ai-search-web-api)
- [Library | Web API](#library-web-api)
- [App | Web API](#app-web-api)
- [Changelog | Web API](#changelog-web-api)
- [Tag | Web API](#tag-web-api)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
- [Unknown](#unknown)
---
# Introduction | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/get-started/readme.md)
.
Welcome to the **Eagle Web API V2** documentation. This API allows any HTTP client — scripts, apps, browser extensions, automation tools — to interact with the Eagle application over a local HTTP server.
**Looking for the V1 API?** The legacy V1 API documentation is available at [https://api.eagle.cool/](https://api.eagle.cool/)
. V2 offers a more comprehensive feature set based on the Plugin API capabilities.
**Version Requirement:** The V2 Web API requires **Eagle 4.0 Build 21** or later.
* * *
Web API vs Plugin API[](https://developer.eagle.cool/web-api#web-api-vs-plugin-api)
------------------------------------------------------------------------------------
Eagle provides two different APIs for developers:
* **Web API** (this documentation) — A RESTful HTTP API for building **external** tools, services, scripts, or integrations that communicate with Eagle from outside the application. Use this if you are building browser extensions, automation workflows, third-party apps, or any tool that runs independently of Eagle.
* [**Plugin API**](https://developer.eagle.cool/plugin-api)
— A JavaScript API for building plugins that run **inside** Eagle. Plugins have direct access to Eagle's UI, can create custom panels, respond to user interactions, and deeply integrate with the application. Use this if you want to extend Eagle's built-in functionality.
Web API
Plugin API
Runs
Outside Eagle (any HTTP client)
Inside Eagle (as a plugin)
Protocol
HTTP REST
JavaScript API
Use case
External tools, scripts, automation
Eagle plugins, custom panels, UI extensions
Documentation
This site
[developer.eagle.cool/plugin-api](https://developer.eagle.cool/plugin-api)
* * *
What's New in V2[](https://developer.eagle.cool/web-api#whats-new)
-------------------------------------------------------------------
The V2 API (`/api/v2/...`) provides significantly more endpoints than V1 (`/api/...`), including:
* **Full-text search** with advanced query syntax (AND, OR, NOT)
* **AI semantic search** — search by text description or image similarity
* **Tag management** — create, rename, merge tags and manage tag groups
* **Folder management** — create, move, and organize folders
* **Automatic pagination** — all list endpoints are paginated by default to ensure performance
* [**API Playground**](https://developer.eagle.cool/web-api/get-started/playground)
— built-in interactive tool to test all endpoints directly in your browser
* * *
Prerequisites[](https://developer.eagle.cool/web-api#prerequisites)
--------------------------------------------------------------------
Eagle is a local application — the API server starts automatically when the Eagle app is opened. **You must have Eagle running** before you can access any API endpoint.
* * *
Base URL[](https://developer.eagle.cool/web-api#base-url)
----------------------------------------------------------
Copy
http://localhost:41595/api/v2/
The Eagle API server runs on port **41595** by default. All V2 endpoints are prefixed with `/api/v2/`.
* * *
Authentication[](https://developer.eagle.cool/web-api#authentication)
----------------------------------------------------------------------
### Local Access (localhost)[](https://developer.eagle.cool/web-api#local-access-localhost)
If you are making requests from the same machine where Eagle is running, **no authentication is required**. Requests from `localhost`, `127.0.0.1`, or `0.0.0.0` are automatically trusted — you can start calling the API right away.
Copy
// Local access — no token needed
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
### Remote Access (LAN / Network)[](https://developer.eagle.cool/web-api#remote-access-lan-network)
If you want to call the Eagle API from another device on your local network (e.g., a phone, tablet, or another computer), you must include an **API Token** with every request.
#### How to Get Your API Token[](https://developer.eagle.cool/web-api#how-to-get-your-api-token)
1. Open Eagle and go to **Preferences** (Settings)
2. Click on **Developer** in the left sidebar
3. Your **API Token** is displayed at the top of the page
4. Click the copy button next to the token to copy it to your clipboard
You can also click **Regenerate Token** to generate a new token at any time. Note that regenerating a token will invalidate the previous one.
#### Using the Token[](https://developer.eagle.cool/web-api#using-the-token)
Append the `token` parameter to any request URL:
Copy
// Remote access with token
const TOKEN = "f366c476-7533-4f33-b454-2bc720a1d0ea";
await fetch(`http://192.168.1.100:41595/api/v2/library/info?token=${TOKEN}`)
.then(r => r.json());
// Also works with POST requests
await fetch(`http://192.168.1.100:41595/api/v2/item/get?token=${TOKEN}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ tags: ["design"], limit: 20 })
}).then(r => r.json());
**Keep your token private.** Anyone with your API Token can access and modify your Eagle library over the network. Do not share it publicly or commit it to version control.
* * *
Response Format[](https://developer.eagle.cool/web-api#response-format)
------------------------------------------------------------------------
All endpoints return responses in [JSend](https://github.com/omniti-labs/jsend)
format:
**Success:**
Copy
{
"status": "success",
"data": { ... }
}
**Error:**
Copy
{
"status": "error",
"message": "Error description"
}
* * *
Pagination[](https://developer.eagle.cool/web-api#pagination)
--------------------------------------------------------------
All list endpoints (`item/get`, `item/query`, `folder/get`, `tag/get`, etc.) return paginated results by default.
Parameter
Type
Default
Max
Description
`offset`
Integer
`0`
—
Number of items to skip
`limit`
Integer
`50`
`1000`
Number of items to return
**Paginated response:**
Copy
{
"status": "success",
"data": {
"data": [ ... ],
"total": 8500,
"offset": 100,
"limit": 50
}
}
* `total` — Total number of matching items (before pagination)
* `offset` — The offset used
* `limit` — The limit used
* `data` — The paginated result array
**Example: Iterating through all items**
Copy
// Page 1: items 0-49
const page1 = await fetch("http://localhost:41595/api/v2/item/get?limit=50").then(r => r.json());
// Page 2: items 50-99
const page2 = await fetch("http://localhost:41595/api/v2/item/get?offset=50&limit=50").then(r => r.json());
// Continue until data.data.length < limit (last page)
* * *
Quick Start[](https://developer.eagle.cool/web-api#quick-start)
----------------------------------------------------------------
Copy
// Check if Eagle is running
await fetch("http://localhost:41595/api/v2/app/info").then(r => r.json());
// Get library info
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
// List first 50 items
await fetch("http://localhost:41595/api/v2/item/get").then(r => r.json());
// Search items by tag
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ tags: ["design"] })
}).then(r => r.json());
// Full-text search
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset landscape" })
}).then(r => r.json());
// AI semantic search
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "an orange cat", options: { limit: 10 } })
}).then(r => r.json());
* * *
API Sections[](https://developer.eagle.cool/web-api#api-sections)
------------------------------------------------------------------
Section
Description
[Item](https://developer.eagle.cool/web-api/api/item)
Query, add, modify, and manage items
[Folder](https://developer.eagle.cool/web-api/api/folder)
Create, list, and organize folders
[Tag](https://developer.eagle.cool/web-api/api/tag)
List, rename, and merge tags
[Tag Group](https://developer.eagle.cool/web-api/api/tag-group)
Manage tag groups
[Library](https://developer.eagle.cool/web-api/api/library)
Get library metadata
[App](https://developer.eagle.cool/web-api/api/app)
Application information
[AI Search](https://developer.eagle.cool/web-api/api/ai-search)
AI semantic & image search
* * *
CORS[](https://developer.eagle.cool/web-api#cors)
--------------------------------------------------
If you are calling the Eagle API from a webpage (e.g., via a userscript manager like **Tampermonkey** or **Violentmonkey**), standard `fetch` requests may be blocked by the browser's Cross-Origin Resource Sharing (CORS) policy. In this case, use `GM_xmlhttpRequest` instead:
Copy
GM_xmlhttpRequest({
method: "GET",
url: "http://localhost:41595/api/v2/item/get",
onload: function (response) {
const data = JSON.parse(response.responseText);
console.log(data);
}
});
This only applies to scripts running inside web pages. If you are calling the API from Node.js, Electron, a browser extension's background script, or directly from DevTools, CORS does not apply and you can use `fetch` normally.
* * *
Rate Limits[](https://developer.eagle.cool/web-api#rate-limits)
----------------------------------------------------------------
There are **no rate limits** on API calls. Since the API server runs locally on your machine, all requests are processed directly without any throttling. However, keep in mind that the server's performance depends on your device's hardware — heavy operations on very large libraries may take longer to respond.
[NextAPI Playground](https://developer.eagle.cool/web-api/get-started/playground)
Last updated 7 months ago
---
# Smart Folder | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/smart-folder.md)
.
**This feature is not yet released**: This API requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
Endpoint Overview[](https://developer.eagle.cool/web-api/api/smart-folder#endpoint-overview)
---------------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/smartFolder/get`
List smart folders
POST
`/api/v2/smartFolder/get`
List smart folders (request body)
POST
`/api/v2/smartFolder/create`
Create a smart folder
POST
`/api/v2/smartFolder/update`
Update a smart folder
POST
`/api/v2/smartFolder/remove`
Delete a smart folder
GET
`/api/v2/smartFolder/getItems`
Get matching items
POST
`/api/v2/smartFolder/getItems`
Get matching items (request body)
GET
`/api/v2/smartFolder/getRules`
Get available rule schema
* * *
GET /api/v2/smartFolder/get[](https://developer.eagle.cool/web-api/api/smart-folder#list)
------------------------------------------------------------------------------------------
List all smart folders, or filter by ID.
### Query Parameters[](https://developer.eagle.cool/web-api/api/smart-folder#query-parameters)
* `id` string (optional) — Return a single smart folder by ID
* `ids` string (optional) — Comma-separated smart folder IDs
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response)
Copy
{
"status": "success",
"data": [\
{\
"id": "LRK3AQGN7VCB1",\
"name": "Large Images",\
"conditions": [\
{\
"rules": [\
{ "property": "width", "method": ">", "value": [1920] }\
],\
"match": "AND",\
"boolean": "TRUE"\
}\
],\
"description": "",\
"icon": "",\
"iconColor": "blue",\
"children": [],\
"modificationTime": 1700000000000,\
"imageCount": 42\
}\
]
}
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples)
Copy
// List all smart folders
await fetch("http://localhost:41595/api/v2/smartFolder/get").then(r => r.json());
// Get a single smart folder by ID
await fetch("http://localhost:41595/api/v2/smartFolder/get?id=LRK3AQGN7VCB1").then(r => r.json());
* * *
POST /api/v2/smartFolder/get[](https://developer.eagle.cool/web-api/api/smart-folder#list-post)
------------------------------------------------------------------------------------------------
Same as GET, but accepts filter parameters in a JSON body.
### Request Body[](https://developer.eagle.cool/web-api/api/smart-folder#request-body)
* `id` string (optional) — Smart folder ID
* `ids` string\[\] (optional) — Array of smart folder IDs
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-1)
Copy
// Get smart folders by multiple IDs
await fetch("http://localhost:41595/api/v2/smartFolder/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: ["SMART_FOLDER_ID_1", "SMART_FOLDER_ID_2"]
})
}).then(r => r.json());
* * *
POST /api/v2/smartFolder/create[](https://developer.eagle.cool/web-api/api/smart-folder#create)
------------------------------------------------------------------------------------------------
Create a new smart folder.
### Request Body[](https://developer.eagle.cool/web-api/api/smart-folder#request-body-1)
* `name` string (required) — Smart folder name
* `conditions` Object\[\] (required) — Filter conditions (see [Conditions Format](https://developer.eagle.cool/web-api/api/smart-folder#conditions)
below)
* `description` string (optional) — Description
* `icon` string (optional) — Icon
* `iconColor` string (optional) — Icon color. Allowed values: `red`, `orange`, `yellow`, `green`, `aqua`, `blue`, `purple`, `pink`
* `parent` string (optional) — Parent smart folder ID. If omitted, creates at root level.
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response-1)
Returns the newly created smart folder object.
Copy
{
"status": "success",
"data": {
"id": "NEW_SMART_FOLDER_ID",
"name": "Large Images",
"conditions": [\
{\
"rules": [\
{ "property": "width", "method": ">", "value": [1920] }\
],\
"match": "AND"\
}\
],
"description": "",
"icon": "",
"iconColor": "",
"children": [],
"modificationTime": 1700000000000,
"imageCount": 150
}
}
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-2)
Copy
// Create a smart folder for large PNG images
await fetch("http://localhost:41595/api/v2/smartFolder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Large PNGs",
conditions: [\
{\
"rules": [\
{ "property": "width", "method": ">", "value": [1920] },\
{ "property": "type", "method": "equal", "value": "png" }\
],\
"match": "AND"\
}\
],
iconColor: "blue"
})
}).then(r => r.json());
* * *
POST /api/v2/smartFolder/update[](https://developer.eagle.cool/web-api/api/smart-folder#update)
------------------------------------------------------------------------------------------------
Update an existing smart folder's metadata. Only the fields you include will be modified.
### Request Body[](https://developer.eagle.cool/web-api/api/smart-folder#request-body-2)
* `id` string (required) — Smart folder ID to update
**Modifiable fields:**
* `name` string (optional) — New name
* `conditions` Object\[\] (optional) — New filter conditions
* `description` string (optional) — New description
* `icon` string (optional) — New icon
* `iconColor` string (optional) — New icon color
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response-2)
Returns the updated smart folder object.
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-3)
Copy
// Update name and icon color
await fetch("http://localhost:41595/api/v2/smartFolder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
name: "Extra Large Images",
iconColor: "green"
})
}).then(r => r.json());
// Update filter conditions
await fetch("http://localhost:41595/api/v2/smartFolder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
conditions: [\
{\
"rules": [\
{ "property": "width", "method": ">", "value": [3840] }\
],\
"match": "AND"\
}\
]
})
}).then(r => r.json());
* * *
POST /api/v2/smartFolder/remove[](https://developer.eagle.cool/web-api/api/smart-folder#remove)
------------------------------------------------------------------------------------------------
Delete a smart folder. This also removes all its child smart folders.
### Request Body[](https://developer.eagle.cool/web-api/api/smart-folder#request-body-3)
* `id` string (required) — Smart folder ID to delete
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response-3)
Copy
{
"status": "success",
"data": true
}
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-4)
Copy
await fetch("http://localhost:41595/api/v2/smartFolder/remove", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: "LRK3AQGN7VCB1" })
}).then(r => r.json());
* * *
GET /api/v2/smartFolder/getItems[](https://developer.eagle.cool/web-api/api/smart-folder#get-items)
----------------------------------------------------------------------------------------------------
Get items that match the smart folder's filter conditions.
### Query Parameters[](https://developer.eagle.cool/web-api/api/smart-folder#query-parameters-1)
* `smartFolderId` string (required) — Smart folder ID
* `orderBy` string (optional) — Sort field
* `fields` string (optional) — Comma-separated list of fields to return
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response-4)
Copy
{
"status": "success",
"data": [\
{\
"id": "M3QSGJNQTC2DG",\
"name": "wallpaper",\
"ext": "png",\
"width": 3840,\
"height": 2160,\
"tags": ["wallpaper"],\
"folders": []\
}\
]
}
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-5)
Copy
// Get all items in a smart folder
await fetch("http://localhost:41595/api/v2/smartFolder/getItems?smartFolderId=LRK3AQGN7VCB1")
.then(r => r.json());
// Return only specific fields
await fetch("http://localhost:41595/api/v2/smartFolder/getItems?smartFolderId=LRK3AQGN7VCB1&fields=id,name,tags")
.then(r => r.json());
* * *
POST /api/v2/smartFolder/getItems[](https://developer.eagle.cool/web-api/api/smart-folder#get-items-post)
----------------------------------------------------------------------------------------------------------
Same as GET, but accepts parameters in a JSON body.
### Request Body[](https://developer.eagle.cool/web-api/api/smart-folder#request-body-4)
* `smartFolderId` string (required) — Smart folder ID
* `orderBy` string (optional) — Sort field
* `fields` string\[\] (optional) — Fields to return
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-6)
Copy
await fetch("http://localhost:41595/api/v2/smartFolder/getItems", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
smartFolderId: "LRK3AQGN7VCB1",
fields: ["id", "name", "ext", "width", "height"]
})
}).then(r => r.json());
* * *
GET /api/v2/smartFolder/getRules[](https://developer.eagle.cool/web-api/api/smart-folder#get-rules)
----------------------------------------------------------------------------------------------------
Get the available filter rule schema. Returns supported methods, valueType, options, and more for each property, enabling callers to dynamically construct valid conditions.
### Response[](https://developer.eagle.cool/web-api/api/smart-folder#response-5)
Copy
{
"status": "success",
"data": {
"name": {
"methods": ["contain", "uncontain", "equal", "startWith", "endWith", "empty", "not-empty", "regex"],
"valueType": "string"
},
"width": {
"methods": ["=", ">=", "<=", ">", "<", "between"],
"valueType": "number"
},
"type": {
"methods": ["equal", "unequal"],
"valueType": "string",
"options": ["jpg", "png", "gif", "svg", "bmp", "webp", "..."]
}
}
}
### Examples[](https://developer.eagle.cool/web-api/api/smart-folder#examples-7)
Copy
// Get available rules for dynamically building conditions
await fetch("http://localhost:41595/api/v2/smartFolder/getRules").then(r => r.json());
**Tip:** Call `getRules` first to get all available properties and methods, then build your `conditions` based on the returned schema before passing them to `create` or `update`. This helps avoid invalid filter conditions.
* * *
Conditions Format[](https://developer.eagle.cool/web-api/api/smart-folder#conditions)
--------------------------------------------------------------------------------------
A smart folder's `conditions` is an array of condition groups, each containing multiple rules:
Copy
[\
{\
"rules": [\
{ "property": "name", "method": "contain", "value": "cat" },\
{ "property": "width", "method": ">", "value": [1920] }\
],\
"match": "AND",\
"boolean": "TRUE"\
}\
]
### Condition Group Properties[](https://developer.eagle.cool/web-api/api/smart-folder#condition-group-properties)
Property
Type
Description
`rules`
Object\[\]
Array of rules
`match`
string
Logic between rules. `"AND"`: all must match; `"OR"`: any must match
`boolean`
string
Include/exclude logic. `"TRUE"` (include, default) or `"FALSE"` (exclude)
### Rule Properties[](https://developer.eagle.cool/web-api/api/smart-folder#rule-properties)
Property
Type
Description
`property`
string
Filter property (e.g., `name`, `width`, `type`)
`method`
string
Filter method (e.g., `contain`, `>`, `equal`)
`value`
any
Filter value (format depends on property and method)
**Tip:** Use `GET /api/v2/smartFolder/getRules` to query all available properties, methods, and their corresponding valueTypes.
* * *
SmartFolder Properties[](https://developer.eagle.cool/web-api/api/smart-folder#properties)
-------------------------------------------------------------------------------------------
Smart folders returned by the API contain the following properties:
Property
Type
Description
`id`
string
Unique smart folder ID
`name`
string
Name
`conditions`
Object\[\]
Filter conditions
`description`
string
Description
`icon`
string
Icon
`iconColor`
string
Icon color
`children`
Object\[\]
Child smart folders
`modificationTime`
integer
Last modification timestamp
`imageCount`
integer
Number of matching items
[PreviousFolder](https://developer.eagle.cool/web-api/api/folder)
[NextTag](https://developer.eagle.cool/web-api/api/tag)
Last updated 7 months ago
---
# API Playground | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/get-started/playground.md)
.
Eagle includes a built-in interactive API playground that lets you test all API endpoints without writing any code. Open it in your browser:
Copy
http://localhost:41595/api/v2/playground

Key features of the playground:
* **Live testing** — Send real API requests against your current Eagle library and see responses instantly
* **GUI parameter input** — Select and fill in parameters through a visual form, no need to manually craft JSON
* **Code snippets** — Each operation automatically generates a JavaScript `fetch` code snippet you can copy and use directly
* **Full endpoint list** — The left sidebar lists all available API endpoints, organized by category
The playground operates on your actual library data. Write operations (add, update, delete) will modify your data for real — use with care.
[PreviousIntroduction](https://developer.eagle.cool/web-api)
[NextItem](https://developer.eagle.cool/web-api/api/item)
Last updated 7 months ago
---
# Folder | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/folder.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/folder#endpoints-overview)
-----------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/folder/get`
List all folders
POST
`/api/v2/folder/get`
List folders (body)
POST
`/api/v2/folder/create`
Create a new folder
POST
`/api/v2/folder/update`
Update a folder
* * *
GET /api/v2/folder/get[](https://developer.eagle.cool/web-api/api/folder#list)
-------------------------------------------------------------------------------
List folders with optional filtering. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/folder#query-parameters)
* `id` string (optional) — Return a single folder by ID
* `ids` string (optional) — Comma-separated folder IDs
* `isSelected` boolean (optional) — Return the currently selected folder
* `isRecent` boolean (optional) — Return recently used folders
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/folder#response)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"id": "LRK3AQGN7VCB1",\
"name": "Design References",\
"description": "UI/UX design references",\
"children": [],\
"modificationTime": 1700000000000,\
"tags": [],\
"iconColor": "blue",\
"imageCount": 42\
}\
],
"total": 25,
"offset": 0,
"limit": 50
}
}
### Examples[](https://developer.eagle.cool/web-api/api/folder#examples)
Copy
// List all folders (first 50)
await fetch("http://localhost:41595/api/v2/folder/get").then(r => r.json());
// Get a single folder by ID
await fetch("http://localhost:41595/api/v2/folder/get?id=LRK3AQGN7VCB1").then(r => r.json());
// Get recently used folders
await fetch("http://localhost:41595/api/v2/folder/get?isRecent=true").then(r => r.json());
* * *
POST /api/v2/folder/get[](https://developer.eagle.cool/web-api/api/folder#list-post)
-------------------------------------------------------------------------------------
Same as GET, but accepts filter parameters in the JSON body.
### Request Body[](https://developer.eagle.cool/web-api/api/folder#request-body)
* `id` string (optional) — Folder ID
* `ids` string\[\] (optional) — Array of folder IDs
* `isSelected` boolean (optional) — Currently selected folder
* `isRecent` boolean (optional) — Recently used folders
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Example[](https://developer.eagle.cool/web-api/api/folder#example)
Copy
// Get folders by multiple IDs
await fetch("http://localhost:41595/api/v2/folder/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: ["FOLDER_ID_1", "FOLDER_ID_2"]
})
}).then(r => r.json());
* * *
POST /api/v2/folder/create[](https://developer.eagle.cool/web-api/api/folder#create)
-------------------------------------------------------------------------------------
Create a new folder in the library.
### Request Body[](https://developer.eagle.cool/web-api/api/folder#request-body-1)
* `name` string (required) — Folder name
* `description` string (optional) — Folder description
* `parent` string (optional) — Parent folder ID. If omitted, creates at root level.
### Response[](https://developer.eagle.cool/web-api/api/folder#response-1)
Returns the newly created folder object.
Copy
{
"status": "success",
"data": {
"id": "NEW_FOLDER_ID",
"name": "My New Folder",
"description": "",
"children": [],
"modificationTime": 1700000000000,
"tags": []
}
}
### Examples[](https://developer.eagle.cool/web-api/api/folder#examples-1)
Copy
// Create a root-level folder
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "My New Folder" })
}).then(r => r.json());
// Create a subfolder
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Subfolder",
description: "A subfolder for organizing",
parent: "PARENT_FOLDER_ID"
})
}).then(r => r.json());
* * *
POST /api/v2/folder/update[](https://developer.eagle.cool/web-api/api/folder#update)
-------------------------------------------------------------------------------------
Update an existing folder's metadata. Only the fields you include will be modified.
### Request Body[](https://developer.eagle.cool/web-api/api/folder#request-body-2)
* `id` string (required) — The folder ID to update
**Modifiable fields:**
* `name` string (optional) — New folder name
* `description` string (optional) — New description
* `tags` string\[\] (optional) — Replace folder tags
* `iconColor` string (optional) — Folder icon color. One of: `red`, `orange`, `yellow`, `green`, `aqua`, `blue`, `purple`, `pink`
* `parent` string | null (optional) — Move folder to a new parent. Set to `null` to move to root.
### Response[](https://developer.eagle.cool/web-api/api/folder#response-2)
Returns the updated folder object.
### Examples[](https://developer.eagle.cool/web-api/api/folder#examples-2)
Copy
// Rename a folder and set icon color
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
name: "Renamed Folder",
iconColor: "green"
})
}).then(r => r.json());
// Move folder to a different parent
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: "NEW_PARENT_ID"
})
}).then(r => r.json());
// Move folder to root level
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: null
})
}).then(r => r.json());
* * *
Folder Properties[](https://developer.eagle.cool/web-api/api/folder#properties)
--------------------------------------------------------------------------------
Folders returned by the API contain the following properties:
Property
Type
Description
`id`
string
Unique folder ID
`name`
string
Folder name
`description`
string
Folder description
`children`
Object\[\]
Array of child folder objects
`modificationTime`
integer
Last modification timestamp
`tags`
string\[\]
Array of tag names
`iconColor`
string
Icon color name
`imageCount`
integer
Number of items in this folder
[PreviousItem](https://developer.eagle.cool/web-api/api/item)
[NextSmart Folder](https://developer.eagle.cool/web-api/api/smart-folder)
Last updated 7 months ago
---
# Item | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/item.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/item#endpoints-overview)
---------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/item/get`
List items with filters
POST
`/api/v2/item/get`
List items with filters (body)
POST
`/api/v2/item/query`
Full-text search
GET
`/api/v2/item/countAll`
Count all items
POST
`/api/v2/item/add`
Add a new item
POST
`/api/v2/item/update`
Update an item
POST
`/api/v2/item/setCustomThumbnail`
Set a custom thumbnail
POST
`/api/v2/item/refreshThumbnail`
Refresh item thumbnail
* * *
GET /api/v2/item/get[](https://developer.eagle.cool/web-api/api/item#list)
---------------------------------------------------------------------------
List items with optional filtering. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/item#query-parameters)
* `id` string (optional) — Return a single item by ID
* `ids` string (optional) — Comma-separated item IDs
* `isSelected` boolean (optional) — Return currently selected items
* `isUntagged` boolean (optional) — Return items without tags
* `isUnfiled` boolean (optional) — Return items not in any folder
* `keywords` string (optional) — Filter by keywords (comma-separated)
* `tags` string (optional) — Filter by tags (comma-separated)
* `folders` string (optional) — Filter by folder IDs (comma-separated)
* `ext` string (optional) — Filter by file extension (e.g., `jpg`, `png`)
* `annotation` string (optional) — Filter by annotation text
* `rating` integer (optional) — Filter by rating (`0`–`5`)
* `url` string (optional) — Filter by source URL
* `shape` string (optional) — Filter by shape: `square`, `portrait`, `panoramic-portrait`, `landscape`, `panoramic-landscape`
* `fields` string (optional) — Comma-separated list of fields to return (improves performance)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/item#response)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"id": "M3QSGJNQTC2DG",\
"name": "sunset-photo",\
"ext": "jpg",\
"width": 1920,\
"height": 1080,\
"url": "https://example.com/photo.jpg",\
"tags": ["nature", "sunset"],\
"folders": ["FOLDER_ID_1"],\
"star": 4,\
"annotation": "Beautiful sunset at the beach",\
"modificationTime": 1700000000000\
}\
],
"total": 1250,
"offset": 0,
"limit": 50
}
}
### Examples[](https://developer.eagle.cool/web-api/api/item#examples)
Copy
// List first 50 items (default)
await fetch("http://localhost:41595/api/v2/item/get").then(r => r.json());
// Get a single item by ID
await fetch("http://localhost:41595/api/v2/item/get?id=M3QSGJNQTC2DG").then(r => r.json());
// Filter by extension with pagination
await fetch("http://localhost:41595/api/v2/item/get?ext=png&offset=0&limit=100").then(r => r.json());
// Return only specific fields for better performance
await fetch("http://localhost:41595/api/v2/item/get?fields=id,name,tags").then(r => r.json());
* * *
POST /api/v2/item/get[](https://developer.eagle.cool/web-api/api/item#list-post)
---------------------------------------------------------------------------------
Same as GET, but accepts filter parameters in the JSON body. Useful for complex queries with arrays.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body)
* `id` string (optional) — Item ID
* `ids` string\[\] (optional) — Array of item IDs
* `isSelected` boolean (optional) — Currently selected items
* `isUntagged` boolean (optional) — Items without tags
* `isUnfiled` boolean (optional) — Items not in any folder
* `keywords` string\[\] (optional) — Keywords to match
* `tags` string\[\] (optional) — Tags to match
* `folders` string\[\] (optional) — Folder IDs to match
* `smartFolders` string\[\] (optional) — Filter by smart folder IDs (OR logic, matches any)
* `ext` string (optional) — File extension
* `annotation` string (optional) — Annotation text
* `rating` integer (optional) — Rating (`0`–`5`)
* `url` string (optional) — Source URL
* `shape` string (optional) — Image shape
* `fields` string\[\] (optional) — Fields to return
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Examples[](https://developer.eagle.cool/web-api/api/item#examples-1)
Copy
// Filter by tags
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
tags: ["design", "inspiration"],
limit: 20
})
}).then(r => r.json());
// Get items by multiple IDs
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: ["ITEM_ID_1", "ITEM_ID_2", "ITEM_ID_3"]
})
}).then(r => r.json());
// Filter JPG files in a specific folder, return only id and name
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ext: "jpg",
folders: ["FOLDER_ID"],
fields: ["id", "name", "tags"],
offset: 0,
limit: 100
})
}).then(r => r.json());
Copy
// Filter with smart folders
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
smartFolders: ["SMART_FOLDER_ID"],
tags: ["cat"],
limit: 20
})
}).then(r => r.json());
**Performance Tip:** Use the `fields` parameter to return only the data you need. This significantly improves response time when working with large libraries.
* * *
POST /api/v2/item/query[](https://developer.eagle.cool/web-api/api/item#query)
-------------------------------------------------------------------------------
Full-text search across item names, tags, annotations, URLs, folder names, and more. Supports advanced query syntax. Returns paginated results.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-1)
* `query` string — Search query string
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Query Syntax[](https://developer.eagle.cool/web-api/api/item#query-syntax)
Syntax
Description
Example
`word`
Must contain word
`cat`
`a b`
Must contain both (AND)
`cat dog`
`a OR b`
Contains either (OR)
`cat OR dog`
`a || b`
Contains either (OR)
`cat || dog`
`-word`
Must NOT contain
`cat -dog`
`"phrase"`
Exact phrase match
`"orange cat"`
`(a OR b) c`
Grouping
`(cat OR dog) cute`
### Examples[](https://developer.eagle.cool/web-api/api/item#examples-2)
Copy
// Simple search
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset" })
}).then(r => r.json());
// Advanced search: items with "cat" or "dog" but not "cartoon"
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: "(cat OR dog) -cartoon",
limit: 20
})
}).then(r => r.json());
// Paginate through search results
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "design", offset: 50, limit: 50 })
}).then(r => r.json());
* * *
GET /api/v2/item/countAll[](https://developer.eagle.cool/web-api/api/item#count)
---------------------------------------------------------------------------------
Returns the total number of items in the library.
### Response[](https://developer.eagle.cool/web-api/api/item#response-1)
Copy
{
"status": "success",
"data": 12500
}
### Example[](https://developer.eagle.cool/web-api/api/item#example)
Copy
await fetch("http://localhost:41595/api/v2/item/countAll").then(r => r.json());
* * *
POST /api/v2/item/add[](https://developer.eagle.cool/web-api/api/item#add)
---------------------------------------------------------------------------
Add a new item to Eagle. Supports adding from URL, Base64 data, local file path, or bookmark.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-2)
* `id` string (optional) — Custom item ID
* `name` string (optional) — Item name
* `tags` string\[\] (optional) — Tags to assign
* `folders` string\[\] (optional) — Folder IDs to add the item to
* `annotation` string (optional) — Item annotation
* `website` string (optional) — Source website URL
**Plus one of the following:**
* `url` string — Image URL to download
* `base64` string — Base64 encoded image data
* `path` string — Local file path to import
* `bookmarkURL` string — URL to add as a bookmark
### Examples[](https://developer.eagle.cool/web-api/api/item#examples-3)
Copy
// Add from URL
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://example.com/photo.jpg",
name: "Example Photo",
tags: ["downloaded", "example"],
folders: ["FOLDER_ID"]
})
}).then(r => r.json());
// Add from local file path
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
path: "C:\\Users\\User\\Downloads\\design.png",
name: "My Design",
tags: ["design"]
})
}).then(r => r.json());
// Add a bookmark
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
bookmarkURL: "https://www.example.com",
name: "Example Site",
tags: ["bookmark"]
})
}).then(r => r.json());
// Batch add multiple items (up to 1000)
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
items: [\
{ url: "https://example.com/photo1.jpg", name: "Photo 1" },\
{ path: "C:\\Users\\User\\Downloads\\design.png", name: "Design" },\
{ bookmarkURL: "https://www.example.com", name: "Bookmark" }\
]
})
}).then(r => r.json());
### Batch Mode[](https://developer.eagle.cool/web-api/api/item#batch-mode)
Pass an `items` array to add multiple items at once (up to 1000). Each object in the array follows the same format as single mode, and you can mix `path`, `url`, `bookmarkURL`, and `base64`.
### Response[](https://developer.eagle.cool/web-api/api/item#response-2)
Single mode returns the new item's ID:
Copy
{
"status": "success",
"data": { "id": "M3QSGJNQTC2DG" }
}
Batch mode returns all new item IDs:
Copy
{
"status": "success",
"data": { "ids": ["ITEM_ID_1", "ITEM_ID_2", "ITEM_ID_3"] }
}
* * *
POST /api/v2/item/update[](https://developer.eagle.cool/web-api/api/item#update)
---------------------------------------------------------------------------------
Update an existing item's metadata. Only the fields you include will be modified.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-3)
* `id` string (required) — The item ID to update
**Modifiable fields:**
* `name` string (optional) — New name
* `tags` string\[\] (optional) — Replace tags
* `folders` string\[\] (optional) — Replace folder assignments
* `annotation` string (optional) — New annotation
* `url` string (optional) — New source URL
* `star` integer (optional) — Rating, `0`–`5`
* `modificationTime` integer (optional) — Modification timestamp
* `noThumbnail` boolean (optional) — Mark as having no thumbnail
* `noPreview` boolean (optional) — Mark as not previewable
* `isDeleted` boolean (optional) — Move to / restore from trash
### Response[](https://developer.eagle.cool/web-api/api/item#response-3)
Returns the updated item object.
### Examples[](https://developer.eagle.cool/web-api/api/item#examples-4)
Copy
// Update item name and tags
await fetch("http://localhost:41595/api/v2/item/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
name: "Updated Name",
tags: ["tag1", "tag2"],
star: 5
})
}).then(r => r.json());
// Move item to trash
await fetch("http://localhost:41595/api/v2/item/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
isDeleted: true
})
}).then(r => r.json());
* * *
POST /api/v2/item/setCustomThumbnail[](https://developer.eagle.cool/web-api/api/item#set-thumbnail)
----------------------------------------------------------------------------------------------------
Set a custom thumbnail for an item from a local image file.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-4)
* `itemId` string (required) — The item ID
* `filePath` string (required) — Path to the thumbnail image
### Example[](https://developer.eagle.cool/web-api/api/item#example-1)
Copy
await fetch("http://localhost:41595/api/v2/item/setCustomThumbnail", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
itemId: "M3QSGJNQTC2DG",
filePath: "C:\\Users\\User\\thumbnails\\custom.png"
})
}).then(r => r.json());
This operation is asynchronous. The API waits up to 10 seconds for the thumbnail to be generated before responding.
* * *
POST /api/v2/item/refreshThumbnail[](https://developer.eagle.cool/web-api/api/item#refresh-thumbnail)
------------------------------------------------------------------------------------------------------
Regenerate the thumbnail for an item, updating file size, dimensions, and color palette.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-5)
* `itemId` string (required) — The item ID
### Example[](https://developer.eagle.cool/web-api/api/item#example-2)
Copy
await fetch("http://localhost:41595/api/v2/item/refreshThumbnail", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ itemId: "M3QSGJNQTC2DG" })
}).then(r => r.json());
* * *
GET /api/v2/item/getComments[](https://developer.eagle.cool/web-api/api/item#get-comments)
-------------------------------------------------------------------------------------------
Get all comments (annotations) for an item. Returns image rect comments or video timestamp comments.
**Version Requirement:** This endpoint requires **Eagle 4.0 Build 22** or later.
### Query Parameters[](https://developer.eagle.cool/web-api/api/item#query-parameters-1)
* `id` string (required) — The item ID
### Response[](https://developer.eagle.cool/web-api/api/item#response-4)
Copy
{
"status": "success",
"data": [\
{\
"id": "MN3DZC0R7XYSZ",\
"x": 324,\
"y": 810,\
"width": 194,\
"height": 208,\
"annotation": "Face area",\
"lastModified": 1774282485915\
}\
]
}
### Example[](https://developer.eagle.cool/web-api/api/item#example-3)
Copy
await fetch("http://localhost:41595/api/v2/item/getComments?id=M3QSGJNQTC2DG")
.then(r => r.json());
* * *
POST /api/v2/item/addComment[](https://developer.eagle.cool/web-api/api/item#add-comment)
------------------------------------------------------------------------------------------
Add a comment to an item. Supports two types:
* **Image rect comment** — provide `x`, `y`, `width`, `height` to mark a region on the image
* **Video timestamp comment** — provide `duration` to mark a point on the video timeline
The server automatically generates `id` and `lastModified` fields.
**Version Requirement:** This endpoint requires **Eagle 4.0 Build 22** or later.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-6)
* `id` string (required) — The item ID
* `annotation` string (optional) — Comment text
* `x` number (optional) — Rect X position (image comment)
* `y` number (optional) — Rect Y position (image comment)
* `width` number (optional) — Rect width, must > 0 (image comment)
* `height` number (optional) — Rect height, must > 0 (image comment)
* `duration` number (optional) — Video timestamp in seconds, must >= 0 (video comment)
You must provide either `duration` (video) or all of `x`/`y`/`width`/`height` (image). Providing both or neither will return an error.
### Example[](https://developer.eagle.cool/web-api/api/item#example-4)
Copy
// Add an image rect comment
await fetch("http://localhost:41595/api/v2/item/addComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
x: 350, y: 480, width: 380, height: 400,
annotation: "White fluffy toy face"
})
}).then(r => r.json());
// Add a video timestamp comment
await fetch("http://localhost:41595/api/v2/item/addComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "VIDEO_ITEM_ID",
duration: 65.5,
annotation: "Important scene"
})
}).then(r => r.json());
* * *
POST /api/v2/item/updateComment[](https://developer.eagle.cool/web-api/api/item#update-comment)
------------------------------------------------------------------------------------------------
Update an existing comment. Only the provided fields are updated; `lastModified` is refreshed automatically.
**Version Requirement:** This endpoint requires **Eagle 4.0 Build 22** or later.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-7)
* `id` string (required) — The item ID
* `commentId` string (required) — The comment ID to update
* `annotation` string (optional) — New comment text
* `x` number (optional) — New X position (image comment only)
* `y` number (optional) — New Y position (image comment only)
* `width` number (optional) — New width, must > 0 (image comment only)
* `height` number (optional) — New height, must > 0 (image comment only)
* `duration` number (optional) — New timestamp, must >= 0 (video comment only)
Image comments can only update `x`/`y`/`width`/`height`. Video comments can only update `duration`. Cross-type updates will return an error.
### Example[](https://developer.eagle.cool/web-api/api/item#example-5)
Copy
await fetch("http://localhost:41595/api/v2/item/updateComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
commentId: "MN3DZC0R7XYSZ",
annotation: "Updated annotation text"
})
}).then(r => r.json());
* * *
POST /api/v2/item/removeComment[](https://developer.eagle.cool/web-api/api/item#remove-comment)
------------------------------------------------------------------------------------------------
Remove a comment from an item.
**Version Requirement:** This endpoint requires **Eagle 4.0 Build 22** or later.
### Request Body[](https://developer.eagle.cool/web-api/api/item#request-body-8)
* `id` string (required) — The item ID
* `commentId` string (required) — The comment ID to remove
### Example[](https://developer.eagle.cool/web-api/api/item#example-6)
Copy
await fetch("http://localhost:41595/api/v2/item/removeComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
commentId: "MN3DZC0R7XYSZ"
})
}).then(r => r.json());
* * *
Item Properties[](https://developer.eagle.cool/web-api/api/item#properties)
----------------------------------------------------------------------------
Items returned by the API contain the following properties:
Property
Type
Description
`id`
string
Unique item ID
`name`
string
Item name
`ext`
string
File extension
`width`
integer
Image width in pixels
`height`
integer
Image height in pixels
`url`
string
Source URL
`isDeleted`
boolean
Whether the item is in trash
`annotation`
string
Item annotation/notes
`tags`
string\[\]
Array of tag names
`folders`
string\[\]
Array of folder IDs
`palettes`
Object\[\]
Color palette information
`size`
integer
File size in bytes
`star`
integer
Rating (0–5)
`modificationTime`
integer
Last modification timestamp
`noThumbnail`
boolean
Whether the file has no thumbnail
`noPreview`
boolean
Whether double-click preview is disabled
[PreviousAPI Playground](https://developer.eagle.cool/web-api/get-started/playground)
[NextFolder](https://developer.eagle.cool/web-api/api/folder)
Last updated 7 months ago
---
# Tag Group | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/tag-group.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/tag-group#endpoints-overview)
--------------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/tagGroup/get`
List all tag groups
POST
`/api/v2/tagGroup/create`
Create a new tag group
POST
`/api/v2/tagGroup/update`
Update a tag group
POST
`/api/v2/tagGroup/remove`
Delete a tag group
POST
`/api/v2/tagGroup/addTags`
Add tags to a group
POST
`/api/v2/tagGroup/removeTags`
Remove tags from a group
* * *
GET /api/v2/tagGroup/get[](https://developer.eagle.cool/web-api/api/tag-group#list)
------------------------------------------------------------------------------------
List all tag groups. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/tag-group#query-parameters)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"id": "TG_001",\
"name": "Design Styles",\
"color": "blue",\
"tags": ["flat", "material", "skeuomorphic"],\
"description": "Visual design styles"\
}\
],
"total": 5,
"offset": 0,
"limit": 50
}
}
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/get").then(r => r.json());
* * *
POST /api/v2/tagGroup/create[](https://developer.eagle.cool/web-api/api/tag-group#create)
------------------------------------------------------------------------------------------
Create a new tag group.
### Request Body[](https://developer.eagle.cool/web-api/api/tag-group#request-body)
* `name` string (required) — Group name
* `tags` string\[\] (required) — Array of tag names to include
* `color` string (optional) — Group color
* `description` string (optional) — Group description
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response-1)
Returns the newly created tag group object.
Copy
{
"status": "success",
"data": {
"id": "NEW_GROUP_ID",
"name": "Color Palette",
"color": "",
"tags": ["warm", "cool", "neutral"],
"description": "Tags for color palettes"
}
}
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example-1)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Color Palette",
tags: ["warm", "cool", "neutral"],
description: "Tags for color palettes"
})
}).then(r => r.json());
* * *
POST /api/v2/tagGroup/update[](https://developer.eagle.cool/web-api/api/tag-group#update)
------------------------------------------------------------------------------------------
Update an existing tag group.
### Request Body[](https://developer.eagle.cool/web-api/api/tag-group#request-body-1)
* `id` string (required) — The tag group ID to update
* `name` string (required) — Group name
* `tags` string\[\] (required) — Full array of tag names (replaces existing)
* `color` string (optional) — Group color
* `description` string (optional) — Group description
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response-2)
Returns the updated tag group object.
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example-2)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "TG_001",
name: "Updated Group Name",
tags: ["tag1", "tag2", "tag3"],
color: "green"
})
}).then(r => r.json());
* * *
POST /api/v2/tagGroup/remove[](https://developer.eagle.cool/web-api/api/tag-group#remove)
------------------------------------------------------------------------------------------
Delete a tag group. This only removes the group — the tags themselves are not deleted.
### Request Body[](https://developer.eagle.cool/web-api/api/tag-group#request-body-2)
* `id` string (required) — The tag group ID to delete
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response-3)
Copy
{
"status": "success",
"data": true
}
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example-3)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/remove", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: "TG_001" })
}).then(r => r.json());
* * *
POST /api/v2/tagGroup/addTags[](https://developer.eagle.cool/web-api/api/tag-group#add-tags)
---------------------------------------------------------------------------------------------
Add tags to an existing tag group.
### Request Body[](https://developer.eagle.cool/web-api/api/tag-group#request-body-3)
* `groupId` string (required) — The tag group ID
* `tags` string\[\] (required) — Tag names to add
* `removeFromSource` boolean (optional) — If `true`, removes the tags from their current groups before adding to this one
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response-4)
Returns the updated tag group object.
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example-4)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/addTags", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
groupId: "TG_001",
tags: ["minimalist", "modern"]
})
}).then(r => r.json());
* * *
POST /api/v2/tagGroup/removeTags[](https://developer.eagle.cool/web-api/api/tag-group#remove-tags)
---------------------------------------------------------------------------------------------------
Remove tags from a tag group. The tags themselves are not deleted, only removed from the group.
### Request Body[](https://developer.eagle.cool/web-api/api/tag-group#request-body-4)
* `groupId` string (required) — The tag group ID
* `tags` string\[\] (required) — Tag names to remove from the group
### Response[](https://developer.eagle.cool/web-api/api/tag-group#response-5)
Returns the updated tag group object.
### Example[](https://developer.eagle.cool/web-api/api/tag-group#example-5)
Copy
await fetch("http://localhost:41595/api/v2/tagGroup/removeTags", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
groupId: "TG_001",
tags: ["outdated-tag"]
})
}).then(r => r.json());
* * *
Tag Group Properties[](https://developer.eagle.cool/web-api/api/tag-group#properties)
--------------------------------------------------------------------------------------
Tag groups returned by the API contain the following properties:
Property
Type
Description
`id`
string
Unique tag group ID
`name`
string
Group name
`color`
string
Group color
`tags`
string\[\]
Array of tag names in group
`description`
string
Group description
[PreviousTag](https://developer.eagle.cool/web-api/api/tag)
[NextLibrary](https://developer.eagle.cool/web-api/api/library)
Last updated 7 months ago
---
# AI Search | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/ai-search.md)
.
**Requires** [**AI Search**](https://eagle.cool/support/article/ai-search)
**Plugin.** The AI Search features require the Eagle AI Search plugin to be installed and running. Use the status endpoints to check availability before performing searches.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/ai-search#endpoints-overview)
--------------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/aiSearch/isInstalled`
Check if AI Search is installed
GET
`/api/v2/aiSearch/isReady`
Check if AI Search is ready
GET
`/api/v2/aiSearch/isStarting`
Check if AI Search is starting up
GET
`/api/v2/aiSearch/isSyncing`
Check if AI Search is syncing data
GET
`/api/v2/aiSearch/getSyncStatus`
Get detailed sync status
GET
`/api/v2/aiSearch/checkServiceHealth`
Check service health
POST
`/api/v2/aiSearch/searchByText`
Search by text description
POST
`/api/v2/aiSearch/searchByBase64`
Search by image (Base64)
POST
`/api/v2/aiSearch/searchByItemId`
Find similar items by item ID
* * *
Status Endpoints[](https://developer.eagle.cool/web-api/api/ai-search#status-endpoints)
----------------------------------------------------------------------------------------
### GET /api/v2/aiSearch/isInstalled[](https://developer.eagle.cool/web-api/api/ai-search#is-installed)
Check whether the AI Search plugin is installed.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/isInstalled").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": true
}
* * *
### GET /api/v2/aiSearch/isReady[](https://developer.eagle.cool/web-api/api/ai-search#is-ready)
Check whether AI Search is fully initialized and ready to accept search queries.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/isReady").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": true
}
* * *
### GET /api/v2/aiSearch/isStarting[](https://developer.eagle.cool/web-api/api/ai-search#is-starting)
Check whether the AI Search service is currently starting up.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/isStarting").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": false
}
* * *
### GET /api/v2/aiSearch/isSyncing[](https://developer.eagle.cool/web-api/api/ai-search#is-syncing)
Check whether AI Search is currently syncing (indexing) library data.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/isSyncing").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": false
}
* * *
### GET /api/v2/aiSearch/getSyncStatus[](https://developer.eagle.cool/web-api/api/ai-search#sync-status)
Get detailed synchronization status, including progress information.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/getSyncStatus").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": {
"isSyncing": false,
"syncedCount": 12500,
"totalCount": 12500,
"progress": 1.0
}
}
* * *
### GET /api/v2/aiSearch/checkServiceHealth[](https://developer.eagle.cool/web-api/api/ai-search#health)
Perform a health check on the AI Search service.
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/checkServiceHealth").then(r => r.json());
**Response:**
Copy
{
"status": "success",
"data": {
"healthy": true
}
}
* * *
Search Endpoints[](https://developer.eagle.cool/web-api/api/ai-search#search-endpoints)
----------------------------------------------------------------------------------------
### POST /api/v2/aiSearch/searchByText[](https://developer.eagle.cool/web-api/api/ai-search#search-by-text)
Search for items using a natural language text description. The AI model finds visually or semantically matching items.
#### Request Body[](https://developer.eagle.cool/web-api/api/ai-search#request-body)
* `query` string (required) — Text description to search for
* `options` Object (optional)
* `limit` integer — Maximum number of results (default varies by AI Search config)
#### Response[](https://developer.eagle.cool/web-api/api/ai-search#response)
Copy
{
"status": "success",
"data": {
"results": [\
{\
"item": {\
"id": "M3QSGJNQTC2DG",\
"name": "sunset-beach",\
"ext": "jpg",\
"width": 1920,\
"height": 1080,\
"tags": ["nature", "sunset"],\
"star": 4\
},\
"score": 0.892\
},\
{\
"item": {\
"id": "K7XPWQBN9TC3F",\
"name": "golden-hour",\
"ext": "png",\
"width": 2560,\
"height": 1440,\
"tags": ["photography"],\
"star": 3\
},\
"score": 0.756\
}\
]
}
}
#### Examples[](https://developer.eagle.cool/web-api/api/ai-search#examples)
Copy
// Search by text description
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "an orange cat sitting on a windowsill" })
}).then(r => r.json());
// Search with result limit
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: "minimalist logo design",
options: { limit: 20 }
})
}).then(r => r.json());
* * *
### POST /api/v2/aiSearch/searchByBase64[](https://developer.eagle.cool/web-api/api/ai-search#search-by-image)
Find visually similar items by providing a Base64-encoded image.
#### Request Body[](https://developer.eagle.cool/web-api/api/ai-search#request-body-1)
* `base64` string (required) — Base64-encoded image data
* `options` Object (optional)
* `limit` integer — Maximum number of results
#### Response[](https://developer.eagle.cool/web-api/api/ai-search#response-1)
Same format as `searchByText` — returns an array of `{ item, score }` results sorted by similarity.
#### Example[](https://developer.eagle.cool/web-api/api/ai-search#example)
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/searchByBase64", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
base64: "/9j/4AAQSkZJRg...",
options: { limit: 10 }
})
}).then(r => r.json());
* * *
### POST /api/v2/aiSearch/searchByItemId[](https://developer.eagle.cool/web-api/api/ai-search#search-by-item)
Find items visually similar to an existing item in the library.
#### Request Body[](https://developer.eagle.cool/web-api/api/ai-search#request-body-2)
* `itemId` string (required) — The item ID to find similar items for
* `options` Object (optional)
* `limit` integer — Maximum number of results
#### Response[](https://developer.eagle.cool/web-api/api/ai-search#response-2)
Same format as `searchByText` — returns an array of `{ item, score }` results sorted by similarity.
#### Example[](https://developer.eagle.cool/web-api/api/ai-search#example-1)
Copy
await fetch("http://localhost:41595/api/v2/aiSearch/searchByItemId", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
itemId: "M3QSGJNQTC2DG",
options: { limit: 10 }
})
}).then(r => r.json());
* * *
Recommended Workflow[](https://developer.eagle.cool/web-api/api/ai-search#recommended-workflow)
------------------------------------------------------------------------------------------------
1. **Check availability** — Call `isInstalled` and `isReady` before searching
2. **Wait if starting** — If `isStarting` returns `true`, poll until `isReady` becomes `true`
3. **Check sync status** — Use `getSyncStatus` to verify the index is up to date
4. **Search** — Use `searchByText` for description-based search, `searchByBase64` for reverse image search, or `searchByItemId` to find similar items
Copy
// Step 1: Verify AI Search is ready
const { data: isReady } = await fetch("http://localhost:41595/api/v2/aiSearch/isReady")
.then(r => r.json());
if (isReady) {
// Step 2: Perform search
const results = await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset landscape", options: { limit: 10 } })
}).then(r => r.json());
console.log(results.data.results);
}
[PreviousApp](https://developer.eagle.cool/web-api/api/app)
[NextChangelog](https://developer.eagle.cool/web-api/changelog)
Last updated 7 months ago
---
# Library | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/library.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/library#endpoints-overview)
------------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/library/info`
Get library metadata
GET
`/api/v2/library/history`
Get library history list
POST
`/api/v2/library/switch`
Switch to a library
GET
`/api/v2/library/icon`
Get library icon
* * *
GET /api/v2/library/info[](https://developer.eagle.cool/web-api/api/library#info)
----------------------------------------------------------------------------------
Returns metadata about the currently open Eagle library, including its name, path, and configuration.
### Response[](https://developer.eagle.cool/web-api/api/library#response)
Copy
{
"status": "success",
"data": {
"name": "My Design Library",
"path": "D:\\Eagle Libraries\\My Design Library.library",
"modificationTime": 1700000000000,
"applicationVersion": "4.0",
"folders": [],
"smartFolders": [],
"quickAccess": [],
"tagGroups": []
}
}
### Example[](https://developer.eagle.cool/web-api/api/library#example)
Copy
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
* * *
GET /api/v2/library/history[](https://developer.eagle.cool/web-api/api/library#history)
----------------------------------------------------------------------------------------
Get the list of recently opened libraries. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/library#query-parameters)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/library#response-1)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"name": "My Design Library",\
"path": "D:\\Eagle Libraries\\My Design Library.library"\
}\
],
"total": 3,
"offset": 0,
"limit": 50
}
}
### Examples[](https://developer.eagle.cool/web-api/api/library#examples)
Copy
await fetch("http://localhost:41595/api/v2/library/history").then(r => r.json());
// With pagination
await fetch("http://localhost:41595/api/v2/library/history?offset=0&limit=10").then(r => r.json());
* * *
POST /api/v2/library/switch[](https://developer.eagle.cool/web-api/api/library#switch)
---------------------------------------------------------------------------------------
Switch to a specified library.
### Request Body[](https://developer.eagle.cool/web-api/api/library#request-body)
* `libraryPath` string (required) — Path to the library to switch to
### Response[](https://developer.eagle.cool/web-api/api/library#response-2)
Copy
{
"status": "success",
"data": true
}
### Example[](https://developer.eagle.cool/web-api/api/library#example-1)
Copy
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[](https://developer.eagle.cool/web-api/api/library#icon)
----------------------------------------------------------------------------------
Get the icon for a library.
### Query Parameters[](https://developer.eagle.cool/web-api/api/library#query-parameters-1)
* `libraryPath` string (required) — Path to the library
### Response[](https://developer.eagle.cool/web-api/api/library#response-3)
Returns the icon image data.
### Example[](https://developer.eagle.cool/web-api/api/library#example-2)
Copy
await fetch("http://localhost:41595/api/v2/library/icon?libraryPath=D%3A%5CEagle%20Libraries%5CMy%20Design%20Library.library")
.then(r => r.blob());
* * *
Library Properties[](https://developer.eagle.cool/web-api/api/library#properties)
----------------------------------------------------------------------------------
The library object contains the following properties:
Property
Type
Description
`name`
string
Library display name
`path`
string
Full path to the `.library` directory
`modificationTime`
integer
Last modification timestamp
`applicationVersion`
string
Eagle version that created this library
`folders`
Object\[\]
Top-level folder structure
`smartFolders`
Object\[\]
Smart folder configurations
`quickAccess`
Object\[\]
Quick access items
`tagGroups`
Object\[\]
Tag group definitions
[PreviousTag Group](https://developer.eagle.cool/web-api/api/tag-group)
[NextApp](https://developer.eagle.cool/web-api/api/app)
Last updated 7 months ago
---
# App | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/app.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/app#endpoints-overview)
--------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/app/info`
Get application info
* * *
GET /api/v2/app/info[](https://developer.eagle.cool/web-api/api/app#info)
--------------------------------------------------------------------------
Returns information about the running Eagle application, including version numbers and platform details.
### Response[](https://developer.eagle.cool/web-api/api/app#response)
Copy
{
"status": "success",
"data": {
"version": "4.0.0",
"prereleaseVersion": null,
"buildVersion": "build12",
"platform": "win32"
}
}
### Example[](https://developer.eagle.cool/web-api/api/app#example)
Copy
await fetch("http://localhost:41595/api/v2/app/info").then(r => r.json());
* * *
App Properties[](https://developer.eagle.cool/web-api/api/app#properties)
--------------------------------------------------------------------------
Property
Type
Description
`version`
string
Eagle version number (e.g., `"4.0.0"`)
`prereleaseVersion`
string | null
Pre-release version identifier, or `null` for stable
`buildVersion`
string | null
Build version identifier (e.g., `"build12"`)
`platform`
string
Operating system: `"win32"` (Windows) or `"darwin"` (macOS)
[PreviousLibrary](https://developer.eagle.cool/web-api/api/library)
[NextAI Search](https://developer.eagle.cool/web-api/api/ai-search)
Last updated 7 months ago
---
# Changelog | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/changelog.md)
.
Eagle Web API V2 changelog, documenting all notable changes.
Looking for the V1 API changelog? Visit the [legacy V1 API documentation](https://api.eagle.cool/)
.
* * *
Smart Folder API — Eagle 4.0 Build 22[](https://developer.eagle.cool/web-api/changelog#smart-folder-api-eagle-4.0-build-22)
----------------------------------------------------------------------------------------------------------------------------
**This feature is not yet released**: This feature requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
New Smart Folder CRUD endpoints and rule query functionality:
* `GET /api/v2/smartFolder/get` — List all smart folders
* `POST /api/v2/smartFolder/create` — Create a smart folder
* `POST /api/v2/smartFolder/update` — Update a smart folder
* `POST /api/v2/smartFolder/remove` — Delete a smart folder
* `GET /api/v2/smartFolder/getItems` — Get matching items
* `GET /api/v2/smartFolder/getRules` — Get available rule schema
### Item API Enhancement[](https://developer.eagle.cool/web-api/changelog#item-api-enhancement)
* `POST /api/v2/item/get` added `smartFolders` parameter, combinable with other filters
* * *
Comment API — Eagle 4.0 Build 22[](https://developer.eagle.cool/web-api/changelog#comment-api-eagle-4.0-build-22)
------------------------------------------------------------------------------------------------------------------
**This feature is not yet released**: This feature requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
New Comment CRUD endpoints for managing image rect annotations and video timeline notes:
* `GET /api/v2/item/getComments` — Get all comments for an item
* `POST /api/v2/item/addComment` — Add an image rect comment or video timestamp comment
* `POST /api/v2/item/updateComment` — Update an existing comment
* `POST /api/v2/item/removeComment` — Remove a comment
* * *
V2 API — Initial Release[](https://developer.eagle.cool/web-api/changelog#v2-api-initial-release)
--------------------------------------------------------------------------------------------------
The V2 API (`/api/v2/...`) is a comprehensive replacement for the V1 API, built on top of Eagle's Plugin API capabilities. Key features:
### New Capabilities (vs V1)[](https://developer.eagle.cool/web-api/changelog#new-capabilities-vs-v1)
* **Full-text search** — `POST /api/v2/item/query` with advanced query syntax (AND, OR, NOT, phrases)
* **AI semantic search** — Search by text description (`searchByText`), image similarity (`searchByBase64`, `searchByItemId`)
* **Tag management** — Create, rename, and merge tags; manage tag groups
* **Folder management** — Create, move, rename, and organize folders
* **Automatic pagination** — All list endpoints return paginated results by default (`offset` / `limit`)
* **Field selection** — Use the `fields` parameter on item list to return only needed data
### Endpoints[](https://developer.eagle.cool/web-api/changelog#endpoints)
Section
Endpoints
Item
`get`, `query`, `countAll`, `add`, `save`, `open`, `select`, `setCustomThumbnail`, `refreshThumbnail`, `getComments`, `addComment`, `updateComment`, `removeComment`
Folder
`get`, `create`, `open`, `save`
Tag
`get`, `getRecentTags`, `getStarredTags`, `save`, `merge`
Tag Group
`get`, `create`, `save`, `remove`, `addTags`, `removeTags`
Library
`info`
App
`info`
AI Search
`isInstalled`, `isReady`, `isStarting`, `isSyncing`, `getSyncStatus`, `checkServiceHealth`, `searchByText`, `searchByBase64`, `searchByItemId`
### Pagination[](https://developer.eagle.cool/web-api/changelog#pagination)
All list endpoints use automatic pagination:
* Default limit: `50`
* Maximum limit: `1000`
* Response includes `total`, `offset`, and `limit` metadata
[PreviousAI Search](https://developer.eagle.cool/web-api/api/ai-search)
Last updated 7 months ago
---
# Tag | Web API
For the complete documentation index, see [llms.txt](https://developer.eagle.cool/web-api/llms.txt)
. This page is also available as [Markdown](https://developer.eagle.cool/web-api/api/tag.md)
.
Endpoints Overview[](https://developer.eagle.cool/web-api/api/tag#endpoints-overview)
--------------------------------------------------------------------------------------
Method
Endpoint
Description
GET
`/api/v2/tag/get`
List all tags
POST
`/api/v2/tag/get`
List tags (body)
GET
`/api/v2/tag/getRecentTags`
Get recently used tags
GET
`/api/v2/tag/getStarredTags`
Get starred tags
POST
`/api/v2/tag/update`
Rename a tag
POST
`/api/v2/tag/merge`
Merge two tags
* * *
GET /api/v2/tag/get[](https://developer.eagle.cool/web-api/api/tag#list)
-------------------------------------------------------------------------
List all tags in the library. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/tag#query-parameters)
* `name` string (optional) — Filter tags by name (substring match)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/tag#response)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"name": "design",\
"count": 150,\
"color": "",\
"groups": ["GROUP_ID_1"],\
"pinyin": "design"\
},\
{\
"name": "photography",\
"count": 89,\
"color": "",\
"groups": [],\
"pinyin": "photography"\
}\
],
"total": 340,
"offset": 0,
"limit": 50
}
}
### Examples[](https://developer.eagle.cool/web-api/api/tag#examples)
Copy
// List all tags (first 50)
await fetch("http://localhost:41595/api/v2/tag/get").then(r => r.json());
// Filter tags by name
await fetch("http://localhost:41595/api/v2/tag/get?name=design").then(r => r.json());
// Paginate through tags
await fetch("http://localhost:41595/api/v2/tag/get?offset=50&limit=100").then(r => r.json());
* * *
POST /api/v2/tag/get[](https://developer.eagle.cool/web-api/api/tag#list-post)
-------------------------------------------------------------------------------
Same as GET, but accepts filter parameters in the JSON body.
### Request Body[](https://developer.eagle.cool/web-api/api/tag#request-body)
* `name` string (optional) — Filter tags by name (substring match)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Example[](https://developer.eagle.cool/web-api/api/tag#example)
Copy
await fetch("http://localhost:41595/api/v2/tag/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "design", limit: 100 })
}).then(r => r.json());
* * *
GET /api/v2/tag/getRecentTags[](https://developer.eagle.cool/web-api/api/tag#recent)
-------------------------------------------------------------------------------------
Get recently used tags. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/tag#query-parameters-1)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/tag#response-1)
Copy
{
"status": "success",
"data": {
"data": [\
{\
"name": "ui-design",\
"count": 45,\
"color": "",\
"groups": [],\
"pinyin": "ui-design"\
}\
],
"total": 12,
"offset": 0,
"limit": 50
}
}
### Example[](https://developer.eagle.cool/web-api/api/tag#example-1)
Copy
await fetch("http://localhost:41595/api/v2/tag/getRecentTags").then(r => r.json());
* * *
GET /api/v2/tag/getStarredTags[](https://developer.eagle.cool/web-api/api/tag#starred)
---------------------------------------------------------------------------------------
Get starred (pinned) tags. Returns paginated results.
### Query Parameters[](https://developer.eagle.cool/web-api/api/tag#query-parameters-2)
* `offset` integer (optional) — Pagination offset, default `0`
* `limit` integer (optional) — Pagination limit, default `50`, max `1000`
### Response[](https://developer.eagle.cool/web-api/api/tag#response-2)
Same format as `/api/v2/tag/getRecentTags`.
### Example[](https://developer.eagle.cool/web-api/api/tag#example-2)
Copy
await fetch("http://localhost:41595/api/v2/tag/getStarredTags").then(r => r.json());
* * *
POST /api/v2/tag/update[](https://developer.eagle.cool/web-api/api/tag#update)
-------------------------------------------------------------------------------
Rename an existing tag. All items using this tag will be updated automatically.
### Request Body[](https://developer.eagle.cool/web-api/api/tag#request-body-1)
* `originalName` string (required) — The current tag name
* `name` string (required) — The new tag name
### Response[](https://developer.eagle.cool/web-api/api/tag#response-3)
Returns the updated tag object.
Copy
{
"status": "success",
"data": {
"name": "new-tag-name",
"count": 45,
"color": "",
"groups": [],
"pinyin": "new-tag-name"
}
}
### Example[](https://developer.eagle.cool/web-api/api/tag#example-3)
Copy
await fetch("http://localhost:41595/api/v2/tag/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
originalName: "old-tag-name",
name: "new-tag-name"
})
}).then(r => r.json());
* * *
POST /api/v2/tag/merge[](https://developer.eagle.cool/web-api/api/tag#merge)
-----------------------------------------------------------------------------
Merge a source tag into a target tag. All items with the source tag will have it replaced by the target tag. The source tag is removed after merging.
### Request Body[](https://developer.eagle.cool/web-api/api/tag#request-body-2)
* `source` string (required) — The tag name to merge from (will be removed)
* `target` string (required) — The tag name to merge into (will be kept)
### Response[](https://developer.eagle.cool/web-api/api/tag#response-4)
Copy
{
"status": "success",
"data": {
"affectedItems": 25,
"sourceRemoved": true
}
}
### Example[](https://developer.eagle.cool/web-api/api/tag#example-4)
Copy
// Merge "photograph" into "photography"
await fetch("http://localhost:41595/api/v2/tag/merge", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
source: "photograph",
target: "photography"
})
}).then(r => r.json());
* * *
Tag Properties[](https://developer.eagle.cool/web-api/api/tag#properties)
--------------------------------------------------------------------------
Tags returned by the API contain the following properties:
Property
Type
Description
`name`
string
Tag name
`count`
integer
Number of items using this tag
`color`
string
Tag color (empty string if unset)
`groups`
string\[\]
Array of tag group IDs
`pinyin`
string
Pinyin representation of the name
[PreviousSmart Folder](https://developer.eagle.cool/web-api/api/smart-folder)
[NextTag Group](https://developer.eagle.cool/web-api/api/tag-group)
Last updated 7 months ago
---
# Unknown
\# Web API
## English
- \[Introduction\](https://developer.eagle.cool/web-api/get-started/readme.md): Eagle Web API V2 provides a comprehensive RESTful HTTP API for interacting with the Eagle application, enabling external tools and scripts to manage your asset library programmatically.
- \[API Playground\](https://developer.eagle.cool/web-api/get-started/playground.md)
- \[Item\](https://developer.eagle.cool/web-api/api/item.md): The Item API allows you to query, add, modify, and manage items in the Eagle library.
- \[Folder\](https://developer.eagle.cool/web-api/api/folder.md): The Folder API allows you to list, create, and manage folders in the Eagle library.
- \[Smart Folder\](https://developer.eagle.cool/web-api/api/smart-folder.md): Smart Folder API allows you to list, create, update, delete smart folders, and query matching items.
- \[Tag\](https://developer.eagle.cool/web-api/api/tag.md): The Tag API allows you to list, rename, and merge tags in the Eagle library.
- \[Tag Group\](https://developer.eagle.cool/web-api/api/tag-group.md): The Tag Group API allows you to create, manage, and organize tag groups in the Eagle library.
- \[Library\](https://developer.eagle.cool/web-api/api/library.md): The Library API allows you to get information about the currently open Eagle library.
- \[App\](https://developer.eagle.cool/web-api/api/app.md): The App API provides information about the running Eagle application instance.
- \[AI Search\](https://developer.eagle.cool/web-api/api/ai-search.md): The AI Search API provides semantic search capabilities — search by text description or find visually similar images.
- \[Changelog\](https://developer.eagle.cool/web-api/changelog.md)
## 简体中文
- \[简介\](https://developer.eagle.cool/web-api/zh-cn/get-started/readme.md): Eagle Web API V2 提供了一套完整的 RESTful HTTP API,用于与 Eagle 应用程序交互,让外部工具和脚本能够以编程方式管理你的素材库。
- \[API Playground\](https://developer.eagle.cool/web-api/zh-cn/get-started/playground.md)
- \[Item\](https://developer.eagle.cool/web-api/zh-cn/api/item.md): Item API 允许你查询、添加、修改和管理 Eagle 资源库中的条目。
- \[Folder\](https://developer.eagle.cool/web-api/zh-cn/api/folder.md): Folder API 允许你列出、创建和管理 Eagle 资源库中的文件夹。
- \[Smart Folder\](https://developer.eagle.cool/web-api/zh-cn/api/smart-folder.md): Smart Folder API 允许您列出、创建、更新、删除智能文件夹,并查询符合条件的条目。
- \[Tag\](https://developer.eagle.cool/web-api/zh-cn/api/tag.md): Tag API 允许你列出、重命名和合并 Eagle 资源库中的标签。
- \[Tag Group\](https://developer.eagle.cool/web-api/zh-cn/api/tag-group.md): Tag Group API 允许你创建、管理和组织 Eagle 资源库中的标签组。
- \[Library\](https://developer.eagle.cool/web-api/zh-cn/api/library.md): Library API 允许你获取当前打开的 Eagle 资源库的相关信息。
- \[App\](https://developer.eagle.cool/web-api/zh-cn/api/app.md): App API 提供正在运行的 Eagle 应用程序实例的相关信息。
- \[AI Search\](https://developer.eagle.cool/web-api/zh-cn/api/ai-search.md): AI Search API 提供语义搜索功能 — 通过文字描述搜索或查找视觉相似的图片。
- \[更新日志\](https://developer.eagle.cool/web-api/zh-cn/changelog.md)
## 繁體中文
- \[簡介\](https://developer.eagle.cool/web-api/zh-tw/get-started/readme.md): Eagle Web API V2 提供了完整的 RESTful HTTP API,用於與 Eagle 應用程式互動,讓外部工具和腳本能夠以程式化方式管理您的素材庫。
- \[API Playground\](https://developer.eagle.cool/web-api/zh-tw/get-started/playground.md)
- \[Item\](https://developer.eagle.cool/web-api/zh-tw/api/item.md): Item API 允許您查詢、新增、修改及管理 Eagle 資源庫中的項目。
- \[Folder\](https://developer.eagle.cool/web-api/zh-tw/api/folder.md): Folder API 允許您列出、建立及管理 Eagle 資源庫中的資料夾。
- \[Smart Folder\](https://developer.eagle.cool/web-api/zh-tw/api/smart-folder.md): Smart Folder API 允許您列出、建立、更新、刪除智慧型資料夾,並查詢符合條件的項目。
- \[Tag\](https://developer.eagle.cool/web-api/zh-tw/api/tag.md): Tag API 允許您列出、重新命名及合併 Eagle 資源庫中的標籤。
- \[Tag Group\](https://developer.eagle.cool/web-api/zh-tw/api/tag-group.md): Tag Group API 允許您建立、管理及整理 Eagle 資源庫中的標籤群組。
- \[Library\](https://developer.eagle.cool/web-api/zh-tw/api/library.md): Library API 允許您取得目前開啟的 Eagle 資源庫相關資訊。
- \[App\](https://developer.eagle.cool/web-api/zh-tw/api/app.md): App API 提供正在執行的 Eagle 應用程式實例的相關資訊。
- \[AI Search\](https://developer.eagle.cool/web-api/zh-tw/api/ai-search.md): AI Search API 提供語義搜尋功能 — 透過文字描述搜尋或尋找視覺上相似的圖片。
- \[更新日誌\](https://developer.eagle.cool/web-api/zh-tw/changelog.md)
## 日本語
- \[イントロダクション\](https://developer.eagle.cool/web-api/ja-jp/get-started/readme.md): Eagle Web API V2 は、Eagle アプリケーションと連携するための包括的な RESTful HTTP API を提供し、 外部ツールやスクリプトからアセットライブラリをプログラムで管理できるようにします。
- \[API Playground\](https://developer.eagle.cool/web-api/ja-jp/get-started/playground.md)
- \[Item\](https://developer.eagle.cool/web-api/ja-jp/api/item.md): Item API を使用すると、Eagle ライブラリ内のアイテムの検索、追加、変更、管理を行うことができます。
- \[Folder\](https://developer.eagle.cool/web-api/ja-jp/api/folder.md): Folder API を使用すると、Eagle ライブラリ内のフォルダの一覧表示、作成、管理を行うことができます。
- \[Smart Folder\](https://developer.eagle.cool/web-api/ja-jp/api/smart-folder.md): Smart Folder API を使用すると、スマートフォルダの一覧表示、作成、更新、削除、および条件に一致するアイテムの取得ができます。
- \[Tag\](https://developer.eagle.cool/web-api/ja-jp/api/tag.md): Tag API を使用すると、Eagle ライブラリ内のタグの一覧表示、名前変更、統合を行うことができます。
- \[Tag Group\](https://developer.eagle.cool/web-api/ja-jp/api/tag-group.md): Tag Group API を使用すると、Eagle ライブラリ内のタググループの作成、管理、整理を行うことができます。
- \[Library\](https://developer.eagle.cool/web-api/ja-jp/api/library.md): Library API を使用すると、現在開いている Eagle ライブラリの情報を取得できます。
- \[App\](https://developer.eagle.cool/web-api/ja-jp/api/app.md): App API は、実行中の Eagle アプリケーションインスタンスの情報を提供します。
- \[AI Search\](https://developer.eagle.cool/web-api/ja-jp/api/ai-search.md): AI Search API は、セマンティック検索機能を提供します。テキスト説明による検索や、視覚的に類似した画像の検索が可能です。
- \[変更履歴\](https://developer.eagle.cool/web-api/ja-jp/changelog.md)
---
# Unknown
\> 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/get-started/readme.md).
# Introduction
Eagle Web API V2 provides a comprehensive RESTful HTTP API for interacting with the Eagle application, enabling external tools and scripts to manage your asset library programmatically.
Welcome to the \*\*Eagle Web API V2\*\* documentation. This API allows any HTTP client — scripts, apps, browser extensions, automation tools — to interact with the Eagle application over a local HTTP server.
{% hint style="info" %}
\*\*Looking for the V1 API?\*\* The legacy V1 API documentation is available at . V2 offers a more comprehensive feature set based on the Plugin API capabilities.
{% endhint %}
{% hint style="warning" %}
\*\*Version Requirement:\*\* The V2 Web API requires \*\*Eagle 4.0 Build 21\*\* or later.
{% endhint %}
\*\*\*
## Web API vs Plugin API
Eagle provides two different APIs for developers:
\* \*\*Web API\*\* (this documentation) — A RESTful HTTP API for building \*\*external\*\* tools, services, scripts, or integrations that communicate with Eagle from outside the application. Use this if you are building browser extensions, automation workflows, third-party apps, or any tool that runs independently of Eagle.
\* \[\*\*Plugin API\*\*\](https://developer.eagle.cool/plugin-api) — A JavaScript API for building plugins that run \*\*inside\*\* Eagle. Plugins have direct access to Eagle's UI, can create custom panels, respond to user interactions, and deeply integrate with the application. Use this if you want to extend Eagle's built-in functionality.
| | Web API | Plugin API |
| ------------- | ----------------------------------- | -------------------------------------------------------------------------- |
| Runs | Outside Eagle (any HTTP client) | Inside Eagle (as a plugin) |
| Protocol | HTTP REST | JavaScript API |
| Use case | External tools, scripts, automation | Eagle plugins, custom panels, UI extensions |
| Documentation | This site | \[developer.eagle.cool/plugin-api\](https://developer.eagle.cool/plugin-api) |
\*\*\*
## What's New in V2
The V2 API (\`/api/v2/...\`) provides significantly more endpoints than V1 (\`/api/...\`), including:
\* \*\*Full-text search\*\* with advanced query syntax (AND, OR, NOT)
\* \*\*AI semantic search\*\* — search by text description or image similarity
\* \*\*Tag management\*\* — create, rename, merge tags and manage tag groups
\* \*\*Folder management\*\* — create, move, and organize folders
\* \*\*Automatic pagination\*\* — all list endpoints are paginated by default to ensure performance
\* \[\*\*API Playground\*\*\](/web-api/get-started/playground.md) — built-in interactive tool to test all endpoints directly in your browser
\*\*\*
## Prerequisites
Eagle is a local application — the API server starts automatically when the Eagle app is opened. \*\*You must have Eagle running\*\* before you can access any API endpoint.
\*\*\*
## Base URL
\`\`\`
http://localhost:41595/api/v2/
\`\`\`
The Eagle API server runs on port \*\*41595\*\* by default. All V2 endpoints are prefixed with \`/api/v2/\`.
\*\*\*
## Authentication
### Local Access (localhost)
If you are making requests from the same machine where Eagle is running, \*\*no authentication is required\*\*. Requests from \`localhost\`, \`127.0.0.1\`, or \`0.0.0.0\` are automatically trusted — you can start calling the API right away.
\`\`\`javascript
// Local access — no token needed
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
\`\`\`
### Remote Access (LAN / Network)
If you want to call the Eagle API from another device on your local network (e.g., a phone, tablet, or another computer), you must include an \*\*API Token\*\* with every request.
#### How to Get Your API Token
1. Open Eagle and go to \*\*Preferences\*\* (Settings)
2. Click on \*\*Developer\*\* in the left sidebar
3. Your \*\*API Token\*\* is displayed at the top of the page
4. Click the copy button next to the token to copy it to your clipboard
You can also click \*\*Regenerate Token\*\* to generate a new token at any time. Note that regenerating a token will invalidate the previous one.
#### Using the Token
Append the \`token\` parameter to any request URL:
\`\`\`javascript
// Remote access with token
const TOKEN = "f366c476-7533-4f33-b454-2bc720a1d0ea";
await fetch(\`http://192.168.1.100:41595/api/v2/library/info?token=${TOKEN}\`)
.then(r => r.json());
// Also works with POST requests
await fetch(\`http://192.168.1.100:41595/api/v2/item/get?token=${TOKEN}\`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ tags: \["design"\], limit: 20 })
}).then(r => r.json());
\`\`\`
{% hint style="warning" %}
\*\*Keep your token private.\*\* Anyone with your API Token can access and modify your Eagle library over the network. Do not share it publicly or commit it to version control.
{% endhint %}
\*\*\*
## Response Format
All endpoints return responses in \[JSend\](https://github.com/omniti-labs/jsend) format:
\*\*Success:\*\*
\`\`\`json
{
"status": "success",
"data": { ... }
}
\`\`\`
\*\*Error:\*\*
\`\`\`json
{
"status": "error",
"message": "Error description"
}
\`\`\`
\*\*\*
## Pagination
All list endpoints (\`item/get\`, \`item/query\`, \`folder/get\`, \`tag/get\`, etc.) return paginated results by default.
| Parameter | Type | Default | Max | Description |
| --------- | ------- | ------- | ------ | ------------------------- |
| \`offset\` | Integer | \`0\` | — | Number of items to skip |
| \`limit\` | Integer | \`50\` | \`1000\` | Number of items to return |
\*\*Paginated response:\*\*
\`\`\`json
{
"status": "success",
"data": {
"data": \[ ... \],
"total": 8500,
"offset": 100,
"limit": 50
}
}
\`\`\`
\* \`total\` — Total number of matching items (before pagination)
\* \`offset\` — The offset used
\* \`limit\` — The limit used
\* \`data\` — The paginated result array
\*\*Example: Iterating through all items\*\*
\`\`\`javascript
// Page 1: items 0-49
const page1 = await fetch("http://localhost:41595/api/v2/item/get?limit=50").then(r => r.json());
// Page 2: items 50-99
const page2 = await fetch("http://localhost:41595/api/v2/item/get?offset=50&limit=50").then(r => r.json());
// Continue until data.data.length < limit (last page)
\`\`\`
\*\*\*
## Quick Start
\`\`\`javascript
// Check if Eagle is running
await fetch("http://localhost:41595/api/v2/app/info").then(r => r.json());
// Get library info
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
// List first 50 items
await fetch("http://localhost:41595/api/v2/item/get").then(r => r.json());
// Search items by tag
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ tags: \["design"\] })
}).then(r => r.json());
// Full-text search
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset landscape" })
}).then(r => r.json());
// AI semantic search
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "an orange cat", options: { limit: 10 } })
}).then(r => r.json());
\`\`\`
\*\*\*
## API Sections
| Section | Description |
| -------------------------------------- | ------------------------------------ |
| \[Item\](/web-api/api/item.md) | Query, add, modify, and manage items |
| \[Folder\](/web-api/api/folder.md) | Create, list, and organize folders |
| \[Tag\](/web-api/api/tag.md) | List, rename, and merge tags |
| \[Tag Group\](/web-api/api/tag-group.md) | Manage tag groups |
| \[Library\](/web-api/api/library.md) | Get library metadata |
| \[App\](/web-api/api/app.md) | Application information |
| \[AI Search\](/web-api/api/ai-search.md) | AI semantic & image search |
\*\*\*
## CORS
If you are calling the Eagle API from a webpage (e.g., via a userscript manager like \*\*Tampermonkey\*\* or \*\*Violentmonkey\*\*), standard \`fetch\` requests may be blocked by the browser's Cross-Origin Resource Sharing (CORS) policy. In this case, use \`GM\_xmlhttpRequest\` instead:
\`\`\`javascript
GM\_xmlhttpRequest({
method: "GET",
url: "http://localhost:41595/api/v2/item/get",
onload: function (response) {
const data = JSON.parse(response.responseText);
console.log(data);
}
});
\`\`\`
{% hint style="info" %}
This only applies to scripts running inside web pages. If you are calling the API from Node.js, Electron, a browser extension's background script, or directly from DevTools, CORS does not apply and you can use \`fetch\` normally.
{% endhint %}
\*\*\*
## Rate Limits
There are \*\*no rate limits\*\* on API calls. Since the API server runs locally on your machine, all requests are processed directly without any throttling. However, keep in mind that the server's performance depends on your device's hardware — heavy operations on very large libraries may take longer to respond.
---
# Unknown
\> 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/get-started/playground.md).
# API Playground
Eagle includes a built-in interactive API playground that lets you test all API endpoints without writing any code. Open it in your browser:
\`\`\`
http://localhost:41595/api/v2/playground
\`\`\`
Key features of the playground:
\* \*\*Live testing\*\* — Send real API requests against your current Eagle library and see responses instantly
\* \*\*GUI parameter input\*\* — Select and fill in parameters through a visual form, no need to manually craft JSON
\* \*\*Code snippets\*\* — Each operation automatically generates a JavaScript \`fetch\` code snippet you can copy and use directly
\* \*\*Full endpoint list\*\* — The left sidebar lists all available API endpoints, organized by category
{% hint style="info" %}
The playground operates on your actual library data. Write operations (add, update, delete) will modify your data for real — use with care.
{% endhint %}
---
# Unknown
\> 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/api/folder.md).
# Folder
The Folder API allows you to list, create, and manage folders in the Eagle library.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ----------------------- | ------------------- |
| GET | \`/api/v2/folder/get\` | List all folders |
| POST | \`/api/v2/folder/get\` | List folders (body) |
| POST | \`/api/v2/folder/create\` | Create a new folder |
| POST | \`/api/v2/folder/update\` | Update a folder |
\*\*\*
## GET /api/v2/folder/get
List folders with optional filtering. Returns paginated results.
### Query Parameters
\* \`id\` string (optional) — Return a single folder by ID
\* \`ids\` string (optional) — Comma-separated folder IDs
\* \`isSelected\` boolean (optional) — Return the currently selected folder
\* \`isRecent\` boolean (optional) — Return recently used folders
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"id": "LRK3AQGN7VCB1",\
"name": "Design References",\
"description": "UI/UX design references",\
"children": \[\],\
"modificationTime": 1700000000000,\
"tags": \[\],\
"iconColor": "blue",\
"imageCount": 42\
}\
\],
"total": 25,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Examples
\`\`\`javascript
// List all folders (first 50)
await fetch("http://localhost:41595/api/v2/folder/get").then(r => r.json());
// Get a single folder by ID
await fetch("http://localhost:41595/api/v2/folder/get?id=LRK3AQGN7VCB1").then(r => r.json());
// Get recently used folders
await fetch("http://localhost:41595/api/v2/folder/get?isRecent=true").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/folder/get
Same as GET, but accepts filter parameters in the JSON body.
### Request Body
\* \`id\` string (optional) — Folder ID
\* \`ids\` string\\\[\] (optional) — Array of folder IDs
\* \`isSelected\` boolean (optional) — Currently selected folder
\* \`isRecent\` boolean (optional) — Recently used folders
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Example
\`\`\`javascript
// Get folders by multiple IDs
await fetch("http://localhost:41595/api/v2/folder/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: \["FOLDER\_ID\_1", "FOLDER\_ID\_2"\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/folder/create
Create a new folder in the library.
### Request Body
\* \`name\` string (required) — Folder name
\* \`description\` string (optional) — Folder description
\* \`parent\` string (optional) — Parent folder ID. If omitted, creates at root level.
### Response
Returns the newly created folder object.
\`\`\`json
{
"status": "success",
"data": {
"id": "NEW\_FOLDER\_ID",
"name": "My New Folder",
"description": "",
"children": \[\],
"modificationTime": 1700000000000,
"tags": \[\]
}
}
\`\`\`
### Examples
\`\`\`javascript
// Create a root-level folder
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "My New Folder" })
}).then(r => r.json());
// Create a subfolder
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Subfolder",
description: "A subfolder for organizing",
parent: "PARENT\_FOLDER\_ID"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/folder/update
Update an existing folder's metadata. Only the fields you include will be modified.
### Request Body
\* \`id\` string (required) — The folder ID to update
\*\*Modifiable fields:\*\*
\* \`name\` string (optional) — New folder name
\* \`description\` string (optional) — New description
\* \`tags\` string\\\[\] (optional) — Replace folder tags
\* \`iconColor\` string (optional) — Folder icon color. One of: \`red\`, \`orange\`, \`yellow\`, \`green\`, \`aqua\`, \`blue\`, \`purple\`, \`pink\`
\* \`parent\` string | null (optional) — Move folder to a new parent. Set to \`null\` to move to root.
### Response
Returns the updated folder object.
### Examples
\`\`\`javascript
// Rename a folder and set icon color
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
name: "Renamed Folder",
iconColor: "green"
})
}).then(r => r.json());
// Move folder to a different parent
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: "NEW\_PARENT\_ID"
})
}).then(r => r.json());
// Move folder to root level
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: null
})
}).then(r => r.json());
\`\`\`
\*\*\*
## Folder Properties
Folders returned by the API contain the following properties:
| Property | Type | Description |
| ------------------ | --------- | ------------------------------ |
| \`id\` | string | Unique folder ID |
| \`name\` | string | Folder name |
| \`description\` | string | Folder description |
| \`children\` | Object\\\[\] | Array of child folder objects |
| \`modificationTime\` | integer | Last modification timestamp |
| \`tags\` | string\\\[\] | Array of tag names |
| \`iconColor\` | string | Icon color name |
| \`imageCount\` | integer | Number of items in this folder |
---
# Unknown
\> 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/api/tag-group.md).
# Tag Group
The Tag Group API allows you to create, manage, and organize tag groups in the Eagle library.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ----------------------------- | ------------------------ |
| GET | \`/api/v2/tagGroup/get\` | List all tag groups |
| POST | \`/api/v2/tagGroup/create\` | Create a new tag group |
| POST | \`/api/v2/tagGroup/update\` | Update a tag group |
| POST | \`/api/v2/tagGroup/remove\` | Delete a tag group |
| POST | \`/api/v2/tagGroup/addTags\` | Add tags to a group |
| POST | \`/api/v2/tagGroup/removeTags\` | Remove tags from a group |
\*\*\*
## GET /api/v2/tagGroup/get
List all tag groups. Returns paginated results.
### Query Parameters
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"id": "TG\_001",\
"name": "Design Styles",\
"color": "blue",\
"tags": \["flat", "material", "skeuomorphic"\],\
"description": "Visual design styles"\
}\
\],
"total": 5,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/get").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tagGroup/create
Create a new tag group.
### Request Body
\* \`name\` string (required) — Group name
\* \`tags\` string\\\[\] (required) — Array of tag names to include
\* \`color\` string (optional) — Group color
\* \`description\` string (optional) — Group description
### Response
Returns the newly created tag group object.
\`\`\`json
{
"status": "success",
"data": {
"id": "NEW\_GROUP\_ID",
"name": "Color Palette",
"color": "",
"tags": \["warm", "cool", "neutral"\],
"description": "Tags for color palettes"
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Color Palette",
tags: \["warm", "cool", "neutral"\],
description: "Tags for color palettes"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tagGroup/update
Update an existing tag group.
### Request Body
\* \`id\` string (required) — The tag group ID to update
\* \`name\` string (required) — Group name
\* \`tags\` string\\\[\] (required) — Full array of tag names (replaces existing)
\* \`color\` string (optional) — Group color
\* \`description\` string (optional) — Group description
### Response
Returns the updated tag group object.
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "TG\_001",
name: "Updated Group Name",
tags: \["tag1", "tag2", "tag3"\],
color: "green"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tagGroup/remove
Delete a tag group. This only removes the group — the tags themselves are not deleted.
### Request Body
\* \`id\` string (required) — The tag group ID to delete
### Response
\`\`\`json
{
"status": "success",
"data": true
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/remove", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: "TG\_001" })
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tagGroup/addTags
Add tags to an existing tag group.
### Request Body
\* \`groupId\` string (required) — The tag group ID
\* \`tags\` string\\\[\] (required) — Tag names to add
\* \`removeFromSource\` boolean (optional) — If \`true\`, removes the tags from their current groups before adding to this one
### Response
Returns the updated tag group object.
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/addTags", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
groupId: "TG\_001",
tags: \["minimalist", "modern"\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tagGroup/removeTags
Remove tags from a tag group. The tags themselves are not deleted, only removed from the group.
### Request Body
\* \`groupId\` string (required) — The tag group ID
\* \`tags\` string\\\[\] (required) — Tag names to remove from the group
### Response
Returns the updated tag group object.
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tagGroup/removeTags", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
groupId: "TG\_001",
tags: \["outdated-tag"\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## Tag Group Properties
Tag groups returned by the API contain the following properties:
| Property | Type | Description |
| ------------- | --------- | --------------------------- |
| \`id\` | string | Unique tag group ID |
| \`name\` | string | Group name |
| \`color\` | string | Group color |
| \`tags\` | string\\\[\] | Array of tag names in group |
| \`description\` | string | Group description |
---
# Unknown
\> 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/api/item.md).
# Item
The Item API allows you to query, add, modify, and manage items in the Eagle library.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | --------------------------------- | ------------------------------ |
| GET | \`/api/v2/item/get\` | List items with filters |
| POST | \`/api/v2/item/get\` | List items with filters (body) |
| POST | \`/api/v2/item/query\` | Full-text search |
| GET | \`/api/v2/item/countAll\` | Count all items |
| POST | \`/api/v2/item/add\` | Add a new item |
| POST | \`/api/v2/item/update\` | Update an item |
| POST | \`/api/v2/item/setCustomThumbnail\` | Set a custom thumbnail |
| POST | \`/api/v2/item/refreshThumbnail\` | Refresh item thumbnail |
\*\*\*
## GET /api/v2/item/get
List items with optional filtering. Returns paginated results.
### Query Parameters
\* \`id\` string (optional) — Return a single item by ID
\* \`ids\` string (optional) — Comma-separated item IDs
\* \`isSelected\` boolean (optional) — Return currently selected items
\* \`isUntagged\` boolean (optional) — Return items without tags
\* \`isUnfiled\` boolean (optional) — Return items not in any folder
\* \`keywords\` string (optional) — Filter by keywords (comma-separated)
\* \`tags\` string (optional) — Filter by tags (comma-separated)
\* \`folders\` string (optional) — Filter by folder IDs (comma-separated)
\* \`ext\` string (optional) — Filter by file extension (e.g., \`jpg\`, \`png\`)
\* \`annotation\` string (optional) — Filter by annotation text
\* \`rating\` integer (optional) — Filter by rating (\`0\`–\`5\`)
\* \`url\` string (optional) — Filter by source URL
\* \`shape\` string (optional) — Filter by shape: \`square\`, \`portrait\`, \`panoramic-portrait\`, \`landscape\`, \`panoramic-landscape\`
\* \`fields\` string (optional) — Comma-separated list of fields to return (improves performance)
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"id": "M3QSGJNQTC2DG",\
"name": "sunset-photo",\
"ext": "jpg",\
"width": 1920,\
"height": 1080,\
"url": "https://example.com/photo.jpg",\
"tags": \["nature", "sunset"\],\
"folders": \["FOLDER\_ID\_1"\],\
"star": 4,\
"annotation": "Beautiful sunset at the beach",\
"modificationTime": 1700000000000\
}\
\],
"total": 1250,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Examples
\`\`\`javascript
// List first 50 items (default)
await fetch("http://localhost:41595/api/v2/item/get").then(r => r.json());
// Get a single item by ID
await fetch("http://localhost:41595/api/v2/item/get?id=M3QSGJNQTC2DG").then(r => r.json());
// Filter by extension with pagination
await fetch("http://localhost:41595/api/v2/item/get?ext=png&offset=0&limit=100").then(r => r.json());
// Return only specific fields for better performance
await fetch("http://localhost:41595/api/v2/item/get?fields=id,name,tags").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/get
Same as GET, but accepts filter parameters in the JSON body. Useful for complex queries with arrays.
### Request Body
\* \`id\` string (optional) — Item ID
\* \`ids\` string\\\[\] (optional) — Array of item IDs
\* \`isSelected\` boolean (optional) — Currently selected items
\* \`isUntagged\` boolean (optional) — Items without tags
\* \`isUnfiled\` boolean (optional) — Items not in any folder
\* \`keywords\` string\\\[\] (optional) — Keywords to match
\* \`tags\` string\\\[\] (optional) — Tags to match
\* \`folders\` string\\\[\] (optional) — Folder IDs to match
\* \`smartFolders\` string\\\[\] (optional) — Filter by smart folder IDs (OR logic, matches any)
\* \`ext\` string (optional) — File extension
\* \`annotation\` string (optional) — Annotation text
\* \`rating\` integer (optional) — Rating (\`0\`–\`5\`)
\* \`url\` string (optional) — Source URL
\* \`shape\` string (optional) — Image shape
\* \`fields\` string\\\[\] (optional) — Fields to return
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Examples
\`\`\`javascript
// Filter by tags
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
tags: \["design", "inspiration"\],
limit: 20
})
}).then(r => r.json());
// Get items by multiple IDs
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: \["ITEM\_ID\_1", "ITEM\_ID\_2", "ITEM\_ID\_3"\]
})
}).then(r => r.json());
// Filter JPG files in a specific folder, return only id and name
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ext: "jpg",
folders: \["FOLDER\_ID"\],
fields: \["id", "name", "tags"\],
offset: 0,
limit: 100
})
}).then(r => r.json());
\`\`\`
\`\`\`javascript
// Filter with smart folders
await fetch("http://localhost:41595/api/v2/item/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
smartFolders: \["SMART\_FOLDER\_ID"\],
tags: \["cat"\],
limit: 20
})
}).then(r => r.json());
\`\`\`
{% hint style="info" %}
\*\*Performance Tip:\*\* Use the \`fields\` parameter to return only the data you need. This significantly improves response time when working with large libraries.
{% endhint %}
\*\*\*
## POST /api/v2/item/query
Full-text search across item names, tags, annotations, URLs, folder names, and more. Supports advanced query syntax. Returns paginated results.
### Request Body
\* \`query\` string — Search query string
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Query Syntax
| Syntax | Description | Example |
| ------------ | ----------------------- | ------------------- |
| \`word\` | Must contain word | \`cat\` |
| \`a b\` | Must contain both (AND) | \`cat dog\` |
| \`a OR b\` | Contains either (OR) | \`cat OR dog\` |
| \`a \\|\\| b\` | Contains either (OR) | \`cat \\|\\| dog\` |
| \`-word\` | Must NOT contain | \`cat -dog\` |
| \`"phrase"\` | Exact phrase match | \`"orange cat"\` |
| \`(a OR b) c\` | Grouping | \`(cat OR dog) cute\` |
### Examples
\`\`\`javascript
// Simple search
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset" })
}).then(r => r.json());
// Advanced search: items with "cat" or "dog" but not "cartoon"
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: "(cat OR dog) -cartoon",
limit: 20
})
}).then(r => r.json());
// Paginate through search results
await fetch("http://localhost:41595/api/v2/item/query", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "design", offset: 50, limit: 50 })
}).then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/item/countAll
Returns the total number of items in the library.
### Response
\`\`\`json
{
"status": "success",
"data": 12500
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/countAll").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/add
Add a new item to Eagle. Supports adding from URL, Base64 data, local file path, or bookmark.
### Request Body
\* \`id\` string (optional) — Custom item ID
\* \`name\` string (optional) — Item name
\* \`tags\` string\\\[\] (optional) — Tags to assign
\* \`folders\` string\\\[\] (optional) — Folder IDs to add the item to
\* \`annotation\` string (optional) — Item annotation
\* \`website\` string (optional) — Source website URL
\*\*Plus one of the following:\*\*
\* \`url\` string — Image URL to download
\* \`base64\` string — Base64 encoded image data
\* \`path\` string — Local file path to import
\* \`bookmarkURL\` string — URL to add as a bookmark
### Examples
\`\`\`javascript
// Add from URL
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://example.com/photo.jpg",
name: "Example Photo",
tags: \["downloaded", "example"\],
folders: \["FOLDER\_ID"\]
})
}).then(r => r.json());
// Add from local file path
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
path: "C:\\\\Users\\\\User\\\\Downloads\\\\design.png",
name: "My Design",
tags: \["design"\]
})
}).then(r => r.json());
// Add a bookmark
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
bookmarkURL: "https://www.example.com",
name: "Example Site",
tags: \["bookmark"\]
})
}).then(r => r.json());
// Batch add multiple items (up to 1000)
await fetch("http://localhost:41595/api/v2/item/add", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
items: \[\
{ url: "https://example.com/photo1.jpg", name: "Photo 1" },\
{ path: "C:\\\\Users\\\\User\\\\Downloads\\\\design.png", name: "Design" },\
{ bookmarkURL: "https://www.example.com", name: "Bookmark" }\
\]
})
}).then(r => r.json());
\`\`\`
### Batch Mode
Pass an \`items\` array to add multiple items at once (up to 1000). Each object in the array follows the same format as single mode, and you can mix \`path\`, \`url\`, \`bookmarkURL\`, and \`base64\`.
### Response
Single mode returns the new item's ID:
\`\`\`json
{
"status": "success",
"data": { "id": "M3QSGJNQTC2DG" }
}
\`\`\`
Batch mode returns all new item IDs:
\`\`\`json
{
"status": "success",
"data": { "ids": \["ITEM\_ID\_1", "ITEM\_ID\_2", "ITEM\_ID\_3"\] }
}
\`\`\`
\*\*\*
## POST /api/v2/item/update
Update an existing item's metadata. Only the fields you include will be modified.
### Request Body
\* \`id\` string (required) — The item ID to update
\*\*Modifiable fields:\*\*
\* \`name\` string (optional) — New name
\* \`tags\` string\\\[\] (optional) — Replace tags
\* \`folders\` string\\\[\] (optional) — Replace folder assignments
\* \`annotation\` string (optional) — New annotation
\* \`url\` string (optional) — New source URL
\* \`star\` integer (optional) — Rating, \`0\`–\`5\`
\* \`modificationTime\` integer (optional) — Modification timestamp
\* \`noThumbnail\` boolean (optional) — Mark as having no thumbnail
\* \`noPreview\` boolean (optional) — Mark as not previewable
\* \`isDeleted\` boolean (optional) — Move to / restore from trash
### Response
Returns the updated item object.
### Examples
\`\`\`javascript
// Update item name and tags
await fetch("http://localhost:41595/api/v2/item/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
name: "Updated Name",
tags: \["tag1", "tag2"\],
star: 5
})
}).then(r => r.json());
// Move item to trash
await fetch("http://localhost:41595/api/v2/item/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
isDeleted: true
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/setCustomThumbnail
Set a custom thumbnail for an item from a local image file.
### Request Body
\* \`itemId\` string (required) — The item ID
\* \`filePath\` string (required) — Path to the thumbnail image
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/setCustomThumbnail", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
itemId: "M3QSGJNQTC2DG",
filePath: "C:\\\\Users\\\\User\\\\thumbnails\\\\custom.png"
})
}).then(r => r.json());
\`\`\`
{% hint style="info" %}
This operation is asynchronous. The API waits up to 10 seconds for the thumbnail to be generated before responding.
{% endhint %}
\*\*\*
## POST /api/v2/item/refreshThumbnail
Regenerate the thumbnail for an item, updating file size, dimensions, and color palette.
### Request Body
\* \`itemId\` string (required) — The item ID
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/refreshThumbnail", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ itemId: "M3QSGJNQTC2DG" })
}).then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/item/getComments
Get all comments (annotations) for an item. Returns image rect comments or video timestamp comments.
{% hint style="info" %}
\*\*Version Requirement:\*\* This endpoint requires \*\*Eagle 4.0 Build 22\*\* or later.
{% endhint %}
### Query Parameters
\* \`id\` string (required) — The item ID
### Response
\`\`\`json
{
"status": "success",
"data": \[\
{\
"id": "MN3DZC0R7XYSZ",\
"x": 324,\
"y": 810,\
"width": 194,\
"height": 208,\
"annotation": "Face area",\
"lastModified": 1774282485915\
}\
\]
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/getComments?id=M3QSGJNQTC2DG")
.then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/addComment
Add a comment to an item. Supports two types:
\* \*\*Image rect comment\*\* — provide \`x\`, \`y\`, \`width\`, \`height\` to mark a region on the image
\* \*\*Video timestamp comment\*\* — provide \`duration\` to mark a point on the video timeline
The server automatically generates \`id\` and \`lastModified\` fields.
{% hint style="info" %}
\*\*Version Requirement:\*\* This endpoint requires \*\*Eagle 4.0 Build 22\*\* or later.
{% endhint %}
### Request Body
\* \`id\` string (required) — The item ID
\* \`annotation\` string (optional) — Comment text
\* \`x\` number (optional) — Rect X position (image comment)
\* \`y\` number (optional) — Rect Y position (image comment)
\* \`width\` number (optional) — Rect width, must > 0 (image comment)
\* \`height\` number (optional) — Rect height, must > 0 (image comment)
\* \`duration\` number (optional) — Video timestamp in seconds, must >= 0 (video comment)
{% hint style="warning" %}
You must provide either \`duration\` (video) or all of \`x\`/\`y\`/\`width\`/\`height\` (image). Providing both or neither will return an error.
{% endhint %}
### Example
\`\`\`javascript
// Add an image rect comment
await fetch("http://localhost:41595/api/v2/item/addComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
x: 350, y: 480, width: 380, height: 400,
annotation: "White fluffy toy face"
})
}).then(r => r.json());
// Add a video timestamp comment
await fetch("http://localhost:41595/api/v2/item/addComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "VIDEO\_ITEM\_ID",
duration: 65.5,
annotation: "Important scene"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/updateComment
Update an existing comment. Only the provided fields are updated; \`lastModified\` is refreshed automatically.
{% hint style="info" %}
\*\*Version Requirement:\*\* This endpoint requires \*\*Eagle 4.0 Build 22\*\* or later.
{% endhint %}
### Request Body
\* \`id\` string (required) — The item ID
\* \`commentId\` string (required) — The comment ID to update
\* \`annotation\` string (optional) — New comment text
\* \`x\` number (optional) — New X position (image comment only)
\* \`y\` number (optional) — New Y position (image comment only)
\* \`width\` number (optional) — New width, must > 0 (image comment only)
\* \`height\` number (optional) — New height, must > 0 (image comment only)
\* \`duration\` number (optional) — New timestamp, must >= 0 (video comment only)
{% hint style="warning" %}
Image comments can only update \`x\`/\`y\`/\`width\`/\`height\`. Video comments can only update \`duration\`. Cross-type updates will return an error.
{% endhint %}
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/updateComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
commentId: "MN3DZC0R7XYSZ",
annotation: "Updated annotation text"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/item/removeComment
Remove a comment from an item.
{% hint style="info" %}
\*\*Version Requirement:\*\* This endpoint requires \*\*Eagle 4.0 Build 22\*\* or later.
{% endhint %}
### Request Body
\* \`id\` string (required) — The item ID
\* \`commentId\` string (required) — The comment ID to remove
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/item/removeComment", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "M3QSGJNQTC2DG",
commentId: "MN3DZC0R7XYSZ"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## Item Properties
Items returned by the API contain the following properties:
| Property | Type | Description |
| ------------------ | --------- | ---------------------------------------- |
| \`id\` | string | Unique item ID |
| \`name\` | string | Item name |
| \`ext\` | string | File extension |
| \`width\` | integer | Image width in pixels |
| \`height\` | integer | Image height in pixels |
| \`url\` | string | Source URL |
| \`isDeleted\` | boolean | Whether the item is in trash |
| \`annotation\` | string | Item annotation/notes |
| \`tags\` | string\\\[\] | Array of tag names |
| \`folders\` | string\\\[\] | Array of folder IDs |
| \`palettes\` | Object\\\[\] | Color palette information |
| \`size\` | integer | File size in bytes |
| \`star\` | integer | Rating (0–5) |
| \`modificationTime\` | integer | Last modification timestamp |
| \`noThumbnail\` | boolean | Whether the file has no thumbnail |
| \`noPreview\` | boolean | Whether double-click preview is disabled |
---
# Unknown
\> 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/api/smart-folder.md).
# Smart Folder
Smart Folder API allows you to list, create, update, delete smart folders, and query matching items.
{% hint style="danger" %}
\*\*This feature is not yet released\*\*: This API requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
{% endhint %}
## Endpoint Overview
| Method | Endpoint | Description |
| ------ | ------------------------------ | --------------------------------- |
| GET | \`/api/v2/smartFolder/get\` | List smart folders |
| POST | \`/api/v2/smartFolder/get\` | List smart folders (request body) |
| POST | \`/api/v2/smartFolder/create\` | Create a smart folder |
| POST | \`/api/v2/smartFolder/update\` | Update a smart folder |
| POST | \`/api/v2/smartFolder/remove\` | Delete a smart folder |
| GET | \`/api/v2/smartFolder/getItems\` | Get matching items |
| POST | \`/api/v2/smartFolder/getItems\` | Get matching items (request body) |
| GET | \`/api/v2/smartFolder/getRules\` | Get available rule schema |
\*\*\*
## GET /api/v2/smartFolder/get
List all smart folders, or filter by ID.
### Query Parameters
\* \`id\` string (optional) — Return a single smart folder by ID
\* \`ids\` string (optional) — Comma-separated smart folder IDs
### Response
\`\`\`json
{
"status": "success",
"data": \[\
{\
"id": "LRK3AQGN7VCB1",\
"name": "Large Images",\
"conditions": \[\
{\
"rules": \[\
{ "property": "width", "method": ">", "value": \[1920\] }\
\],\
"match": "AND",\
"boolean": "TRUE"\
}\
\],\
"description": "",\
"icon": "",\
"iconColor": "blue",\
"children": \[\],\
"modificationTime": 1700000000000,\
"imageCount": 42\
}\
\]
}
\`\`\`
### Examples
\`\`\`javascript
// List all smart folders
await fetch("http://localhost:41595/api/v2/smartFolder/get").then(r => r.json());
// Get a single smart folder by ID
await fetch("http://localhost:41595/api/v2/smartFolder/get?id=LRK3AQGN7VCB1").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/smartFolder/get
Same as GET, but accepts filter parameters in a JSON body.
### Request Body
\* \`id\` string (optional) — Smart folder ID
\* \`ids\` string\\\[\] (optional) — Array of smart folder IDs
### Examples
\`\`\`javascript
// Get smart folders by multiple IDs
await fetch("http://localhost:41595/api/v2/smartFolder/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: \["SMART\_FOLDER\_ID\_1", "SMART\_FOLDER\_ID\_2"\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/smartFolder/create
Create a new smart folder.
### Request Body
\* \`name\` string (required) — Smart folder name
\* \`conditions\` Object\\\[\] (required) — Filter conditions (see \[Conditions Format\](#conditions) below)
\* \`description\` string (optional) — Description
\* \`icon\` string (optional) — Icon
\* \`iconColor\` string (optional) — Icon color. Allowed values: \`red\`, \`orange\`, \`yellow\`, \`green\`, \`aqua\`, \`blue\`, \`purple\`, \`pink\`
\* \`parent\` string (optional) — Parent smart folder ID. If omitted, creates at root level.
### Response
Returns the newly created smart folder object.
\`\`\`json
{
"status": "success",
"data": {
"id": "NEW\_SMART\_FOLDER\_ID",
"name": "Large Images",
"conditions": \[\
{\
"rules": \[\
{ "property": "width", "method": ">", "value": \[1920\] }\
\],\
"match": "AND"\
}\
\],
"description": "",
"icon": "",
"iconColor": "",
"children": \[\],
"modificationTime": 1700000000000,
"imageCount": 150
}
}
\`\`\`
### Examples
\`\`\`javascript
// Create a smart folder for large PNG images
await fetch("http://localhost:41595/api/v2/smartFolder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Large PNGs",
conditions: \[\
{\
"rules": \[\
{ "property": "width", "method": ">", "value": \[1920\] },\
{ "property": "type", "method": "equal", "value": "png" }\
\],\
"match": "AND"\
}\
\],
iconColor: "blue"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/smartFolder/update
Update an existing smart folder's metadata. Only the fields you include will be modified.
### Request Body
\* \`id\` string (required) — Smart folder ID to update
\*\*Modifiable fields:\*\*
\* \`name\` string (optional) — New name
\* \`conditions\` Object\\\[\] (optional) — New filter conditions
\* \`description\` string (optional) — New description
\* \`icon\` string (optional) — New icon
\* \`iconColor\` string (optional) — New icon color
### Response
Returns the updated smart folder object.
### Examples
\`\`\`javascript
// Update name and icon color
await fetch("http://localhost:41595/api/v2/smartFolder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
name: "Extra Large Images",
iconColor: "green"
})
}).then(r => r.json());
// Update filter conditions
await fetch("http://localhost:41595/api/v2/smartFolder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
conditions: \[\
{\
"rules": \[\
{ "property": "width", "method": ">", "value": \[3840\] }\
\],\
"match": "AND"\
}\
\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/smartFolder/remove
Delete a smart folder. This also removes all its child smart folders.
### Request Body
\* \`id\` string (required) — Smart folder ID to delete
### Response
\`\`\`json
{
"status": "success",
"data": true
}
\`\`\`
### Examples
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/smartFolder/remove", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: "LRK3AQGN7VCB1" })
}).then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/smartFolder/getItems
Get items that match the smart folder's filter conditions.
### Query Parameters
\* \`smartFolderId\` string (required) — Smart folder ID
\* \`orderBy\` string (optional) — Sort field
\* \`fields\` string (optional) — Comma-separated list of fields to return
### Response
\`\`\`json
{
"status": "success",
"data": \[\
{\
"id": "M3QSGJNQTC2DG",\
"name": "wallpaper",\
"ext": "png",\
"width": 3840,\
"height": 2160,\
"tags": \["wallpaper"\],\
"folders": \[\]\
}\
\]
}
\`\`\`
### Examples
\`\`\`javascript
// Get all items in a smart folder
await fetch("http://localhost:41595/api/v2/smartFolder/getItems?smartFolderId=LRK3AQGN7VCB1")
.then(r => r.json());
// Return only specific fields
await fetch("http://localhost:41595/api/v2/smartFolder/getItems?smartFolderId=LRK3AQGN7VCB1&fields=id,name,tags")
.then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/smartFolder/getItems
Same as GET, but accepts parameters in a JSON body.
### Request Body
\* \`smartFolderId\` string (required) — Smart folder ID
\* \`orderBy\` string (optional) — Sort field
\* \`fields\` string\\\[\] (optional) — Fields to return
### Examples
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/smartFolder/getItems", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
smartFolderId: "LRK3AQGN7VCB1",
fields: \["id", "name", "ext", "width", "height"\]
})
}).then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/smartFolder/getRules
Get the available filter rule schema. Returns supported methods, valueType, options, and more for each property, enabling callers to dynamically construct valid conditions.
### Response
\`\`\`json
{
"status": "success",
"data": {
"name": {
"methods": \["contain", "uncontain", "equal", "startWith", "endWith", "empty", "not-empty", "regex"\],
"valueType": "string"
},
"width": {
"methods": \["=", ">=", "<=", ">", "<", "between"\],
"valueType": "number"
},
"type": {
"methods": \["equal", "unequal"\],
"valueType": "string",
"options": \["jpg", "png", "gif", "svg", "bmp", "webp", "..."\]
}
}
}
\`\`\`
### Examples
\`\`\`javascript
// Get available rules for dynamically building conditions
await fetch("http://localhost:41595/api/v2/smartFolder/getRules").then(r => r.json());
\`\`\`
{% hint style="info" %}
\*\*Tip:\*\* Call \`getRules\` first to get all available properties and methods, then build your \`conditions\` based on the returned schema before passing them to \`create\` or \`update\`. This helps avoid invalid filter conditions.
{% endhint %}
\*\*\*
## Conditions Format
A smart folder's \`conditions\` is an array of condition groups, each containing multiple rules:
\`\`\`json
\[\
{\
"rules": \[\
{ "property": "name", "method": "contain", "value": "cat" },\
{ "property": "width", "method": ">", "value": \[1920\] }\
\],\
"match": "AND",\
"boolean": "TRUE"\
}\
\]
\`\`\`
### Condition Group Properties
| Property | Type | Description |
| --------- | --------- | ------------------------------------------------------------------------- |
| \`rules\` | Object\\\[\] | Array of rules |
| \`match\` | string | Logic between rules. \`"AND"\`: all must match; \`"OR"\`: any must match |
| \`boolean\` | string | Include/exclude logic. \`"TRUE"\` (include, default) or \`"FALSE"\` (exclude) |
### Rule Properties
| Property | Type | Description |
| ---------- | ------ | ---------------------------------------------------- |
| \`property\` | string | Filter property (e.g., \`name\`, \`width\`, \`type\`) |
| \`method\` | string | Filter method (e.g., \`contain\`, \`>\`, \`equal\`) |
| \`value\` | any | Filter value (format depends on property and method) |
{% hint style="info" %}
\*\*Tip:\*\* Use \`GET /api/v2/smartFolder/getRules\` to query all available properties, methods, and their corresponding valueTypes.
{% endhint %}
\*\*\*
## SmartFolder Properties
Smart folders returned by the API contain the following properties:
| Property | Type | Description |
| ------------------ | --------- | --------------------------- |
| \`id\` | string | Unique smart folder ID |
| \`name\` | string | Name |
| \`conditions\` | Object\\\[\] | Filter conditions |
| \`description\` | string | Description |
| \`icon\` | string | Icon |
| \`iconColor\` | string | Icon color |
| \`children\` | Object\\\[\] | Child smart folders |
| \`modificationTime\` | integer | Last modification timestamp |
| \`imageCount\` | integer | Number of matching items |
---
# Unknown
\> 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/api/app.md).
# App
The App API provides information about the running Eagle application instance.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ------------------ | -------------------- |
| GET | \`/api/v2/app/info\` | Get application info |
\*\*\*
## GET /api/v2/app/info
Returns information about the running Eagle application, including version numbers and platform details.
### Response
\`\`\`json
{
"status": "success",
"data": {
"version": "4.0.0",
"prereleaseVersion": null,
"buildVersion": "build12",
"platform": "win32"
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/app/info").then(r => r.json());
\`\`\`
\*\*\*
## App Properties
| Property | Type | Description |
| ------------------- | -------------- | ----------------------------------------------------------- |
| \`version\` | string | Eagle version number (e.g., \`"4.0.0"\`) |
| \`prereleaseVersion\` | string \\| null | Pre-release version identifier, or \`null\` for stable |
| \`buildVersion\` | string \\| null | Build version identifier (e.g., \`"build12"\`) |
| \`platform\` | string | Operating system: \`"win32"\` (Windows) or \`"darwin"\` (macOS) |
---
# Unknown
\> 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/changelog.md).
# Changelog
Eagle Web API V2 changelog, documenting all notable changes.
{% hint style="info" %}
Looking for the V1 API changelog? Visit the \[legacy V1 API documentation\](https://api.eagle.cool/).
{% endhint %}
\*\*\*
## Smart Folder API — Eagle 4.0 Build 22
{% hint style="danger" %}
\*\*This feature is not yet released\*\*: This feature requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
{% endhint %}
New Smart Folder CRUD endpoints and rule query functionality:
\* \`GET /api/v2/smartFolder/get\` — List all smart folders
\* \`POST /api/v2/smartFolder/create\` — Create a smart folder
\* \`POST /api/v2/smartFolder/update\` — Update a smart folder
\* \`POST /api/v2/smartFolder/remove\` — Delete a smart folder
\* \`GET /api/v2/smartFolder/getItems\` — Get matching items
\* \`GET /api/v2/smartFolder/getRules\` — Get available rule schema
### Item API Enhancement
\* \`POST /api/v2/item/get\` added \`smartFolders\` parameter, combinable with other filters
\*\*\*
## Comment API — Eagle 4.0 Build 22
{% hint style="danger" %}
\*\*This feature is not yet released\*\*: This feature requires Eagle 4.0 Build 22 or later. Please follow the Eagle website for release updates.
{% endhint %}
New Comment CRUD endpoints for managing image rect annotations and video timeline notes:
\* \`GET /api/v2/item/getComments\` — Get all comments for an item
\* \`POST /api/v2/item/addComment\` — Add an image rect comment or video timestamp comment
\* \`POST /api/v2/item/updateComment\` — Update an existing comment
\* \`POST /api/v2/item/removeComment\` — Remove a comment
\*\*\*
## V2 API — Initial Release
The V2 API (\`/api/v2/...\`) is a comprehensive replacement for the V1 API, built on top of Eagle's Plugin API capabilities. Key features:
### New Capabilities (vs V1)
\* \*\*Full-text search\*\* — \`POST /api/v2/item/query\` with advanced query syntax (AND, OR, NOT, phrases)
\* \*\*AI semantic search\*\* — Search by text description (\`searchByText\`), image similarity (\`searchByBase64\`, \`searchByItemId\`)
\* \*\*Tag management\*\* — Create, rename, and merge tags; manage tag groups
\* \*\*Folder management\*\* — Create, move, rename, and organize folders
\* \*\*Automatic pagination\*\* — All list endpoints return paginated results by default (\`offset\` / \`limit\`)
\* \*\*Field selection\*\* — Use the \`fields\` parameter on item list to return only needed data
### Endpoints
| Section | Endpoints |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Item | \`get\`, \`query\`, \`countAll\`, \`add\`, \`save\`, \`open\`, \`select\`, \`setCustomThumbnail\`, \`refreshThumbnail\`, \`getComments\`, \`addComment\`, \`updateComment\`, \`removeComment\` |
| Folder | \`get\`, \`create\`, \`open\`, \`save\` |
| Tag | \`get\`, \`getRecentTags\`, \`getStarredTags\`, \`save\`, \`merge\` |
| Tag Group | \`get\`, \`create\`, \`save\`, \`remove\`, \`addTags\`, \`removeTags\` |
| Library | \`info\` |
| App | \`info\` |
| AI Search | \`isInstalled\`, \`isReady\`, \`isStarting\`, \`isSyncing\`, \`getSyncStatus\`, \`checkServiceHealth\`, \`searchByText\`, \`searchByBase64\`, \`searchByItemId\` |
### Pagination
All list endpoints use automatic pagination:
\* Default limit: \`50\`
\* Maximum limit: \`1000\`
\* Response includes \`total\`, \`offset\`, and \`limit\` metadata
---
# Unknown
\> 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/api/ai-search.md).
# AI Search
The AI Search API provides semantic search capabilities — search by text description or find visually similar images.
{% hint style="info" %}
\*\*Requires\*\* \[\*\*AI Search\*\*\](https://eagle.cool/support/article/ai-search) \*\*Plugin.\*\* The AI Search features require the Eagle AI Search plugin to be installed and running. Use the status endpoints to check availability before performing searches.
{% endhint %}
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ------------------------------------- | ---------------------------------- |
| GET | \`/api/v2/aiSearch/isInstalled\` | Check if AI Search is installed |
| GET | \`/api/v2/aiSearch/isReady\` | Check if AI Search is ready |
| GET | \`/api/v2/aiSearch/isStarting\` | Check if AI Search is starting up |
| GET | \`/api/v2/aiSearch/isSyncing\` | Check if AI Search is syncing data |
| GET | \`/api/v2/aiSearch/getSyncStatus\` | Get detailed sync status |
| GET | \`/api/v2/aiSearch/checkServiceHealth\` | Check service health |
| POST | \`/api/v2/aiSearch/searchByText\` | Search by text description |
| POST | \`/api/v2/aiSearch/searchByBase64\` | Search by image (Base64) |
| POST | \`/api/v2/aiSearch/searchByItemId\` | Find similar items by item ID |
\*\*\*
## Status Endpoints
### GET /api/v2/aiSearch/isInstalled
Check whether the AI Search plugin is installed.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/isInstalled").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": true
}
\`\`\`
\*\*\*
### GET /api/v2/aiSearch/isReady
Check whether AI Search is fully initialized and ready to accept search queries.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/isReady").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": true
}
\`\`\`
\*\*\*
### GET /api/v2/aiSearch/isStarting
Check whether the AI Search service is currently starting up.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/isStarting").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": false
}
\`\`\`
\*\*\*
### GET /api/v2/aiSearch/isSyncing
Check whether AI Search is currently syncing (indexing) library data.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/isSyncing").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": false
}
\`\`\`
\*\*\*
### GET /api/v2/aiSearch/getSyncStatus
Get detailed synchronization status, including progress information.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/getSyncStatus").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": {
"isSyncing": false,
"syncedCount": 12500,
"totalCount": 12500,
"progress": 1.0
}
}
\`\`\`
\*\*\*
### GET /api/v2/aiSearch/checkServiceHealth
Perform a health check on the AI Search service.
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/checkServiceHealth").then(r => r.json());
\`\`\`
\*\*Response:\*\*
\`\`\`json
{
"status": "success",
"data": {
"healthy": true
}
}
\`\`\`
\*\*\*
## Search Endpoints
### POST /api/v2/aiSearch/searchByText
Search for items using a natural language text description. The AI model finds visually or semantically matching items.
#### Request Body
\* \`query\` string (required) — Text description to search for
\* \`options\` Object (optional)
\* \`limit\` integer — Maximum number of results (default varies by AI Search config)
#### Response
\`\`\`json
{
"status": "success",
"data": {
"results": \[\
{\
"item": {\
"id": "M3QSGJNQTC2DG",\
"name": "sunset-beach",\
"ext": "jpg",\
"width": 1920,\
"height": 1080,\
"tags": \["nature", "sunset"\],\
"star": 4\
},\
"score": 0.892\
},\
{\
"item": {\
"id": "K7XPWQBN9TC3F",\
"name": "golden-hour",\
"ext": "png",\
"width": 2560,\
"height": 1440,\
"tags": \["photography"\],\
"star": 3\
},\
"score": 0.756\
}\
\]
}
}
\`\`\`
#### Examples
\`\`\`javascript
// Search by text description
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "an orange cat sitting on a windowsill" })
}).then(r => r.json());
// Search with result limit
await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: "minimalist logo design",
options: { limit: 20 }
})
}).then(r => r.json());
\`\`\`
\*\*\*
### POST /api/v2/aiSearch/searchByBase64
Find visually similar items by providing a Base64-encoded image.
#### Request Body
\* \`base64\` string (required) — Base64-encoded image data
\* \`options\` Object (optional)
\* \`limit\` integer — Maximum number of results
#### Response
Same format as \`searchByText\` — returns an array of \`{ item, score }\` results sorted by similarity.
#### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/searchByBase64", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
base64: "/9j/4AAQSkZJRg...",
options: { limit: 10 }
})
}).then(r => r.json());
\`\`\`
\*\*\*
### POST /api/v2/aiSearch/searchByItemId
Find items visually similar to an existing item in the library.
#### Request Body
\* \`itemId\` string (required) — The item ID to find similar items for
\* \`options\` Object (optional)
\* \`limit\` integer — Maximum number of results
#### Response
Same format as \`searchByText\` — returns an array of \`{ item, score }\` results sorted by similarity.
#### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/aiSearch/searchByItemId", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
itemId: "M3QSGJNQTC2DG",
options: { limit: 10 }
})
}).then(r => r.json());
\`\`\`
\*\*\*
## Recommended Workflow
1. \*\*Check availability\*\* — Call \`isInstalled\` and \`isReady\` before searching
2. \*\*Wait if starting\*\* — If \`isStarting\` returns \`true\`, poll until \`isReady\` becomes \`true\`
3. \*\*Check sync status\*\* — Use \`getSyncStatus\` to verify the index is up to date
4. \*\*Search\*\* — Use \`searchByText\` for description-based search, \`searchByBase64\` for reverse image search, or \`searchByItemId\` to find similar items
\`\`\`javascript
// Step 1: Verify AI Search is ready
const { data: isReady } = await fetch("http://localhost:41595/api/v2/aiSearch/isReady")
.then(r => r.json());
if (isReady) {
// Step 2: Perform search
const results = await fetch("http://localhost:41595/api/v2/aiSearch/searchByText", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "sunset landscape", options: { limit: 10 } })
}).then(r => r.json());
console.log(results.data.results);
}
\`\`\`
---
# Unknown
\> 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/api/library.md).
# Library
The Library API allows you to get information about the currently open Eagle library.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ------------------------- | ------------------------ |
| GET | \`/api/v2/library/info\` | Get library metadata |
| GET | \`/api/v2/library/history\` | Get library history list |
| POST | \`/api/v2/library/switch\` | Switch to a library |
| GET | \`/api/v2/library/icon\` | Get library icon |
\*\*\*
## GET /api/v2/library/info
Returns metadata about the currently open Eagle library, including its name, path, and configuration.
### Response
\`\`\`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": \[\]
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/library/info").then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/library/history
Get the list of recently opened libraries. Returns paginated results.
### Query Parameters
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"name": "My Design Library",\
"path": "D:\\\\Eagle Libraries\\\\My Design Library.library"\
}\
\],
"total": 3,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Examples
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/library/history").then(r => r.json());
// With pagination
await fetch("http://localhost:41595/api/v2/library/history?offset=0&limit=10").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/library/switch
Switch to a specified library.
### Request Body
\* \`libraryPath\` string (required) — Path to the library to switch to
### Response
\`\`\`json
{
"status": "success",
"data": true
}
\`\`\`
### Example
\`\`\`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
Get the icon for a library.
### Query Parameters
\* \`libraryPath\` string (required) — Path to the library
### Response
Returns the icon image data.
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/library/icon?libraryPath=D%3A%5CEagle%20Libraries%5CMy%20Design%20Library.library")
.then(r => r.blob());
\`\`\`
\*\*\*
## Library Properties
The library object contains the following properties:
| Property | Type | Description |
| -------------------- | --------- | --------------------------------------- |
| \`name\` | string | Library display name |
| \`path\` | string | Full path to the \`.library\` directory |
| \`modificationTime\` | integer | Last modification timestamp |
| \`applicationVersion\` | string | Eagle version that created this library |
| \`folders\` | Object\\\[\] | Top-level folder structure |
| \`smartFolders\` | Object\\\[\] | Smart folder configurations |
| \`quickAccess\` | Object\\\[\] | Quick access items |
| \`tagGroups\` | Object\\\[\] | Tag group definitions |
---
# Unknown
\> 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/api/tag.md).
# Tag
The Tag API allows you to list, rename, and merge tags in the Eagle library.
## Endpoints Overview
| Method | Endpoint | Description |
| ------ | ---------------------------- | ---------------------- |
| GET | \`/api/v2/tag/get\` | List all tags |
| POST | \`/api/v2/tag/get\` | List tags (body) |
| GET | \`/api/v2/tag/getRecentTags\` | Get recently used tags |
| GET | \`/api/v2/tag/getStarredTags\` | Get starred tags |
| POST | \`/api/v2/tag/update\` | Rename a tag |
| POST | \`/api/v2/tag/merge\` | Merge two tags |
\*\*\*
## GET /api/v2/tag/get
List all tags in the library. Returns paginated results.
### Query Parameters
\* \`name\` string (optional) — Filter tags by name (substring match)
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"name": "design",\
"count": 150,\
"color": "",\
"groups": \["GROUP\_ID\_1"\],\
"pinyin": "design"\
},\
{\
"name": "photography",\
"count": 89,\
"color": "",\
"groups": \[\],\
"pinyin": "photography"\
}\
\],
"total": 340,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Examples
\`\`\`javascript
// List all tags (first 50)
await fetch("http://localhost:41595/api/v2/tag/get").then(r => r.json());
// Filter tags by name
await fetch("http://localhost:41595/api/v2/tag/get?name=design").then(r => r.json());
// Paginate through tags
await fetch("http://localhost:41595/api/v2/tag/get?offset=50&limit=100").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tag/get
Same as GET, but accepts filter parameters in the JSON body.
### Request Body
\* \`name\` string (optional) — Filter tags by name (substring match)
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tag/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "design", limit: 100 })
}).then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/tag/getRecentTags
Get recently used tags. Returns paginated results.
### Query Parameters
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
\`\`\`json
{
"status": "success",
"data": {
"data": \[\
{\
"name": "ui-design",\
"count": 45,\
"color": "",\
"groups": \[\],\
"pinyin": "ui-design"\
}\
\],
"total": 12,
"offset": 0,
"limit": 50
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tag/getRecentTags").then(r => r.json());
\`\`\`
\*\*\*
## GET /api/v2/tag/getStarredTags
Get starred (pinned) tags. Returns paginated results.
### Query Parameters
\* \`offset\` integer (optional) — Pagination offset, default \`0\`
\* \`limit\` integer (optional) — Pagination limit, default \`50\`, max \`1000\`
### Response
Same format as \`/api/v2/tag/getRecentTags\`.
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tag/getStarredTags").then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tag/update
Rename an existing tag. All items using this tag will be updated automatically.
### Request Body
\* \`originalName\` string (required) — The current tag name
\* \`name\` string (required) — The new tag name
### Response
Returns the updated tag object.
\`\`\`json
{
"status": "success",
"data": {
"name": "new-tag-name",
"count": 45,
"color": "",
"groups": \[\],
"pinyin": "new-tag-name"
}
}
\`\`\`
### Example
\`\`\`javascript
await fetch("http://localhost:41595/api/v2/tag/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
originalName: "old-tag-name",
name: "new-tag-name"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## POST /api/v2/tag/merge
Merge a source tag into a target tag. All items with the source tag will have it replaced by the target tag. The source tag is removed after merging.
### Request Body
\* \`source\` string (required) — The tag name to merge from (will be removed)
\* \`target\` string (required) — The tag name to merge into (will be kept)
### Response
\`\`\`json
{
"status": "success",
"data": {
"affectedItems": 25,
"sourceRemoved": true
}
}
\`\`\`
### Example
\`\`\`javascript
// Merge "photograph" into "photography"
await fetch("http://localhost:41595/api/v2/tag/merge", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
source: "photograph",
target: "photography"
})
}).then(r => r.json());
\`\`\`
\*\*\*
## Tag Properties
Tags returned by the API contain the following properties:
| Property | Type | Description |
| -------- | --------- | --------------------------------- |
| \`name\` | string | Tag name |
| \`count\` | integer | Number of items using this tag |
| \`color\` | string | Tag color (empty string if unset) |
| \`groups\` | string\\\[\] | Array of tag group IDs |
| \`pinyin\` | string | Pinyin representation of the name |
---