$npx -y skills add antvis/chart-visualization-skills --skill icon-retrievalSearch icons through HTTP API and retrieve SVG strings with curl.
| 1 | # Icon Search |
| 2 | |
| 3 | Use the icon HTTP API directly with `curl`. |
| 4 | |
| 5 | ## API |
| 6 | |
| 7 | ### Search Endpoint |
| 8 | |
| 9 | - **Method**: `GET` |
| 10 | - **URL**: `https://lab.weavefox.cn/api/v1/infographic/icon` |
| 11 | - **Query params**: |
| 12 | - `text` (required): search keyword, e.g. `"data analysis"` |
| 13 | - `topK` (optional): number of icons to fetch (1-20), default `5` |
| 14 | |
| 15 | Example: |
| 16 | |
| 17 | ```bash |
| 18 | curl -sS -L --max-time 20 "https://lab.weavefox.cn/api/v1/infographic/icon?text=document&topK=5" |
| 19 | ``` |
| 20 | |
| 21 | Typical response: |
| 22 | |
| 23 | ```json |
| 24 | { |
| 25 | "success": true, |
| 26 | "data": [ |
| 27 | "https://example.com/icon1.svg", |
| 28 | "https://example.com/icon2.svg" |
| 29 | ] |
| 30 | } |
| 31 | ``` |
| 32 | |
| 33 | ### Retrieve SVG Content |
| 34 | |
| 35 | ```bash |
| 36 | curl -sS -L --max-time 20 "https://example.com/icon1.svg" |
| 37 | ``` |
| 38 | |
| 39 | ## Workflow |
| 40 | |
| 41 | 1. Determine the icon concept keyword (for example: `security`, `document`, `data`). |
| 42 | 2. Search icon URLs using the API endpoint. |
| 43 | 3. Use `curl` to fetch the SVG content of selected URLs. |
| 44 | 4. Use SVG directly in pages, diagrams, or infographic materials. |
| 45 | |
| 46 | ## Notes |
| 47 | |
| 48 | - Use URL encoding for special characters in `text`. |
| 49 | - `topK` range is 1–20; if omitted, the service returns up to 5 results. |
| 50 | - For network issues, retry with a smaller `topK` or verify endpoint accessibility. |