siyuan

Manage SiYuan knowledge base blocks and documents via the kernel REST API.

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill siyuan-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: siyuan
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/optional-skills/productivity/siyuan
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill siyuan-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Interacting with a self-hosted SiYuan knowledge base programmatically requires knowing dozens of POST-only API endpoints, ID formats, and authentication details, which slows down note automation and integration work. ## Core Features & Use Cases - Full CRUD on Notes: Search, read, create, update, rename, and delete blocks, documents, and notebooks through the SiYuan kernel API using curl. - Flexible Querying: Run full-text search or direct SQL SELECT queries against the blocks database for precise retrieval. - Attributes & Export: Set custom block attributes and export documents as Markdown for backup or migration. - Use Case: Automatically append daily meeting notes to a dated document in your SiYuan notebook, then tag the blocks with custom status attributes for later review. ## Quick Start Use the siyuan skill to search my SiYuan knowledge base for notes mentioning project timeline and show the top five results.

Frequently Asked Questions about siyuan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search notes in SiYuan using the API?▼

Use the /api/search/fullTextSearchBlock endpoint with a POST request containing your query string and page number. For more control, query /api/query/sql with a SELECT statement against the blocks table filtering by content, type, or notebook ID.

How to create a document in SiYuan programmatically?▼

Send a POST request to /api/filetree/createDocWithMd with the notebook ID, target path, and Markdown content in the JSON body. Authenticate with an Authorization header containing your SiYuan API token.

Does the SiYuan API use GET or POST requests?▼

All SiYuan kernel API endpoints use POST with JSON bodies, even read-only operations like search and block retrieval. Sending GET requests will fail, so always use POST with the Authorization token header.

Where do I find my SiYuan API token?▼

Open the SiYuan desktop app and go to Settings, then About, where the API token is displayed. Store it as the SIYUAN_TOKEN environment variable and optionally set SIYUAN_URL, which defaults to http://127.0.0.1:6806.

Why does my SiYuan API call return an error code?▼

SiYuan responses include a code field where 0 means success and any other value indicates an error described in the msg field. Common causes are invalid block IDs, which must match the timestamp-plus-suffix format, or a missing or incorrect API token.

Can I run SQL queries against SiYuan notes safely?▼

Yes, the /api/query/sql endpoint accepts SELECT statements against the blocks database with columns like id, content, type, and box. Never send INSERT, UPDATE, DELETE, or DROP statements, as they can corrupt the knowledge base.