HTML 和 URL 转换为 PDF API

使用此API将您的HTML代码或URL内容转换为PDF 快速可靠
通过 MCP 从您的 AI 代理使用此 API
支持 OpenClaw、Claude Code/Desktop、Cursor、Windsurf、Cline 以及任何兼容 MCP 的 AI 客户端。
文档和设置
通过封装此 MCP 创建技能: https://mcp.zylalabs.com/mcp?apikey=YOUR_ZYLA_API_KEY

关于API:

此API将允许您动态生成PDF文件以存储和显示您想要的任何HTML。同时,您可以传递一个URL并接收该内容的PDF,以便您可以检查其中的内容。

 

此API接收什么,以及您的API提供什么(输入/输出)?

此API将接收您想要解析为PDF的HTML代码或一个URL。您将收到一个链接以便稍后下载您的PDF文件。

 

这个API最常见的用例是什么?

 
 
展示和您的HTML代码:

此API将允许您对您的HTML代码进行可视化展示。非常适合在会议或与其他希望看到页面在浏览器中如何显示的团队进行演示。

存储和比较网页:

此API为您提供了将任何页面内容提取为PDF文件的可能性。您可以存储这些信息,并检查其他网页在浏览器中如何显示。此外,您可以下载网页的不同阶段以进行比较。

 

您的计划是否有任何限制?

除了每月的API调用次数之外,没有其他限制。

API 文档

端点


传递您想要转换为PDF文件的URL。接收一个链接以下载PDF文件



                                                                            
GET https://zylalabs.com/api/138/html+and+url+to+pdf+api/180/url+to+pdf
                                                                            
                                                                        

URL到PDF - 端点功能

对象 描述
url [必需]
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        https://cdn.opq.to/pdfs/3c3496c6f68e79e6b971fb702f766d5f.pdf
                                                                                                                                                                                                                    
                                                                                                    

URL到PDF - 代码片段


curl --location --request GET 'https://zylalabs.com/api/138/html+and+url+to+pdf+api/180/url+to+pdf?url=https://zylalabs.com' --header 'Authorization: Bearer YOUR_API_KEY' 


    

传递您想要转换为 PDF 的 HTML。收到链接以稍后下载 PDF 文件



                                                                            
POST https://zylalabs.com/api/138/html+and+url+to+pdf+api/181/html+to+pdf
                                                                            
                                                                        

HTML到PDF - 端点功能

对象 描述
html [必需]
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="nvIeN1mkSK3y5TSJf3RKalfVFFfve03dFfRsoUIb">

        <title>OneSimpleApi.com</title>
        <meta data-vmid="description" name="description" content="The first API toolkit designed to save you time, money and stress. A toolbox with all the things you need to get your project to success: PDF generation, Currency Exchange, QR codes, SEO Metadata, Screenshots, and more.">

        <!-- og -->
        <meta name="og:locale" property="og:locale" content="en_US" />
        <meta property="og:type" content="website" />

        <meta data-vmid="og_title" property="og:title" content="OneSimpleApi.com" />
        <meta data-vmid="og_description" property="og:description" content="The first API toolkit designed to save you time, money and stress. A toolbox with all the things you need to get your project to success: PDF generation, Currency Exchange, QR codes, SEO Metadata, Screenshots, and more." />
        <meta property="og:image" content="https://onesimpleapi.com/api/screenshot?token=mRAmvwlKc5Tj1Rz54bLPIV5PHlebDaAAQxej3Tx2&output=redirect&url=https%3A%2F%2Fonesimpleapi.com%2Flogin%2F%3Fv%3D1.1" />

        <meta property="og:url" content="https://onesimpleapi.com/login" />
        <meta property="og:site_name" content="OneSimpleApi.com" />

        <!-- twitter card -->
        <meta name="twitter:card" content="summary_large_image"/>

        <meta data-vmid="twitter_title" name="twitter:title" content="OneSimpleApi.com"/>
        <meta data-vmid="twitter_description" name="twitter:description" content="The first API toolkit designed to save you time, money and stress. A toolbox with all the things you need to get your project to success: PDF generation, Currency Exchange, QR codes, SEO Metadata, Screenshots, and more."/>
        <meta name="twitter:image" content="https://onesimpleapi.com/api/screenshot?token=mRAmvwlKc5Tj1Rz54bLPIV5PHlebDaAAQxej3Tx2&output=redirect&url=https%3A%2F%2Fonesimpleapi.com%2Flogin%2F%3Fv%3D1.1" />

        <meta name="twitter:creator" content="@OneSimpleApi"/>
        <meta name="twitter:site" content="@OneSimpleApi"/>

        <link rel="canonical" href="https://onesimpleapi.com/login">

        <!-- Fonts -->
        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">

        <!-- Styles -->
        <link rel="stylesheet" href="/css/app.css?id=1a6479e77d9663d906b98af618b741c2">

        <link rel="icon" href="/favicon.ico" type="image/x-icon"/>
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>

        <!-- Scripts -->
        <script type="text/javascript">
    const Ziggy = {"url":"https:\/\/onesimpleapi.com","port":null,"defaults":{},"routes":{"ignition.healthCheck":{"uri":"_ignition\/health-check","methods":["GET","HEAD"]},"ignition.executeSolution":{"uri":"_ignition\/execute-solution","methods":["POST"]},"ignition.shareReport":{"uri":"_ignition\/share-report","methods":["POST"]},"ignition.scripts":{"uri":"_ignition\/scripts\/{script}","methods":["GET","HEAD"]},"ignition.styles":{"uri":"_ignition\/styles\/{style}","methods":["GET","HEAD"]},"cashier.payment":{"uri":"stripe\/payment\/{id}","methods":["GET","HEAD"]},"webhook":{"uri":"stripe\/webhook","methods":["POST"]},"login":{"uri":"login","methods":["GET","HEAD"]},"logout":{"uri":"logout","methods":["POST"]},"password.request":{"uri":"forgot-password","methods":["GET","HEAD"]},"password.reset":{"uri":"reset-password\/{token}","methods":["GET","HEAD"]},"password.email":{"uri":"forgot-password","methods":["POST"]},"password.update":{"uri":"reset-password","methods":["POST"]},"register":{"uri":"register","methods":["GET","HEAD"]},"verification.notice":{"uri":"email\/verify","methods":["GET","HEAD"]},"verification.verify":{"uri":"email\/verify\/{id}\/{hash}","methods":["GET","HEAD"]},"verification.send":{"uri":"email\/verification-notification","methods":["POST"]},"user-profile-information.update":{"uri":"user\/profile-information","methods":["PUT"]},"user-password.update":{"uri":"user\/password","methods":["PUT"]},"password.confirmation":{"uri":"user\/confirmed-password-status","methods":["GET","HEAD"]},"password.confirm":{"uri":"user\/confirm-password","methods":["POST"]},"two-factor.login":{"uri":"two-factor-challenge","methods":["GET","HEAD"]},"two-factor.enable":{"uri":"user\/two-factor-authentication","methods":["POST"]},"two-factor.confirm":{"uri":"user\/confirmed-two-factor-authentication","methods":["POST"]},"two-factor.disable":{"uri":"user\/two-factor-authentication","methods":["DELETE"]},"two-factor.qr-code":{"uri":"user\/two-factor-qr-code","methods":["GET","HEAD"]},"two-factor.secret-key":{"uri":"user\/two-factor-secret-key","methods":["GET","HEAD"]},"two-factor.recovery-codes":{"uri":"user\/two-factor-recovery-codes","methods":["GET","HEAD"]},"horizon.stats.index":{"uri":"horizon\/api\/stats","methods":["GET","HEAD"]},"horizon.workload.index":{"uri":"horizon\/api\/workload","methods":["GET","HEAD"]},"horizon.masters.index":{"uri":"horizon\/api\/masters","methods":["GET","HEAD"]},"horizon.monitoring.index":{"uri":"horizon\/api\/monitoring","methods":["GET","HEAD"]},"horizon.monitoring.store":{"uri":"horizon\/api\/monitoring","methods":["POST"]},"horizon.monitoring-tag.paginate":{"uri":"horizon\/api\/monitoring\/{tag}","methods":["GET","HEAD"]},"horizon.monitoring-tag.destroy":{"uri":"horizon\/api\/monitoring\/{tag}","methods":["DELETE"],"wheres":{"tag":".*"}},"horizon.jobs-metrics.index":{"uri":"horizon\/api\/metrics\/jobs","methods":["GET","HEAD"]},"horizon.jobs-metrics.show":{"uri":"horizon\/api\/metrics\/jobs\/{id}","methods":["GET","HEAD"]},"horizon.queues-metrics.index":{"uri":"horizon\/api\/metrics\/queues","methods":["GET","HEAD"]},"horizon.queues-metrics.show":{"uri":"horizon\/api\/metrics\/queues\/{id}","methods":["GET","HEAD"]},"horizon.jobs-batches.index":{"uri":"horizon\/api\/batches","methods":["GET","HEAD"]},"horizon.jobs-batches.show":{"uri":"horizon\/api\/batches\/{id}","methods":["GET","HEAD"]},"horizon.jobs-batches.retry":{"uri":"horizon\/api\/batches\/retry\/{id}","methods":["POST"]},"horizon.pending-jobs.index":{"uri":"horizon\/api\/jobs\/pending","methods":["GET","HEAD"]},"horizon.completed-jobs.index":{"uri":"horizon\/api\/jobs\/completed","methods":["GET","HEAD"]},"horizon.silenced-jobs.index":{"uri":"horizon\/api\/jobs\/silenced","methods":["GET","HEAD"]},"horizon.failed-jobs.index":{"uri":"horizon\/api\/jobs\/failed","methods":["GET","HEAD"]},"horizon.failed-jobs.show":{"uri":"horizon\/api\/jobs\/failed\/{id}","methods":["GET","HEAD"]},"horizon.retry-jobs.show":{"uri":"horizon\/api\/jobs\/retry\/{id}","methods":["POST"]},"horizon.jobs.show":{"uri":"horizon\/api\/jobs\/{id}","methods":["GET","HEAD"]},"horizon.index":{"uri":"horizon\/{view?}","methods":["GET","HEAD"],"wheres":{"view":"(.*)"}},"terms.show":{"uri":"terms-of-service","methods":["GET","HEAD"]},"policy.show":{"uri":"privacy-policy","methods":["GET","HEAD"]},"profile.show":{"uri":"user\/profile","methods":["GET","HEAD"]},"other-browser-sessions.destroy":{"uri":"user\/other-browser-sessions","methods":["DELETE"]},"current-user-photo.destroy":{"uri":"user\/profile-photo","methods":["DELETE"]},"current-user.destroy":{"uri":"user","methods":["DELETE"]},"api-tokens.index":{"uri":"user\/api-tokens","methods":["GET","HEAD"]},"api-tokens.store":{"uri":"user\/api-tokens","methods":["POST"]},"api-tokens.update":{"uri":"user\/api-tokens\/{token}","methods":["PUT"]},"api-tokens.destroy":{"uri":"user\/api-tokens\/{token}","methods":["DELETE"]},"billing-portal.portal":{"uri":"user\/billing\/portal","methods":["GET","HEAD"]},"billing-portal.subscription.plan-subscribe":{"uri":"user\/billing\/subscription\/subscribe\/{plan}","methods":["POST"]},"billing-portal.subscription.plan-swap":{"uri":"user\/billing\/subscription\/swap\/{plan}","methods":["POST"]},"billing-portal.subscription.resume":{"uri":"user\/billing\/subscription\/resume","methods":["POST"]},"billing-portal.subscription.cancel":{"uri":"user\/billing\/subscription\/cancel","methods":["POST"]},"billing-portal.payment-method.default":{"uri":"user\/billing\/payment-method\/{payment_method}\/set-default","methods":["POST"]},"billing-portal.invoice.index":{"uri":"user\/billing\/invoice","methods":["GET","HEAD"]},"billing-portal.payment-method.index":{"uri":"user\/billing\/payment-method","methods":["GET","HEAD"]},"billing-portal.payment-method.create":{"uri":"user\/billing\/payment-method\/create","methods":["GET","HEAD"]},"billing-portal.payment-method.store":{"uri":"user\/billing\/payment-method","methods":["POST"]},"billing-portal.payment-method.show":{"uri":"user\/billing\/payment-method\/{payment_method}","methods":["GET","HEAD"]},"billing-portal.payment-method.destroy":{"uri":"user\/billing\/payment-method\/{payment_method}","methods":["DELETE"]},"billing-portal.subscription.index":{"uri":"user\/billing\/subscription","methods":["GET","HEAD"]},"home":{"uri":"\/","methods":["GET","HEAD"]},"security.show":{"uri":"security-policy","methods":["GET","HEAD"]},"home.price":{"uri":"price","methods":["GET","HEAD"]},"feedback":{"uri":"feedback","methods":["GET","HEAD"]},"sitemap.index":{"uri":"sitemap.xml","methods":["GET","HEAD"]},"site.show":{"uri":"site\/{page}","methods":["GET","HEAD"],"bindings":{"page":"slug"}},"docs.show":{"uri":"docs\/{doc}","methods":["GET","HEAD"],"bindings":{"doc":"slug"}},"blog.show":{"uri":"blog\/{post}","methods":["GET","HEAD"],"bindings":{"post":"slug"}},"blog.index":{"uri":"blog","methods":["GET","HEAD"]},"docs.index":{"uri":"docs","methods":["GET","HEAD"]},"posts.index":{"uri":"posts","methods":["GET","HEAD"]},"posts.create":{"uri":"posts\/create","methods":["GET","HEAD"]},"posts.store":{"uri":"posts","methods":["POST"]},"posts.show":{"uri":"posts\/{post}","methods":["GET","HEAD"],"bindings":{"...
                                                                                                                                                                                                                    
                                                                                                    

HTML到PDF - 代码片段


curl --location --request POST 'https://zylalabs.com/api/138/html+and+url+to+pdf+api/181/html+to+pdf?html=%3Cbody%3E%3Ch1%3EHello%20World!%3C%2Fh1%3E%3C%2Fbody%3E' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 HTML 和 URL 转换为 PDF API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
标头
标头 描述
授权 [必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

简单透明的定价

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

🚀 企业版

起价
$ 10,000/年


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

客户喜爱的功能

  • ✔︎ 仅支付成功请求
  • ✔︎ 7 天免费试用
  • ✔︎ 多语言支持
  • ✔︎ 一个 API 密钥,所有 API。
  • ✔︎ 直观的仪表板
  • ✔︎ 全面的错误处理
  • ✔︎ 开发者友好的文档
  • ✔︎ Postman 集成
  • ✔︎ 安全的 HTTPS 连接
  • ✔︎ 可靠的正常运行时间

HTML 和 URL 转换为 PDF API FAQs

GET URL到PDF端点返回生成的PDF文件的直接链接 POST HTML到PDF端点也返回从提供的HTML内容创建的PDF文件的链接

响应数据的主要字段是生成的PDF文件的URL链接。此链接可用于下载PDF

GET URL到PDF端点需要一个参数:要转换的URL POST HTML到PDF端点需要要转换为PDF的HTML内容

响应数据被结构化为一个JSON对象,其中包含一个字段,链接到生成的PDF。这使得访问和检索PDF文件变得简单

两个端点提供对网页内容的PDF表示的访问 GET端点转换实时网页,而POST端点将自定义HTML代码转换为PDF

用户可以通过为GET端点提供不同的URL或为POST端点提供不同的HTML内容来自定义请求,从而根据特定需求生成定制的PDF输出

常见的用例包括生成文档的PDF 创建网页的视觉表示以用于演示以及归档网页内容以便进行时间比较

API直接从HTML或URL生成PDF,确保输出反映内容的最新版本 定期更新和质量检查有助于保持准确性

一般常见问题

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 秒直到限制重置。

是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。

您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。

7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。

当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。

付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。


相关 API


您可能还喜欢