Extract article text
diffbot.x.extract-articleExtracts clean article text, author, date, images, tags, sentiment and NLP facts from a news or blog page
- Price
- $0.001196/callAu prix du fournisseur
- Success rate
- 100 %Last 30 days · 57 calls
- Latency p50
- 3.6 sp95 6.6 s
- Last verified
- 28 juil. 2026Verified working
GEThttps://toolswitch.dev/v1/tools/diffbot.x.extract-article?url=https%3A%2F%2Fwww.technologyreview.com%2F2020%2F09%2F04%2F1008156%2Fknowledge-graph-ai-reads-web-machine-learning-natural-language-processing%2FPreview- Uses platform quota
- Synchronous response
- Reads public data
Paramètres
different HOST than base_url — api.diffbot.com, not kg.diffbot.com
| Paramètre | Type | Obligatoire | Description | Exemple |
|---|---|---|---|---|
| Paramètres de requête | ||||
url | chaîne | Obligatoire | target URL to extract | https://www.technologyreview.com/2020/09/04/1008156/knowledge-graph-ai-reads-web-machine-learning-natural-language-processing/ |
proxy | chaîne | Facultatif | ||
fields | chaîne | Facultatif | comma-delimited optional fields: links, extlinks, meta, querystring, breadcrumb, quotes | |
paging | booléen | Facultatif | pass false to disable automatic concatenation of multi-page articles | true |
scroll | chaîne | Facultatif | 'slow' or 'fast' — triggers lazy-loaded content | |
maxTags | entier | Facultatif | max automatically-generated tags to return | 10 |
timeout | entier | Facultatif | 30000 | |
callback | chaîne | Facultatif | ||
useProxy | chaîne | Facultatif | 'default' = datacenter proxy (2 credits/page); 'none' disables | |
proxyAuth | chaîne | Facultatif | ||
discussion | booléen | Facultatif | pass false to disable automatic comment extraction | true |
renderDelay | entier | Facultatif | extra rendering ms before DOM extraction, max 180000 | |
tagConfidence | nombre | Facultatif | minimum tag relevance score 0.0-1.0 | 0.5 |
naturalLanguage | chaîne | Facultatif | run text through the NLP API: entities, sentiment, summary, facts, etc. | |
categoryConfidence | nombre | Facultatif | minimum category relevance score 0.0-1.0 | 0.5 |
summaryNumSentences | entier | Facultatif | max sentences in the generated summary | 3 |
- Paramètres de requête
urlchaîneObligatoiretarget URL to extract
Exemple :
https://www.technologyreview.com/2020/09/04/1008156/knowledge-graph-ai-reads-web-machine-learning-natural-language-processing/proxychaîneFacultatiffieldschaîneFacultatifcomma-delimited optional fields: links, extlinks, meta, querystring, breadcrumb, quotes
pagingbooléenFacultatifpass false to disable automatic concatenation of multi-page articles
Exemple :
truescrollchaîneFacultatif'slow' or 'fast' — triggers lazy-loaded content
maxTagsentierFacultatifmax automatically-generated tags to return
Exemple :
10timeoutentierFacultatifExemple :
30000callbackchaîneFacultatifuseProxychaîneFacultatif'default' = datacenter proxy (2 credits/page); 'none' disables
proxyAuthchaîneFacultatifdiscussionbooléenFacultatifpass false to disable automatic comment extraction
Exemple :
truerenderDelayentierFacultatifextra rendering ms before DOM extraction, max 180000
tagConfidencenombreFacultatifminimum tag relevance score 0.0-1.0
Exemple :
0.5naturalLanguagechaîneFacultatifrun text through the NLP API: entities, sentiment, summary, facts, etc.
categoryConfidencenombreFacultatifminimum category relevance score 0.0-1.0
Exemple :
0.5summaryNumSentencesentierFacultatifmax sentences in the generated summary
Exemple :
3
Exemples de code
Remplacez $TOOLSWITCH_KEY par la clé créée dans la console.
curl -X GET 'https://toolswitch.dev/v1/tools/diffbot.x.extract-article?url=https%3A%2F%2Fwww.technologyreview.com%2F2020%2F09%2F04%2F1008156%2Fknowledge-graph-ai-reads-web-machine-learning-natural-language-processing%2F' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/diffbot.x.extract-article?url=https%3A%2F%2Fwww.technologyreview.com%2F2020%2F09%2F04%2F1008156%2Fknowledge-graph-ai-reads-web-machine-learning-natural-language-processing%2F",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/diffbot.x.extract-article?url=https%3A%2F%2Fwww.technologyreview.com%2F2020%2F09%2F04%2F1008156%2Fknowledge-graph-ai-reads-web-machine-learning-natural-language-processing%2F", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());Cette API de passerelle est en préversion ; son URL et son authentification peuvent changer. Les paramètres de l’exemple sont des données fictives. Les appels sont facturés à $0.001196/call, frais de service inclus.