{
"ok": true,
"data": {
"original": "Café au Lait & Crème Brûlée!",
"slug": "cafe-au-lait-creme-brulee"
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39176/generate+a+url+slug' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"Café au Lait & Crème Brûlée!"}'
{
"ok": true,
"data": {
"original": "hello world example",
"type": "camel",
"result": "helloWorldExample"
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39177/convert+identifier+or+title+case' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"hello world example","type":"camel"}'
{
"ok": true,
"data": {
"characters": 23,
"charactersNoSpaces": 18,
"words": 6,
"sentences": 1,
"paragraphs": 1,
"syllables": 6,
"averageWordsPerSentence": 6,
"averageSyllablesPerWord": 1,
"fleschReadingEase": 116.15,
"fleschKincaidGrade": -1.45,
"readingTimeMinutes": 0.03,
"note": "Flesch scores use an English syllable heuristic. They are estimates, not a human readability assessment."
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39178/count+words+characters+sentences+and+paragraphs' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"The cat sat on the mat."}'
{
"ok": true,
"data": {
"characters": 23,
"charactersNoSpaces": 18,
"words": 6,
"sentences": 1,
"paragraphs": 1,
"syllables": 6,
"averageWordsPerSentence": 6,
"averageSyllablesPerWord": 1,
"fleschReadingEase": 116.15,
"fleschKincaidGrade": -1.45,
"readingTimeMinutes": 0.03,
"note": "Flesch scores use an English syllable heuristic. They are estimates, not a human readability assessment."
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39179/flesch+readability+scores' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"The cat sat on the mat."}'
{
"ok": true,
"data": {
"html": "<h1>Title</h1>\n<p>A <strong>bold</strong> line with a <a href=\"https://example.com\" rel=\"nofollow noopener noreferrer\">link</a>.</p>",
"note": "A conservative CommonMark-inspired subset: headings, lists, quotes, fenced code, emphasis, links (http/https/mailto only), and strikethrough. Raw HTML is escaped, not executed."
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39180/convert+markdown+to+html' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"markdown":"# Title\n\nA **bold** line with a [link](https://example.com)."}'
{
"ok": true,
"data": {
"emails": [
"[email protected]"
],
"urls": [
"https://example.com/docs"
],
"hashtags": [
"UtilityAPI"
]
}
}
curl --location --request POST 'https://zylalabs.com/api/14954/text+slugify+and+readability+api/39181/extract+text+data' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"Email [email protected] and see https://example.com/docs. Tagged #UtilityAPI."}'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 文本缩略和可读性 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
它对常见的拉丁字母进行音译,然后应用Unicode NFKD以去除重音。例如,Café au Lait & Crème Brûlée!变为cafe-au-lait-creme-brulee,而Straße变为strasse
不 它们是来自英语音节启发式的估计 这些估计不适合非英语散文的文本 也不是人类可读性评估
标题 段落 列表 块引用 水平规则 围栏代码 粗体 斜体 删除线 和 链接 表格 脚注 和 原始 HTML 不支持 原始 HTML 被转义
不 只有http https和mailto目标被保留 其他方案包括javascript:被删除 链接标签保持为纯文本
骆驼 Pascal 蛇 烤肉串 常量 标题 句子 大写 小写
电子邮件 以http或https开头的URL 以及标签 您可以使用kind数组请求任何子集 会去除重复项
是的 每个文本字段限制为20,000个字符 JSON主体最多为32 KiB 更大的主体返回HTTP 413
每个端点返回一个包含状态指示符(`ok`)和包含特定信息的`data`字段的JSON对象。例如,slugify端点返回原始文本和生成的slug,而可读性端点返回诸如字数和Flesch分数等指标
关键字段包括 `original`(输入文本),`slug`(生成的缩略名),`characters`,`words`,`sentences`,`syllables`,以及可读性分数如 `fleschReadingEase`。每个端点都有与其功能相关的特定字段
Slugify 端点接受参数,如 `separator`(自定义 slug 分隔符),`lowercase`(强制小写),`strict mode`(限制字符使用)和 `maxLength`(设置 slug 的最大长度)
响应数据结构为一个JSON对象,包含两个主要字段:`ok`,表示成功,和`data`,其中包含相关输出。例如,Markdown转换端点中的`data`字段包括生成的HTML和关于支持功能的说明
可读性端点提供了总字符数、单词数、句子数、段落数、音节数、每句平均单词数、每个单词的平均音节数以及Flesch可读性评分等指标,帮助评估文本复杂性
用户可以通过使用 `kinds` 数组指定要提取的数据类型(电子邮件、网址、标签)来自定义请求。这使得可以根据用户需求进行有针对性的提取,从而确保结果的相关性
典型的用例包括将用户生成的内容从Markdown转换为HTML以便在网页上显示 确保文本安全渲染以及转义原始HTML以防止执行 使其适合博客文章或文档
用户可以利用返回的指标,如字数和Flesch分数,来评估文本的可读性和结构。这些信息对希望针对特定受众或平台优化写作的内容创作者非常有用