mang30/myskills/pdf-to-md-mineru
- community
Checking that the SKILL.md file is still in the repository.
Convert PDF papers to Markdown using MinerU's cloud API for high-quality document parsing with formula, table, and layout recognition. Use this skill whenever the user wants to convert a PDF paper/document to Markdown (.md) format, or mentions "MinerU", "论文转 markdown", "PDF 转 md", "paper to markdown", "extract paper content", or wants structured text extraction from academic PDFs. Also trigger when the user uploads a PDF and asks to "parse it", "extract content", "转成文本", or wants readable markdown output from a research paper. This skill supports both the Precise API (Token required, up to 200MB/600 pages, vlm/pipeline models) and the Agent Lightweight API (no token, up to 10MB/20 pages).
Install
npx vskill@latest install mang30/myskills/pdf-to-md-mineruSKILL.md
PDF to Markdown via MinerU API
Convert PDF documents (especially academic papers) to high-quality Markdown using MinerU's cloud parsing API. MinerU excels at recognizing complex layouts, mathematical formulas, tables, and figures commonly found in research papers.
Prerequisites
- Python 3 with
requestsandzipfileavailable - Network access to
https://mineru.net(the MinerU API endpoint) - For the Precise API: a MinerU API Token (apply at https://mineru.net/apiManage)
- For the Agent Lightweight API: no token needed (IP rate-limited)
Quick Decision: Which API to Use
| Condition | Use | |
|---|---|---|
| File ≤ 10MB and ≤ 20 pages, quick extraction needed | Agent Lightweight API | |
| File > 10MB or > 20 pages | Precise API (Token required) | |
| Need vlm model or extra formats (docx/html/latex) | Precise API (Token required) | |
| User explicitly mentions token or precise/vlm | Precise API | |
| No token available, small file | Agent Lightweight API |
If the user has not specified a preference and the file is small, default to the Agent Lightweight API for zero-friction usage. Ask the user if they have a MinerU token only when the file exceeds lightweight limits.
Workflow
Step 1: Determine the input source
The PDF can come from:
- A URL — the user provides a direct link to the PDF
- A local file — the user uploads a PDF to
/mnt/user-data/uploads/
If the PDF is a local file, you need to upload it to get it parsed. The approach differs by API:
- Precise API: Use the batch file upload endpoint to get a presigned URL, then PUT the file
- Agent Lightweight API: Use the
/api/v1/agent/parse/fileendpoint to get a signed upload URL, then PUT the file
If the PDF is a URL, you can submit it directly.
Step 2: Check for token
Look for a MinerU token. The user may provide it directly, or it may be stored in an environment variable. Common locations:
- Environment variable:
MINERU_API_TOKEN - The user states it in conversation
If no token is found and the file fits within lightweight limits (≤ 10MB, ≤ 20 pages), use the Agent Lightweight API without asking. If the file exceeds limits, ask the user to provide a token.
Step 3: Run the conversion script
Execute the conversion using the bundled script:
Key arguments:
--input: PDF file path or URL--output: Directory to save the resulting.mdfile (defaults to current directory)--token: MinerU API token (required for Precise API, omit for Agent API)--model:vlm(recommended, better accuracy) orpipeline(faster). Default:vlm. Only for Precise API--language: Document language, defaultch(Chinese+English). Useenfor English-only papers--enable-ocr: Enable OCR for scanned PDFs--api: ForcepreciseoragentAPI. Auto-detected if omitted--timeout: Max seconds to wait for parsing, default 600
Step 4: Deliver the output
After the script completes:
- The
.mdfile will be in the output directory - Copy it to
/mnt/user-data/outputs/for the user to download - Optionally show a preview of the first ~50 lines
If the Precise API was used, the script also downloads and extracts the full zip (containing images, JSON, etc.) into a subfolder. The main markdown file is full.md inside the zip.
Error Handling
| Symptom | Likely cause | Fix | |
|---|---|---|---|
| Token error (A0202/A0211) | Invalid or expired token | Ask user to refresh token at mineru.net | |
| File too large (-60005 / -30001) | Exceeds size limit | Switch API or compress PDF | |
| Too many pages (-60006 / -30003) | Page limit exceeded | Use --page-range to select pages, or use Precise API | |
| Network timeout (-60008) | URL unreachable from China | Ask user to provide an accessible URL or upload locally | |
| Rate limit (HTTP 429) | Agent API IP limit | Wait and retry, or switch to Precise API with token |
Tips for Academic Papers
- Use
--model vlmfor papers with complex layouts, multi-column text, or heavy math — vlm model gives significantly better results on academic content - For papers in English only, set
--language enfor slightly better OCR accuracy - If the paper has scanned pages or image-based text, add
--enable-ocr - The resulting markdown preserves LaTeX math notation (inline
$...$and display$$...$$), which is ideal for further processing or reading in markdown renderers that support math
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pdf-to-md-mineru/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mang30/myskills/pdf-to-md-mineru)