Skip to main content
Best for products, backend services, and automation systems. If you are still comparing integration paths, start with the get started overview; if you only need a terminal workflow, go to SoMark CLI.
1

Install the SDK

SoMark provides both Python and JavaScript implementations.
pip install somark
2

Initialize the client

The simplest setup is to pass your API key during initialization.
from somark import SoMark

client = SoMark(api_key="sk-your-api-key")
3

Complete one sync parse first

Start with one file and one working result before expanding into more formats or downstream processing.
response = client.parser.parse(
    file="./document.pdf",
    formats=["md", "json"],
)
response.save("./document.md")
4

Use async tasks for larger jobs

Long documents, batch jobs, and background flows are a better fit for async mode.
task = client.parser.parse_async(file="./large.pdf", formats=["md"])
result = task.wait()
result.save("./large.md")
For more parameter details and error-handling guidance, continue to the CLI & SDK usage guide.