Extract entities and sentiment
diffbot.x.nl-processRuns a pre-trained classifier, named-entity recognizer, sentence tokenizer and sentiment analyzer over submitted text or a URL
- 价格
- $0.000001/result按供应商原价
- 成功率
- 100%近 30 天 · 15 次
- 延迟 p50
- 530 毫秒p95 12 秒
- 最后验证
- 2026年7月28日实测可用
POSThttps://toolswitch.dev/v1/tools/diffbot.x.nl-process?fields=entities%2Csentiment预览在线试用即将上线供应商文档 ↗
- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
different HOST than base_url — nl.diffbot.com. content-type header may be application/json (default) or application/x-www-form-urlencoded. Token rides in the QUERY STRING as documented — putting it in the JSON body instead 401s
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
fields | 字符串 | 可选 | comma-delimited: entities, sentiment, facts, records, categories, sentences, language, summary | entities,sentiment |
- 查询参数
fields字符串可选comma-delimited: entities, sentiment, facts, records, categories, sentences, language, summary
示例:
entities,sentiment
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
预览
curl -X POST 'https://toolswitch.dev/v1/tools/diffbot.x.nl-process?fields=entities%2Csentiment' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
-H "Content-Type: application/json" \
--data-raw '{"content":"Diffbot builds a knowledge graph of the web."}'import os
import json
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/diffbot.x.nl-process?fields=entities%2Csentiment",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
json=json.loads("{\"content\":\"Diffbot builds a knowledge graph of the web.\"}"),
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/diffbot.x.nl-process?fields=entities%2Csentiment", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
"Content-Type": "application/json",
},
body: JSON.stringify(JSON.parse("{\"content\":\"Diffbot builds a knowledge graph of the web.\"}")),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.000001/result 计费,已含服务费。