API v1
唯讀 JSON API:搜尋提示詞、瀏覽公開組合包與串接自動化。不需登入;依 IP 限制請求次數。
快速開始
請使用 curl 執行檔;若 Windows PowerShell 的 curl 是別名,請改用 curl.exe。網址已加引號,查詢參數不會被終端拆開。
讀取官方模型參考
curl "https://prompt.luvai.net/api/v1/models?lang=zh&limit=1"查詢工具代碼與公開數量
curl "https://prompt.luvai.net/api/v1/tools?lang=zh&limit=1"搜尋公開電子報標題
curl "https://prompt.luvai.net/api/v1/newsletters?lang=zh&limit=1"搜尋公開教學
curl "https://prompt.luvai.net/api/v1/tutorials?limit=1"搜尋既有工程術語
curl "https://prompt.luvai.net/api/v1/keywords?q=cache&limit=1"搜尋免費提示詞
curl "https://prompt.luvai.net/api/v1/prompts?free=1&lang=zh&limit=1"查詢主題代碼
curl "https://prompt.luvai.net/api/v1/tags?q=code-review&lang=zh"瀏覽公開組合包
curl "https://prompt.luvai.net/api/v1/collections?lang=zh&limit=20"依真實 slug 讀取一筆結果(Node.js 18 以上)
將程式存為 promptcraft-read.mjs,執行 node promptcraft-read.mjs。最多發出兩次公開請求,每次逾時 10 秒;不需 API key 或額外套件。
const base = "https://prompt.luvai.net/api/v1";
async function read(url) {
const response = await fetch(url, { signal: AbortSignal.timeout(10000) });
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
if (data.ok !== true) throw new Error("Unexpected API response");
return data;
}
const page = await read(base + "/prompts?free=1&limit=1&lang=zh");
const selected = page.prompts[0];
if (selected) {
const detail = await read(base + "/prompts/" + encodeURIComponent(selected.slug) + "?lang=zh");
console.log(JSON.stringify(detail, null, 2));
} else {
console.log("No published free prompts were found.");
}分頁回應含 next_offset。保留原查詢條件,以下一個 offset 繼續,遇到 null 就停止。組合包項目只有摘要;以項目 slug 查詢單篇端點,取得可用內容。
既有工程術語詞典
直接讀公開定義、使用時機與 how_to_ask 提問句。這是既有資料查詢,不呼叫 AI、不使用 AI 點數。content_language 為 zh-Hant;附英文術語,正文仍為繁中,回傳網址連到既有原文詞條。
| GET | 參數/回應 |
|---|---|
| /api/v1/tutorials | q (≤200), limit (1–50; 20), offset; total / showing / next_offset / tutorials |
| /api/v1/tutorials/{slug} | tutorial: full stored Markdown, content_language=zh-Hant, content_format=markdown, source URL and dates |
| /api/v1/keywords | q (≤200), category, limit (1–50; 20), offset; total / showing / next_offset / keywords |
| /api/v1/keywords/{slug} | keyword: definition, when_to_use, how_to_ask, gotcha, related, tags, updated_at |
字面搜尋:% 與 _ 不是萬用字元。category 使用 OpenAPI 列出的完整值。保留條件,以 next_offset 續讀直到 null。搜尋 30 次/分鐘/IP、單篇 60 次;非法或重複參數 400、缺詞條 404、限流 429/Retry-After、資料不可用 503。沒有 lang 參數或虛構翻譯。
Node.js:搜尋後讀完整教學
標題、摘要與完整 Markdown 都是既有繁中資料。q 字面搜尋,不接受 lang,也不呼叫 AI。依 next_offset 續讀直到 null,來源網址指向實際教學頁。
const base = "https://prompt.luvai.net/api/v1";
async function read(path) {
const response = await fetch(base + path, { signal: AbortSignal.timeout(10000) });
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
if (data.ok !== true) throw new Error("Unexpected response");
return data;
}
const page = await read("/tutorials?limit=1");
const selected = page.tutorials[0];
if (selected) {
const detail = await read("/tutorials/" + encodeURIComponent(selected.slug));
console.log(JSON.stringify(detail.tutorial, null, 2));
} else {
console.log("No stored public tutorials were found.");
}Node.js:搜尋後讀完整定義
const base = "https://prompt.luvai.net/api/v1";
async function read(path) {
const response = await fetch(base + path, { signal: AbortSignal.timeout(10000) });
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
if (data.ok !== true) throw new Error("Unexpected response");
return data;
}
const page = await read("/keywords?limit=1");
const selected = page.keywords[0];
if (selected) {
const detail = await read("/keywords/" + encodeURIComponent(selected.slug));
console.log(JSON.stringify(detail.keyword, null, 2));
} else {
console.log("No stored glossary entries were found.");
}端點參考
GET/api/v1/collections目前公開的組合包摘要。count 為分頁前總數;以 next_offset 取得下一頁,null 代表結束。+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| lang | zh | en | Default zh. English fields fall back to the source; translation_status is complete, partial or source. |
| limit | 1-50 | Default 20 |
| offset | integer ≥ 0 | Default 0; use next_offset from the previous response. |
{
"ok": true,
"count": 1,
"limit": 20,
"offset": 0,
"next_offset": null,
"collections": [{
"slug": "example-collection",
"title": "Example collection",
"summary": "Public collection metadata",
"kicker": null,
"unlock_cost": null,
"updated_at": "2026-10-12",
"translation_status": "complete",
"url": "https://prompt.luvai.net/en/collections/example-collection"
}]
}GET/api/v1/collections/[slug]組合包資訊與依策展順序排列的公開提示詞摘要、註解和連結。items_count 為分頁前的公開項目數;position 保留全包順位。未發布的組合包回 404。+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| lang | zh | en | Default zh; untranslated notes keep their source text. |
| limit | 1-50 | Default 25 |
| offset | integer ≥ 0 | Default 0; follow next_offset until null. |
{
"ok": true,
"limit": 25,
"offset": 0,
"next_offset": null,
"collection": {
"slug": "example-collection",
"title": "Example collection",
"items_count": 1,
"items": [{
"position": 1,
"note": "Editorial note",
"prompt": {
"slug": "example-prompt",
"title": "Example prompt",
"is_pro": false,
"url": "https://prompt.luvai.net/en/prompts/example-prompt"
}
}]
}
}GET/api/v1/tagsDiscover every public topic, its unique prompt count, slug and locale URL. Use slug as the prompts API tag filter or MCP search_prompts tag.+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| q | string ≤ 200 | Search topic labels and aliases. |
| min_count | 1–100 | Minimum unique prompt count, default 1. |
| lang | zh | en | Locale for topic links, default zh. |
| limit | 1–50 | Default 20; count precedes pagination. |
| offset | safe integer ≥ 0 | Follow next_offset until null. |
{ "ok": true, "count": 1, "limit": 20, "offset": 0, "next_offset": null, "tags": [{ "slug": "code-review", "label": "Code Review", "prompt_count": 2, "url": "https://prompt.luvai.net/tags/code-review" }] }GET/api/v1/promptsList / search prompts. Count is complete before pagination; follow next_offset until null.+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| q | string ≤ 500 | Literal search across public metadata/examples and free body/variables. PRO body/variables are excluded from matching. Count includes every published match before pagination. |
| tag | string ≤ 200 | Exact topic label or normalized slug from /tags. Aliases match the same topic; literal percent text must be URL encoded. Empty/invalid values return 400; unknown topics return zero results. Combines with all other filters. |
| tool | string ≤ 100 | Use a known key from /tools or tool_key from /integrations (Midjourney uses mj); recognized legacy aliases also work. Unknown keys return 400. |
| category | string? | Filter by medium: image / video / music / tutorial |
| lang | zh | en | Metadata language (default zh; missing translations fall back to Chinese) |
| free | 0 | 1 | Default 0. Use 1 for free entries only; unsupported values return 400. |
| sort | recommended | updated | rating | Default recommended. updated uses UTC update time; rating uses average, then rating count, with unrated entries last. Invalid values return 400. Sort applies before pagination; MCP search_prompts accepts the same sort values. |
| limit | 1-50 | Default 20. Invalid integers return 400. |
| offset | safe integer ≥ 0 | Default 0. Invalid integers return 400. |
{
"ok": true,
"count": 237,
"limit": 20,
"offset": 0,
"next_offset": 20,
"sort": "recommended",
"tag": null,
"prompts": [
{
"slug": "midjourney-portrait-cinematic",
"title": "...",
"summary": "...",
"tool": "mj",
"category": "image",
"tags": ["portrait", "cinematic"],
"difficulty": "intermediate",
"url": "https://prompt.luvai.net/prompts/..."
}
]
}GET/api/v1/prompts/[slug]Published prompt detail: free entries include full text; Pro entries return preview only. Draft and scheduled entries return 404.+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| lang | zh | en | Metadata language (default zh) |
{
"ok": true,
"prompt": {
"slug": "...",
"title": "...",
"is_pro": false,
"access": "full",
"preview": "first-line preview",
"full_prompt": "complete prompt text",
"context": "when to use / why",
"variables": [{"name": "subject", "description": "..."}],
"sample_output": "...",
"rating": { "avg": 4.6, "count": 32 },
"updated_at": "2026-05-13"
}
}GET/api/v1/models官方參考版本、來源與核對日期;明示未核實及退役資訊。不生成、不設定供應商路由。+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| q | string ≤ 200 | 參考資料字面搜尋 |
| category | enum | image / video / music / tutorial / audio |
| lang | enum | zh / en |
| limit / offset | integer | limit 1–50;offset ≥ 0;依 next_offset 續讀 |
{
"ok": true,
"total": 1,
"showing": 1,
"limit": 1,
"offset": 0,
"next_offset": null,
"models": [
{
"key": "midjourney",
"name": "Midjourney",
"category": "image",
"version": "V8.2",
"vendor": "Midjourney",
"notes": "官方版本頁列出 V8.2 預設版本;舊提示詞的參考圖與版本參數需依文件調整。",
"source_url": "https://docs.midjourney.com/hc/en-us/articles/32199405667853-Version",
"checked_on": "2026-10-15",
"verified_on": "2026-10-15",
"verification": "documented",
"status": "reference",
"tool_key": "mj",
"url": "https://prompt.luvai.net/models?q=midjourney#midjourney",
"search_url": "https://prompt.luvai.net/search?q=Midjourney",
"generator_url": "https://prompt.luvai.net/tools/midjourney/generator",
"record_type": "model_reference"
}
]
}GET/api/v1/tools公開工具定義與提示詞庫數量。不帶查詢保留完整舊清單;帶查詢可取兩語分頁。數量可重疊,不代表模型執行能力。+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| q | string ≤ 200 | 工具資料字面搜尋 |
| category | enum | image / video / music / tutorial |
| lang | enum | zh / en |
| limit / offset | integer | 明示分頁;limit 1–50,offset ≥ 0 |
{
"ok": true,
"tools": [
{
"key": "mj",
"label": "Midjourney",
"label_en": "Midjourney",
"medium": "image",
"description": "...",
"prompt_count": 42,
"url": "https://prompt.luvai.net/tools/mj"
}
]
}GET/api/v1/integrationsPlatform directory with search keys and working local builder links. Media generation happens on the external platform; audio-tool requirements are shown on its page.+
{
"ok": true,
"total": 19,
"categories": { "image": 7, "video": 6, "music": 2, "audio": 1, "text": 3 },
"with_generator": 15,
"with_prompts": 18,
"integrations": [{
"key": "midjourney",
"tool_key": "mj",
"name": "Midjourney",
"vendor": "Midjourney Inc",
"category": "image",
"has_generator": true,
"has_prompts": true,
"generator_kind": "prompt_builder",
"prompts_url": "https://prompt.luvai.net/midjourney-prompts",
"generator_url": "https://prompt.luvai.net/tools/midjourney/generator"
}]
}GET/api/v1/changelogRecently updated prompts (default last 30 days). Polling-friendly.+
| 名稱 | 可用值 | 說明 |
|---|---|---|
| days | 1-365 | Lookback window, default 30 |
| limit | 1-100 | Max items returned, default 50 |
{
"ok": true,
"days": 30,
"count": 28,
"prompts": [
{
"slug": "midjourney-portrait-cinematic",
"title": "...",
"tool": "mj",
"category": "image",
"difficulty": "intermediate",
"updated_at": "2026-05-13",
"url": "https://prompt.luvai.net/prompts/..."
}
]
}限流與公開內容範圍
清單與搜尋端點每個 IP 每分鐘 30 次;提示詞及組合包單筆詳情為 60 次。各端點標示限制。HTTP 429 的 Retry-After 以秒為單位,請等待後再試,避免同時重送。
免費提示詞詳情包含 full_prompt 與 variables。PRO 回傳 is_pro: true、access: preview,省略全文與變數;公開 API 無法解鎖付費內容。
組合包只提供公開摘要,免費項目也不附全文,且排除草稿與排程提示詞。英文欄位缺少翻譯時保留原文;組合包以 translation_status 標示翻譯完整度。
錯誤處理
- 400
- 查詢值或工具代碼無效。依 error 修正參數;不要重送相同無效請求。
- 404
- slug 不存在或未公開。請從最新清單取得有效 slug。
- 429
- 已達 IP 請求限制。等待 Retry-After 指定秒數後再試。
- 網路/5xx
- 設定請求逾時,採用有次數限制且逐步延後的重試。請求失敗不應顯示成沒有結果。
各端點的回應區塊是縮略示意。完整回應契約請參考 OpenAPI schema。