Auto-detect a page type and extract it by URL
diffbot.x.extract-analyzeAutomatically identifies the type of page being processed and routes it through the relevant Diffbot API
- Price
- $0.001196/callPelo preço do provedor
- Success rate
- 99,9%Last 30 days · 7.365 calls
- Latency p50
- 2.6 sp95 24 s
- Last verified
- 28 de jul. de 2026Verified working
GEThttps://toolswitch.dev/v1/tools/diffbot.x.extract-analyze?url=https%3A%2F%2Fwww.diffbot.com%2Fproducts%2Fextract%2FPreview- Uses platform quota
- Synchronous response
- Reads public data
Parâmetros
different HOST than base_url — api.diffbot.com, not kg.diffbot.com
| Parâmetro | Tipo | Obrigatório | Descrição | Exemplo |
|---|---|---|---|---|
| Parâmetros de consulta | ||||
url | string | Obrigatório | target URL to extract, URL-encoded | https://www.technologyreview.com/2020/09/04/1008156/knowledge-graph-ai-reads-web-machine-learning-natural-language-processing/ |
mode | string | Opcional | restrict extraction to one page type: article, product, discussion, image, video, list, event | |
proxy | string | Opcional | custom proxy IP for fetching the target page | |
fields | string | Opcional | comma-delimited optional fields: links, extlinks, meta, querystring, breadcrumb | |
scroll | string | Opcional | 'slow' or 'fast' — triggers lazy-loaded content | |
timeout | inteiro | Opcional | ms to wait for content retrieval | 30000 |
callback | string | Opcional | JSONP callback for cross-domain AJAX | |
fallback | string | Opcional | which API to fall back to if page type cannot be determined | |
useProxy | string | Opcional | 'default' routes through Diffbot's datacenter proxy (2 credits/page instead of 1); 'none' disables proxies | |
proxyAuth | string | Opcional | username:password for the custom proxy | |
discussion | booleano | Opcional | pass false to disable automatic comment/review extraction | true |
renderDelay | inteiro | Opcional | extra rendering ms before DOM extraction, max 180000 | |
- Parâmetros de consulta
urlstringObrigatóriotarget URL to extract, URL-encoded
Exemplo:
https://www.technologyreview.com/2020/09/04/1008156/knowledge-graph-ai-reads-web-machine-learning-natural-language-processing/modestringOpcionalrestrict extraction to one page type: article, product, discussion, image, video, list, event
proxystringOpcionalcustom proxy IP for fetching the target page
fieldsstringOpcionalcomma-delimited optional fields: links, extlinks, meta, querystring, breadcrumb
scrollstringOpcional'slow' or 'fast' — triggers lazy-loaded content
timeoutinteiroOpcionalms to wait for content retrieval
Exemplo:
30000callbackstringOpcionalJSONP callback for cross-domain AJAX
fallbackstringOpcionalwhich API to fall back to if page type cannot be determined
useProxystringOpcional'default' routes through Diffbot's datacenter proxy (2 credits/page instead of 1); 'none' disables proxies
proxyAuthstringOpcionalusername:password for the custom proxy
discussionbooleanoOpcionalpass false to disable automatic comment/review extraction
Exemplo:
truerenderDelayinteiroOpcionalextra rendering ms before DOM extraction, max 180000
Exemplos de código
Substitua $TOOLSWITCH_KEY pela chave criada no console.
curl -X GET 'https://toolswitch.dev/v1/tools/diffbot.x.extract-analyze?url=https%3A%2F%2Fwww.diffbot.com%2Fproducts%2Fextract%2F' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/diffbot.x.extract-analyze?url=https%3A%2F%2Fwww.diffbot.com%2Fproducts%2Fextract%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-analyze?url=https%3A%2F%2Fwww.diffbot.com%2Fproducts%2Fextract%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());Esta API de gateway está em prévia; a URL e a autenticação podem mudar. Os parâmetros do exemplo são dados de amostra. As chamadas são cobradas a $0.001196/call, incluindo a taxa de serviço.