Skip to main content
Best for terminals, scripts, CI, and every “run this file now” workflow. If you are still comparing integration paths, start with the get started overview; if you want parsing inside application code, go to SoMark SDK.
1

Install the CLI

Both the Python and JavaScript packages provide the somark command.
pip install somark
# or
npm install somark-js
If the global command is not available yet, try python -m somark.cli.main --help on Python or npx somark-js --help on Node.js.
2

Set your API key

The two most common options are interactive login or an environment variable.
somark login

# or
export SOMARK_API_KEY=sk-your-api-key
3

Parse one file first

Start with single-file sync parsing before adding more output formats, async flags, or batch inputs.
somark parse ./document.pdf

somark parse ./document.pdf --formats md,json --out ./document.md
4

Move on to large files or batch jobs

Use async mode for large files, or read from a file list for repeatable batch processing.
somark parse ./large.pdf --async --wait

somark parse --file-list ./files.txt --out ./parsed/
For more detail on parameters and error handling, continue to the CLI & SDK usage guide.