Long2Text
← Long2Text

API

One POST turns a long screenshot into Markdown: split, read, put back together with speakers, timestamps and the pictures inside it.

Request

Send the screenshot one of four ways: a multipart `file` field (up to 4 MB), JSON with a public `url` (up to 30 MB), JSON with a base64 `image`, or a raw `image/*` body. JPG, PNG and WebP only.

curl -X POST https://long2text.com/api/v1/convert \
  -H "Authorization: Bearer $LONG2TEXT_API_KEY" \
  -F file=@chat.png \
  -F mode=text

Options

modetext | rich | bothtext: pictures become one-line descriptions · rich: pictures returned as files · both: files and descriptions
sceneauto | chat | meeting | articleLayout; auto detects it
proofreadtrue | falseAI correction of uncertain lines (default true)
langzh | enLabels and descriptions; detected by default
imagestrue | falseInclude base64 picture data (default: true unless mode=text)

Response

`markdown` follows the mode; `text` is always the plain-text version. Picture files are returned as base64 in `images[].data` unless you ask for `images=false`.

{
  "mode": "text",
  "scene": "chat",
  "lang": "zh",
  "markdown": "**林晓**:周五的评审我可能要晚到半小时…",
  "text": "林晓:周五的评审我可能要晚到半小时…",
  "images": [
    { "id": "img1", "file": "images/img1.jpg", "x": 96, "y": 1421,
      "width": 220, "height": 232, "ocr_text": "收到!",
      "description": "表情包:黄色笑脸配星星,下方写着“收到!”" }
  ],
  "corrections": [{ "original": "李子玻不在", "corrected": "李子玄不在" }],
  "stats": { "width": 750, "height": 6506, "parts": 1, "characters": 860,
             "paragraphs": 63, "seconds": 6.2, "skipped": [] }
}

Command line and agents

The repository ships a dependency-free CLI and a Claude Code / Codex skill, so an agent can convert a screenshot without opening the site:

node l2t.mjs chat.png --mode text
# → chat.md

Limits and behaviour

Errors

Failures return `{ "error": { "code", "message" } }` with a matching HTTP status: 401 invalid key, 413 image too large, 415 unsupported image, 429 rate limited, 502 recognition failed.

Getting a key

Keys are issued by hand for now — write to support@long2text.com with what you want to convert and roughly how often.