{
"url": "https://paulgraham.com/hwh.html",
"title": "How to Work Hard",
"byline": null,
"published_time": null,
"site_name": null,
"lang": null,
"description": null,
"image": null,
"excerpt": "June 2021\n\nIt might not seem there's much to learn about how to work hard. Anyone who's been to school knows what it entails, even if they chose not to do it. There are 12 year olds who work amazingly hard. And yet when I ask if I know more about working hard now than when I was…",
"word_count": 3313,
"reading_time_min": 14,
"truncated": true,
"markdown": "June 2021\n\nIt might not seem there's much to learn about how to work hard. Anyone who's been to school knows what it entails, even if they chose not to do it. There are 12 year olds who work amazingly hard. And yet when I ask if I know more about working hard now than when I was in school, the answer is definitely yes.\n\nOne thing I know is that if you want to do great things, you'll have to work v",
"text": "June 2021\n\nIt might not seem there's much to learn about how to work hard. Anyone who's been to school knows what it entails, even if they chose not to do it. There are 12 year olds who work amazingly hard. And yet when I ask if I know more about working hard now than when I was in school, the answer is definitely yes.\n\nOne thing I know is that if you want to do great things, you'll have to work v",
"status": 200,
"content_type": "text/html"
}
curl --location --request GET 'https://zylalabs.com/api/14315/article+extractor+and+url+to+markdown+api/35883/extract+article?url=https://paulgraham.com/hwh.html&max_chars=400' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 文章提取器和网址转Markdown API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
提取文章端点返回文章的主要内容,包括干净的Markdown和纯文本,以及元数据,例如标题、作者、发布时间、网站名称、语言、图像、字数和阅读时间
响应中的关键字段包括“url”“title”“byline”“published_time”“site_name”“lang”“description”“image”“word_count”和“reading_time_min”提供了关于文章的全面细节
用户可以通过在GET请求中指定文章URL来定制他们的请求。API处理该URL以提取相关内容和元数据,确保根据提供的链接生成定制的输出
典型的用例包括将文章转换为大型语言模型 整合内容到检索增强生成系统 为读者创建摘要 生成干净的文本以便进行进一步分析或展示而不受广告或评论等干扰
它读取服务器发送的HTML,并不运行JavaScript。这涵盖了服务器渲染的网站:新闻、博客、文档、GitHub、维基百科以及大多数预渲染的Next.js/Nuxt网站。仅在浏览器中生成内容的页面可能返回很少或没有文本;这些返回502 "empty_content"而不是空的200,因此您不会被收费
您得到的正是网站公开提供的内容 API 不会绕过付费墙 登录或验证码 如果网站拒绝请求(401/403/429/451)或提供机器人挑战页面 您将收到502 "upstream_blocked" 和网站的upstream_status 因为这不是200 这不会计入您的计划
您的Zyla计划设置了每月配额和速率限制(请参阅定价标签;为期7天的试用包括50次调用) 只有成功的调用才算数 响应头x-zyla-api-calls-monthly-remaining和X-Zyla-RateLimit-Reset显示剩余调用次数和限制重置时间 后端运行在全球边缘网络上并支持并行处理突发情况
格式=both(默认)返回 markdown 和文本格式格式=markdown 仅返回 Markdown(标题 列表 块引用 代码块 绝对 URL 的链接)格式=text 仅返回纯文本 使用 links=false 删除链接标记 images=true 保留图片 每个响应包括标题 byline 发布时间 网站名称 语言 描述 图片 摘要 单词计数 和阅读时间(分钟)
Max_chars=N 将 markdown 和文本切割为最多 N 个字符,并将 truncated 设置为 true word_count 和 reading_time_min 仍然描述完整文章,因此您知道跳过了多少内容 使用它来适应 LLM 上下文预算 例如 max_chars=8000 大约是 2k tokens 0 或省略意味着没有限制
所有错误都是非2xx JSON,只有200响应会被收费 400:无效或缺失的URL,被阻止的地址(localhost或私有IP,包括通过重定向)或格式错误 415:目标不是HTML或文本(例如PDF或图像) 502 upstream_blocked:网站拒绝或挑战请求 502 empty_content:提取的内容约为0字 502 fetch_failed:网站无法访问或超时(10秒) 401:缺少或无效的Zyla密钥 502主体类似于{error:upstream_blocked,upstream_status:403}