跳转到主要内容
POST
Parse a file to Markdown

授权

Authorization
string
header
必填

A key from conare.ai/dashboard/keys with full access, some namespaces, or models only (/embed, /rerank, /v1, /v2/rerank, /parse).

查询参数

name
string

The file's name (e.g. Q3 report.pdf); defaults to the URL's last segment, else file.

Maximum string length: 4096
type
enum<string>

The file's type, as on POST /namespaces/{namespace}/files; unset, it is read from the bytes.

可用选项:
pdf,
xlsx,
docx,
pptx,
doc,
ppt,
rtf,
odt,
ods,
odp,
csv,
tsv,
txt,
md,
png,
jpeg,
webp,
tiff,
gif,
bmp,
heic
pages
string

Pages to read, e.g. 1-20,25 or 5-: a PDF's pages, an image's frames or a deck's slides.

示例:

"1-20,25"

password
string

The password of a protected PDF or Office 2007+ file, on a file of at most 20 MiB; never stored.

layout
boolean
默认值:false

true: each part OCR read carries blocks, its page's layout regions.

wait
string
默认值:60

Seconds, 0-300, to wait for the parse before answering 202 (true is 60, false 0); answers come within 105 s.

示例:

"60"

"0"

"true"

请求体

The body is of type file.

响应

The file's text.

A file's text, as POST /parse and POST /namespaces/{namespace}/files answer it.

id
string
必填

prs_... from POST /parse; the file id from POST /namespaces/{namespace}/files.

state
enum<string>
必填
可用选项:
done
type
enum<string>
必填
可用选项:
pdf,
xlsx,
docx,
pptx,
csv,
tsv,
txt,
md,
image
name
string
必填
markdown
string
必填

The whole document as Markdown; each page, slide or sheet starts with a comment such as <!-- page 3 -->.

parts
object[]
必填

The parts in reading order; joined with their start comments, they make markdown.

without_text
object
必填

What holds no text: PDF or image pages, deck slides (1-based) and Word or PowerPoint pictures (images).

pages
integer

All the file's pages, frames, slides or sheets, whatever pages selected.