Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ A self-hosted online file converter. Supports over a thousand different formats.
- Process multiple files at once
- Password protection
- Multiple accounts
- A REST API for scripts and automation, documented with OpenAPI

## Converters supported

Expand Down Expand Up @@ -142,6 +143,38 @@ Tutorial in chinese: <https://xzllll.com/24092901/>

Tutorial in polish: <https://www.kreatywnyprogramista.pl/convertx-lokalny-konwerter-plikow>

## API

ConvertX has a REST API at `/api/v1`, so scripts and tools like n8n can convert files without the web interface. If you set `WEBROOT`, the API is under it: with `WEBROOT=/convert`, it's at `/convert/api/v1`.

1. In ConvertX, open **Account → API keys** and create a key. It's shown once, so copy it.
2. Send it as `Authorization: Bearer <key>`.

Convert one file and save the result:

```bash
curl --fail -H "Authorization: Bearer $CONVERTX_KEY" \
-F file=@report.docx -F to=pdf \
-o report.pdf \
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
http://localhost:3000/api/v1/convert
```

With `--fail`, curl exits with an error instead of saving an error message as `report.pdf`. Leave it out to see the message: errors are JSON, with an `error` code and a `message`.

For several files, or conversions that take a while, start a job and follow it:

```bash
curl -H "Authorization: Bearer $CONVERTX_KEY" \
-F files=@one.png -F files=@two.png -F to=webp \
http://localhost:3000/api/v1/jobs
# → {"id": 12, "status": "pending", "files": [...]}

curl -H "Authorization: Bearer $CONVERTX_KEY" http://localhost:3000/api/v1/jobs/12
# → each file's status, and a download URL for each result
```

`GET /api/v1/targets?from=docx` lists what a format can be converted to. The full reference, which you can try out in the browser, is at `/api/v1/docs`.

## Screenshots

![ConvertX Preview](images/preview.png)
Expand Down
3 changes: 3 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@elysiajs/html": "^1.4.2",
"@elysiajs/jwt": "^1.4.2",
"@elysiajs/openapi": "1.4.16",
"@elysiajs/static": "^1.4.10",
"@kitajs/html": "^4.2.13",
"elysia": "1.4.32",
Expand Down
Loading