admin-catalog-tools
Extract component data from a product page with an LLM
Turns a product page into a component draft. Nothing is persisted — save the result with POST /api/admin/save-component. Depends on external AI and fetch services, so a request can take tens of seconds; any upstream failure ends in 500.
- Input precedence: productInfo.url > url > searchTerm. A searchTerm without url first calls POST /api/admin/search-amazon on NEXT_PUBLIC_BASE_URL, forwarding the caller's Authorization header; if no product is found, extraction continues from the search term alone.
- The page is fetched as markdown through Jina Reader (https://r.jina.ai/<url>, optional JINA_API_KEY, 30 s timeout) and cached in-process for 1 h (at most 50 entries).
- Blocked or captcha Amazon pages fall back to a SearxNG search (search.yuzuhub.com) for the ASIN.
- Existing brand names are read from the PocketBase component_brands collection.
- The Anthropic Messages API extracts the specification (ANTHROPIC_API_KEY required; model EXTRACT_MODEL, default claude-haiku-4-5-20251001; up to 5 turns in which the model may call a searxng_search tool).
- A second search-amazon call supplies one amazon.de affiliate link; without a hit the link is an amazon.de search-results URL carrying the affiliate tag.
- http(s) icon URLs go through self-hosted background removal (BRIA RMBG-1.4 via @huggingface/transformers); on failure the original URL is kept.
post/api/admin/extract-component
Request
- Base URL: https://voltplan.app
- URL: https://voltplan.app/api/admin/extract-component
- Auth: HTTP bearer
Request body
Response
Extracted component draft.
Changes
No recorded changes to this operation across all 1 revision of this API.