文档转文本和 Markdown API - PDF Office HTML API

API ID 16016

将 PDF、Office 文件(DOCX、PPTX、XLSX、ODT、ODP、ODS)和网页转换为干净的文本或 Markdown,用于 LLM、RAG 和搜索管道

523 ms 平均响应

API 文档

端点

请求
通过 URL 从 PDF 提取文本:从链接下载 PDF 并返回干净的文本、页数、标题、作者和日期。支持页面范围,每次请求最多 50 页和 10 MB】【。
Endpoint ID: 45115
GET https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45115/extract+text+from+a+pdf+by+url
输入参数

从 URL 提取 PDF 文本 — 端点功能

对象 描述
url 可选 Public http(s) link to a PDF, an arXiv abs page or a journal article page (max 10 MB).
pages 可选 Pages to read, e.g. 1-3,5 (max 50 per call).
maxChars 可选 Cut the output to this many characters (1 to 1000000, default 200000).
includePages 可选 true or false. Also return the text of every page separately (default false).

剩余免费测试请求:3 / 3。


输入参数

url
pages
maxChars
includePages
API 示例响应
JSON
{
    "url": "https://arxiv.org/abs/1706.03762",
    "resolvedUrl": "https://arxiv.org/pdf/1706.03762",
    "ok": true,
    "error": null,
    "pageCount": 15,
    "pagesExtracted": 3,
    "title": null,
    "author": null,
    "subject": null,
    "keywords": null,
    "creator": "LaTeX with hyperref",
    "producer": "pdfTeX-1.40.25",
    "createdAt": "2024-04-10T21:11:43.000Z",
    "modifiedAt": "2024-04-10T21:11:43.000Z",
    "charCount": 8942,
    "wordCount": 1310,
    "truncated": false,
    "text": "Provided proper attribution is provided, Google hereby grants permission to\nreproduce the tables and figures in this paper solely for use in journalistic or\nscholarly works.\nAttention Is All You Need\nAshish Vaswani∗\nGoogle Brain\[email protected]\nNoam Shazeer∗\nGoogle Brain\[email protected]\nNiki Parmar∗\nGoogle Research\[email protected]\nJakob Uszkoreit∗\nGoogle Research\[email protected]\nLlion Jones∗\nGoogle Research\[email protected]\nAidan N. Gomez∗ †\nUniversity of Toronto\[email protected]\nŁukasz Kaiser∗\nGoogle Brain\[email protected]\nIllia Polosukhin∗ ‡\[email protected]\nAbstract\nThe dominant sequence transduction models are based on complex recurrent or\nconvolutional neural networks that include an encoder and a decoder. The best\nperforming models also connect the encoder and decoder through an attention\nmechanism. We propose a new simple network architecture, the Transformer,\nbased solely on attention mechanisms, dispensing with recurrence and convolutions\nentirely. Experiments on two machine translation tasks show these models to\nbe superior in quality while being more parallelizable and requiring significantly\nless time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-\nto-German translation task, improving over the existing best results, including\nensembles, by over 2 BLEU. On the WMT 2014 English-to-French translation task,\nour model establishes a new single-model state-of-the-art BLEU score of 41.8 after\ntraining for 3.5 days on eight GPUs, a small fraction of the training costs of the\nbest models from the literature. We show that the Transformer generalizes well to\nother tasks by applying it successfully to English constituency parsing both with\nlarge and limited training data.\n∗Equal contribution. Listing order is random. Jakob proposed replacing RNNs with self-attention and started\nthe effort to evaluate this idea. Ashish, with Illia, designed and implemented the first Transformer models and\nhas been crucially involved in every aspect of this work. Noam proposed scaled dot-product attention, multi-head\nattention and the parameter-free position representation and became the other person involved in nearly every\ndetail. Niki designed, implemented, tuned and evaluated countless model variants in our original codebase and\ntensor2tensor. Llion also experimented with novel model variants, was responsible for our initial codebase, and\nefficient inference and visualizations. Lukasz and Aidan spent countless long days designing various parts of and\nimplementing tensor2tensor, replacing our earlier codebase, greatly improving results and massively accelerating\nour research.\n†Work performed while at Google Brain.\n‡Work performed while at Google Research.\n31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA.\narXiv:1706.03762v7 [cs.CL] 2 Aug 2023\n\n1 Introduction\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks\nin particular, have been firmly established as state of the art approaches in sequence modeling and\ntransduction problems such as language modeling and machine translation [35, 2, 5]. Numerous\nefforts have since continued to push the boundaries of recurrent language models and encoder-decoder\narchitectures [38, 24, 15].\nRecurrent models typically factor computation along the symbol positions of the input and output\nsequences. Aligning the positions to steps in computation time, they generate a sequence of hidden\nstates ht, as a function of the previous hidden state ht−1 and the input for position t. This inherently\nsequential nature precludes parallelization within training examples, which becomes critical at longer\nsequence lengths, as memory constraints limit batching across examples. Recent work has achieved\nsignificant improvements in computational efficiency through factorization tricks [21] and conditional\ncomputation [32], while also improving model performance in case of the latter. The fundamental\nconstraint of sequential computation, however, remains.\nAttention mechanisms have become an integral part of compelling sequence modeling and transduc-\ntion models in various tasks, allowing modeling of dependencies without regard to their distance in\nthe input or output sequences [2, 19]. In all but a few cases [27], however, such attention mechanisms\nare used in conjunction with a recurrent network.\nIn this work we propose the Transformer, a model architecture eschewing recurrence and instead\nrelying entirely on an attention mechanism to draw global dependencies between input and output.\nThe Transformer allows for significantly more parallelization and can reach a new state of the art in\ntranslation quality after being trained for as little as twelve hours on eight P100 GPUs.\n2 Background\nThe goal of reducing sequential computation also forms the foundation of the Extended Neural GPU\n[16], ByteNet [18] and ConvS2S [9], all of which use convolutional neural networks as basic building\nblock, computing hidden representations in parallel for all input and output positions. In these models,\nthe number of operations required to relate signals from two arbitrary input or output positions grows\nin the distance between positions, linearly for ConvS2S and logarithmically for ByteNet. This makes\nit more difficult to learn dependencies between distant positions [12]. In the Transformer this is\nreduced to a constant number of operations, albeit at the cost of reduced effective resolution due\nto averaging attention-weighted positions, an effect we counteract with Multi-Head Attention as\ndescribed in section 3.2.\nSelf-attention, sometimes called intra-attention is an attention mechanism relating different positions\nof a single sequence in order to compute a representation of the sequence. Self-attention has been\nused successfully in a variety of tasks including reading comprehension, abstractive summarization,\ntextual entailment and learning task-independent sentence representations [4, 27, 28, 22].\nEnd-to-end memory networks are based on a recurrent attention mechanism instead of sequence-\naligned recurrence and have been shown to perform well on simple-language question answering and\nlanguage modeling tasks [34].\nTo the best of our knowledge, however, the Transformer is the first transduction model relying\nentirely on self-attention to compute representations of its input and output without using sequence-\naligned RNNs or convolution. In the following sections, we will describe the Transformer, motivate\nself-attention and discuss its advantages over models such as [17, 18] and [9].\n3 Model Architecture\nMost competitive neural sequence transduction models have an encoder-decoder structure [5, 2, 35].\nHere, the encoder maps an input sequence of symbol representations (x1, ..., xn) to a sequence\nof continuous representations z = (z1, ..., zn). Given z, the decoder then generates an output\nsequence (y1, ..., ym) of symbols one element at a time. At each step the model is auto-regressive\n[10], consuming the previously generated symbols as additional input when generating the next.\n2\n\nFigure 1: The Transformer - model architecture.\nThe Transformer follows this overall architecture using stacked self-attention and point-wise, fully\nconnected layers for both the encoder and decoder, shown in the left and right halves of Figure 1,\nrespectively.\n3.1 Encoder and Decoder Stacks\nEncoder: The encoder is composed of a stack of N = 6 identical layers. Each layer has two\nsub-layers. The first is a multi-head self-attention mechanism, and the second is a simple, position-\nwise fully connected feed-forward network. We employ a residual connection [11] around each of\nthe two sub-layers, followed by layer normalization [1]. That is, the output of each sub-layer is\nLayerNorm(x + Sublayer(x)), where Sublayer(x) is the function implemented by the sub-layer\nitself. To facilitate these residual connections, all sub-layers in the model, as well as the embedding\nlayers, produce outputs of dimension dmodel = 512.\nDecoder: The decoder is also composed of a stack of N = 6 identical layers. In addition to the two\nsub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head\nattention over the output of the encoder stack. Similar to the encoder, we employ residual connections\naround each of the sub-layers, followed by layer normalization. We also modify the self-attention\nsub-layer in the decoder stack to prevent positions from attending to subsequent positions. This\nmasking, combined with fact that the output embeddings are offset by one position, ensures that the\npredictions for position i can depend only on the known outputs at positions less than i.\n3.2 Attention\nAn attention function can be described as mapping a query and a set of key-value pairs to an output,\nwhere the query, keys, values, and output are all vectors. The output is computed as a weighted sum\n3",
    "fileSizeBytes": 2215244,
    "pageLimit": 50,
    "pagesRequested": "1-3",
    "pageLimitApplied": false
}
从 URL 提取 PDF 文本 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45115/extract+text+from+a+pdf+by+url?url=https://arxiv.org/abs/1706.03762&pages=1-3&maxChars=200000' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求
从上传的 PDF 中提取文本:从您上传的 PDF 文件中提取干净的文本和元数据。返回页数、标题、作者、日期和文本,并可选择页码范围
Endpoint ID: 45116
POST https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45116/extract+text+from+an+uploaded+pdf
输入参数

从上传的 PDF 中提取文本 — 端点功能

对象 描述
pages 可选 Pages to read for an uploaded file, e.g. 1-3,5.
请求体 必需 Json

剩余免费测试请求:3 / 3。


输入参数

pages
API 示例响应
JSON
{
    "url": "https://arxiv.org/abs/1706.03762",
    "resolvedUrl": "https://arxiv.org/pdf/1706.03762",
    "ok": true,
    "error": null,
    "pageCount": 15,
    "pagesExtracted": 2,
    "title": null,
    "author": null,
    "subject": null,
    "keywords": null,
    "creator": "LaTeX with hyperref",
    "producer": "pdfTeX-1.40.25",
    "createdAt": "2024-04-10T21:11:43.000Z",
    "modifiedAt": "2024-04-10T21:11:43.000Z",
    "charCount": 7114,
    "wordCount": 1018,
    "truncated": false,
    "text": "Provided proper attribution is provided, Google hereby grants permission to\nreproduce the tables and figures in this paper solely for use in journalistic or\nscholarly works.\nAttention Is All You Need\nAshish Vaswani∗\nGoogle Brain\[email protected]\nNoam Shazeer∗\nGoogle Brain\[email protected]\nNiki Parmar∗\nGoogle Research\[email protected]\nJakob Uszkoreit∗\nGoogle Research\[email protected]\nLlion Jones∗\nGoogle Research\[email protected]\nAidan N. Gomez∗ †\nUniversity of Toronto\[email protected]\nŁukasz Kaiser∗\nGoogle Brain\[email protected]\nIllia Polosukhin∗ ‡\[email protected]\nAbstract\nThe dominant sequence transduction models are based on complex recurrent or\nconvolutional neural networks that include an encoder and a decoder. The best\nperforming models also connect the encoder and decoder through an attention\nmechanism. We propose a new simple network architecture, the Transformer,\nbased solely on attention mechanisms, dispensing with recurrence and convolutions\nentirely. Experiments on two machine translation tasks show these models to\nbe superior in quality while being more parallelizable and requiring significantly\nless time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-\nto-German translation task, improving over the existing best results, including\nensembles, by over 2 BLEU. On the WMT 2014 English-to-French translation task,\nour model establishes a new single-model state-of-the-art BLEU score of 41.8 after\ntraining for 3.5 days on eight GPUs, a small fraction of the training costs of the\nbest models from the literature. We show that the Transformer generalizes well to\nother tasks by applying it successfully to English constituency parsing both with\nlarge and limited training data.\n∗Equal contribution. Listing order is random. Jakob proposed replacing RNNs with self-attention and started\nthe effort to evaluate this idea. Ashish, with Illia, designed and implemented the first Transformer models and\nhas been crucially involved in every aspect of this work. Noam proposed scaled dot-product attention, multi-head\nattention and the parameter-free position representation and became the other person involved in nearly every\ndetail. Niki designed, implemented, tuned and evaluated countless model variants in our original codebase and\ntensor2tensor. Llion also experimented with novel model variants, was responsible for our initial codebase, and\nefficient inference and visualizations. Lukasz and Aidan spent countless long days designing various parts of and\nimplementing tensor2tensor, replacing our earlier codebase, greatly improving results and massively accelerating\nour research.\n†Work performed while at Google Brain.\n‡Work performed while at Google Research.\n31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA.\narXiv:1706.03762v7 [cs.CL] 2 Aug 2023\n\n1 Introduction\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks\nin particular, have been firmly established as state of the art approaches in sequence modeling and\ntransduction problems such as language modeling and machine translation [35, 2, 5]. Numerous\nefforts have since continued to push the boundaries of recurrent language models and encoder-decoder\narchitectures [38, 24, 15].\nRecurrent models typically factor computation along the symbol positions of the input and output\nsequences. Aligning the positions to steps in computation time, they generate a sequence of hidden\nstates ht, as a function of the previous hidden state ht−1 and the input for position t. This inherently\nsequential nature precludes parallelization within training examples, which becomes critical at longer\nsequence lengths, as memory constraints limit batching across examples. Recent work has achieved\nsignificant improvements in computational efficiency through factorization tricks [21] and conditional\ncomputation [32], while also improving model performance in case of the latter. The fundamental\nconstraint of sequential computation, however, remains.\nAttention mechanisms have become an integral part of compelling sequence modeling and transduc-\ntion models in various tasks, allowing modeling of dependencies without regard to their distance in\nthe input or output sequences [2, 19]. In all but a few cases [27], however, such attention mechanisms\nare used in conjunction with a recurrent network.\nIn this work we propose the Transformer, a model architecture eschewing recurrence and instead\nrelying entirely on an attention mechanism to draw global dependencies between input and output.\nThe Transformer allows for significantly more parallelization and can reach a new state of the art in\ntranslation quality after being trained for as little as twelve hours on eight P100 GPUs.\n2 Background\nThe goal of reducing sequential computation also forms the foundation of the Extended Neural GPU\n[16], ByteNet [18] and ConvS2S [9], all of which use convolutional neural networks as basic building\nblock, computing hidden representations in parallel for all input and output positions. In these models,\nthe number of operations required to relate signals from two arbitrary input or output positions grows\nin the distance between positions, linearly for ConvS2S and logarithmically for ByteNet. This makes\nit more difficult to learn dependencies between distant positions [12]. In the Transformer this is\nreduced to a constant number of operations, albeit at the cost of reduced effective resolution due\nto averaging attention-weighted positions, an effect we counteract with Multi-Head Attention as\ndescribed in section 3.2.\nSelf-attention, sometimes called intra-attention is an attention mechanism relating different positions\nof a single sequence in order to compute a representation of the sequence. Self-attention has been\nused successfully in a variety of tasks including reading comprehension, abstractive summarization,\ntextual entailment and learning task-independent sentence representations [4, 27, 28, 22].\nEnd-to-end memory networks are based on a recurrent attention mechanism instead of sequence-\naligned recurrence and have been shown to perform well on simple-language question answering and\nlanguage modeling tasks [34].\nTo the best of our knowledge, however, the Transformer is the first transduction model relying\nentirely on self-attention to compute representations of its input and output without using sequence-\naligned RNNs or convolution. In the following sections, we will describe the Transformer, motivate\nself-attention and discuss its advantages over models such as [17, 18] and [9].\n3 Model Architecture\nMost competitive neural sequence transduction models have an encoder-decoder structure [5, 2, 35].\nHere, the encoder maps an input sequence of symbol representations (x1, ..., xn) to a sequence\nof continuous representations z = (z1, ..., zn). Given z, the decoder then generates an output\nsequence (y1, ..., ym) of symbols one element at a time. At each step the model is auto-regressive\n[10], consuming the previously generated symbols as additional input when generating the next.\n2",
    "fileSizeBytes": 2215244,
    "pageLimit": 50,
    "pagesRequested": "1-2",
    "pageLimitApplied": false
}
从上传的 PDF 中提取文本 — 代码片段

curl --location --request POST 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45116/extract+text+from+an+uploaded+pdf?pages=1-3' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' 

--data-raw '{"url":"https://arxiv.org/abs/1706.03762","pages":"1-2"}'

    
请求
通过网址转换办公文档:将链接中的 Word、PowerPoint、Excel 或 OpenDocument 文件转换为整洁的 Markdown 或纯文本。表格保持为表格,幻灯片保留标题和演讲者备注。
Endpoint ID: 45117
GET https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45117/convert+an+office+document+by+url
输入参数

通过 URL 转换 Office 文档 — 端点功能

对象 描述
url 可选 Public http(s) link to a .docx, .pptx, .xlsx, .odt, .odp or .ods file (max 10 MB).
outputFormat 可选 What to return: markdown, text or both. Default markdown.
includeNotes 可选 true or false. Add slide speaker notes (default true).
maxRowsPerSheet 可选 Excel and ODS: rows per sheet (1 to 5000, default 1000).
maxChars 可选 Cut the output to this many characters (1 to 1000000, default 200000).
chunkSize 可选 RAG chunks: if 100 or more, also return chunks of about this many characters. 0 = off (default).
chunkOverlap 可选 Characters repeated between chunks (0 to 10000, default 0).

剩余免费测试请求:3 / 3。


输入参数

url
outputFormat
includeNotes
maxRowsPerSheet
maxChars
chunkSize
chunkOverlap
API 示例响应
JSON
{
    "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx",
    "ok": true,
    "error": null,
    "format": "docx",
    "fileName": "SampleDoc.docx",
    "fileSizeBytes": 11611,
    "slides": null,
    "sheets": null,
    "charCount": 140,
    "wordCount": 31,
    "truncated": false,
    "markdown": "I am a test document\n\nThis is page 1\n\nI am Calibri (Body) in font size 11\n\nThis is page two\n\nIt’s Arial Black in 16 point\n\nIt’s also in blue",
    "text": null
}
通过 URL 转换 Office 文档 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45117/convert+an+office+document+by+url?url=https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx&outputFormat=markdown&includeNotes=1&maxRowsPerSheet=1000&maxChars=200000&chunkSize=OptionalchunkOverlap=Optional' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求
在 JSON 请求体中发送 Word、Excel 或 PowerPoint 文件,即可获取整洁的 Markdown 或纯文本。使用 outputFormat 选择 markdown、text 或两者皆选。
Endpoint ID: 45118
POST https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45118/convert+an+office+file+from+a+json+body
输入参数

从 JSON 正文转换 Office 文件 — 端点功能

对象 描述
outputFormat 可选 What to return: markdown, text or both. Default markdown.
请求体 必需 Json

剩余免费测试请求:3 / 3。


输入参数

outputFormat
API 示例响应
JSON
{
    "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/slideshow/SampleShow.pptx",
    "ok": true,
    "error": null,
    "format": "pptx",
    "fileName": "SampleShow.pptx",
    "fileSizeBytes": 39083,
    "slides": 2,
    "sheets": null,
    "charCount": 355,
    "wordCount": 73,
    "truncated": false,
    "markdown": "## Slide 1: Title of the first slide\n\n- Subtitle of the first slide\n- This bit is in italic green\n\n> Notes: I am the notes of the first slide\n\n## Slide 2: This is the second slide\n\n- It has bullet points on it\n- They’re fun, aren’t they?\n- Especially in a different font like Arial Black at 16 point!\n\n> Notes: These are the notes of the 2nd slide THIS LINE IS BOLD",
    "text": null
}
从 JSON 正文转换 Office 文件 — 代码片段

curl --location --request POST 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45118/convert+an+office+file+from+a+json+body?outputFormat=markdown' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' 

--data-raw '{"url":"https://raw.githubusercontent.com/apache/poi/trunk/test-data/slideshow/SampleShow.pptx"}'

    
请求
将公共网页 URL 或原始 HTML 转换为干净的 Markdown 或纯文本。可选择保留链接和图片,并将长网页拆分成多个部分
Endpoint ID: 45119
GET https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45119/convert+a+web+page+or+html+to+markdown
输入参数

将网页或 HTML 转换为 Markdown — 端点功能

对象 描述
url 可选 Public http(s) link to a web page (max 5 MB). Use either url or html.
html 可选 Raw HTML to convert instead of a URL (short snippets).
mode 可选 article (default): main text only. full: whole page without menus.
outputFormat 可选 What to return: markdown, text or both. Default markdown.
keepLinks 可选 true or false. Keep links (default true).
keepImages 可选 true or false. Keep images (default false).
maxChars 可选 Cut the output to this many characters (1 to 1000000, default 200000).
chunkSize 可选 RAG chunks: if 100 or more, also return chunks of about this many characters. 0 = off (default).
chunkOverlap 可选 Characters repeated between chunks (0 to 10000, default 0).

剩余免费测试请求:3 / 3。


输入参数

url
html
mode
outputFormat
keepLinks
keepImages
maxChars
chunkSize
chunkOverlap
API 示例响应
JSON
{
    "url": "https://en.wikipedia.org/wiki/Markdown",
    "finalUrl": "https://en.wikipedia.org/wiki/Markdown",
    "ok": true,
    "error": null,
    "httpStatus": 200,
    "title": "Markdown - Wikipedia",
    "description": null,
    "language": "en",
    "canonicalUrl": "https://en.wikipedia.org/wiki/Markdown",
    "author": "Contributors to Wikimedia projects",
    "publishedAt": "2005-08-09T19:56:00Z",
    "siteName": "Wikimedia Foundation, Inc.",
    "mode": "article",
    "charCount": 39590,
    "wordCount": 3238,
    "tableCount": 3,
    "linkCount": 258,
    "truncated": false,
    "_note": "Response truncated for documentation purposes"
}
将网页或 HTML 转换为 Markdown — 代码片段

curl --location --request GET 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45119/convert+a+web+page+or+html+to+markdown?url=https://en.wikipedia.org/wiki/Markdown&mode=article&outputFormat=markdown&keepLinks=1&maxChars=200000&chunkSize=OptionalchunkOverlap=Optional' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求
将 JSON 请求正文中的 HTML 转换为 Markdown:将 JSON 请求正文中发送的 HTML 转换为简洁的 Markdown,保留文章正文、真实表格和绝对链接。适用于 LLM 和 RAG 流程
Endpoint ID: 45120
POST https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45120/convert+html+from+a+json+body+to+markdown
输入参数

将 JSON 正文中的 HTML 转换为 Markdown — 端点功能

对象 描述
outputFormat 可选 What to return: markdown, text or both. Default markdown.
请求体 必需 Json

剩余免费测试请求:3 / 3。


输入参数

outputFormat
API 示例响应
JSON
{
    "url": null,
    "finalUrl": null,
    "ok": true,
    "error": null,
    "httpStatus": null,
    "title": "Sample page",
    "description": null,
    "language": null,
    "canonicalUrl": null,
    "author": null,
    "publishedAt": null,
    "siteName": null,
    "mode": "full",
    "charCount": 171,
    "wordCount": 27,
    "tableCount": 0,
    "linkCount": 1,
    "truncated": false,
    "markdown": "# Pricing guide\n\nThis is a short sample article with enough text to be converted. It has a [link](https://example.com) and a list:\n\n- First item\n- Second item\n- Third item",
    "text": null
}
将 JSON 正文中的 HTML 转换为 Markdown — 代码片段

curl --location --request POST 'https://zylalabs.com/api/16016/document+to+text+and+markdown+api+-+pdf+office+html/45120/convert+html+from+a+json+body+to+markdown?outputFormat=markdown' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' 

--data-raw '{"html":"Sample page

Pricing guide

This is a short sample article with enough text to be converted. It has a link and a list:

  • First item
  • Second item
  • Third item
","outputFormat":"markdown"}'

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 文档转文本和 Markdown API - PDF Office HTML API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。

标头
标头 描述
授权 必需 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。

起价
$10,000/年


  • 自定义数量
  • 自定义速率限制
  • 专业客户支持
  • 实时 API 监控

概览

将 PDF、Office 文件(DOCX、PPTX、XLSX、ODT、ODP、ODS)和网页转换为干净的文本或 Markdown,用于 LLM、RAG 和搜索流程 乐彩

文档转文本和 Markdown API - PDF Office HTML API FAQs

它会返回提取的文本以及 PDF 元数据和处理详情,包括页数、已提取页数、标题、作者、创建和修改日期、字符数、词数以及是否被截断。PDF 中无法获取的元数据可能为 null

使用任一 PDF 端点上的可选页面范围参数来请求特定页面,而非整个文档。响应会报告文档的总页数 pageCount 以及实际提取的页数 pagesExtracted 乐彩

检查 ok 以确定提取是否成功;如果有错误,error 会提供失败详情。truncated 表示返回的文本是否被截断。使用 charCount 和 wordCount 评估提取内容的数量。

该 API 支持 Word、PowerPoint、Excel 和 OpenDocument 格式:DOCX、PPTX、XLSX、ODT、ODP 和 ODS。响应会标明检测到的格式,并可能在适用时包含幻灯片或工作表数量。

JSON 正文 Office 端点接受 outputFormat 参数以请求 Markdown、纯文本或两者兼有。响应使用 markdown 和 text 字段;未请求的格式可能为 null。Markdown 可以保留文档结构,例如表格、幻灯片标题和演讲者备注

这些字段报告演示文稿中的幻灯片数量或电子表格中的工作表数量(如适用)对于不适用的格式,另一个字段可能为 null 响应还包括 fileName、format、fileSizeBytes 和文本长度统计信息

响应可以包含页面标题、描述、语言、规范网址、作者、发布日期、网站名称、HTTP 状态以及表格数量和链接数量等内容计数。如果来源未提供相关信息,字段可能为 null

模式表示转换方式,例如以文章为重点或转换完整页面内容。URL 端点可以选择保留链接和图片,并将长页面拆分为多个块。对于以 JSON 提交的 HTML,响应可以在 Markdown 中包含绝对链接

一般常见问题

Zyla API Hub 就像一个大型 API 商店,您可以在一个地方找到数千个 API。我们还为所有 API 提供专门支持和实时监控。注册后,您可以选择要使用的 API。请记住,每个 API 都需要自己的订阅。但如果您订阅多个 API,您将为所有这些 API 使用相同的密钥,使事情变得更简单。
价格以 USD(美元)、EUR(欧元)、CAD(加元)、AUD(澳元)和 GBP(英镑)列出。我们接受所有主要的借记卡和信用卡。我们的支付系统使用最新的安全技术,由 Stripe 提供支持,Stripe 是世界上最可靠的支付公司之一。如果您在使用卡片付款时遇到任何问题,请通过 [email protected]

此外,如果您已经以这些货币中的任何一种(USD、EUR、CAD、AUD、GBP)拥有有效订阅,该货币将保留用于后续订阅。只要您没有任何有效订阅,您可以随时更改货币。
定价页面上显示的本地货币基于您 IP 地址的国家/地区,仅供参考。实际价格以 USD(美元)为单位。当您付款时,即使您在我们的网站上看到以本地货币显示的等值金额,您的卡片对账单上也会以美元显示费用。这意味着您不能直接使用本地货币付款。
有时,银行可能会因其欺诈保护设置而拒绝收费。我们建议您首先联系您的银行,检查他们是否阻止了我们的收费。此外,您可以访问账单门户并更改关联的卡片以进行付款。如果这些方法不起作用并且您需要进一步帮助,请通过 [email protected]
价格由月度或年度订阅决定,具体取决于所选计划。
API 调用根据成功请求从您的计划中扣除。每个计划都包含您每月可以进行的特定数量的调用。只有成功的调用(由状态 200 响应指示)才会计入您的总数。这确保失败或不完整的请求不会影响您的月度配额。
Zyla API Hub 采用月度订阅系统。您的计费周期将从您购买付费计划的那一天开始,并在下个月的同一日期续订。因此,如果您想避免未来的费用,请提前取消订阅。
要升级您当前的订阅计划,只需转到 API 的定价页面并选择您要升级到的计划。升级将立即生效,让您立即享受新计划的功能。请注意,您之前计划中的任何剩余调用都不会转移到新计划,因此在升级时请注意这一点。您将被收取新计划的全部金额。
要检查您本月剩余多少 API 调用,请参考响应标头中的 "X-Zyla-API-Calls-Monthly-Remaining" 字段。例如,如果您的计划允许每月 1,000 个请求,而您已使用 100 个,则响应标头中的此字段将显示 900 个剩余调用。
要查看您的计划允许的最大 API 请求数,请检查 "X-Zyla-RateLimit-Limit" 响应标头。例如,如果您的计划包括每月 1,000 个请求,此标头将显示 1,000。
"X-Zyla-RateLimit-Reset" 标头显示您的速率限制重置之前的秒数。这告诉您何时您的请求计数将重新开始。例如,如果它显示 3,600,则意味着还有 3,600 秒直到限制重置。
是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。
为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。
7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。
当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。
付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。
您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

相关 API