You want to filter or curate URLs before extraction
You need targeted extraction with query and chunks_per_source
Key difference: The main distinction is control, with Extract you choose exactly which URLs to extract from, while Search with include_raw_content extracts from all search results.
Extract accepts up to 20 URLs in one request. This example keeps the first 20 unique URLs selected from the search results and submits them together.
async def content_pipeline(topic): # 1. Search with sub-queries queries = generate_subqueries(topic) responses = await asyncio.gather( *[tavily_client.search(**q) for q in queries] ) # 2. Filter and aggregate urls = [] for response in responses: urls.extend([ r['url'] for r in response['results'] if r['score'] > 0.5 ]) # 3. Deduplicate while preserving the selected order urls = list(dict.fromkeys(urls))[:20] if not urls: return {"results": [], "failed_results": []} # 4. Extract once, retaining successes and per-URL failures return await tavily_client.extract(urls=urls, extract_depth="advanced")
The function returns one Extract response dictionary: results contains successful extractions and failed_results contains per-URL failures. If no URLs qualify, both lists are empty and no Extract request is sent. Authentication and network errors raise exceptions that the caller must handle.
When an agent issues several Tavily calls to answer a single user task — for example, retrieving sources, then extracting full content from a subset, then running follow-up searches — pass a consistent session_id across all related calls.If your agent serves multiple end-users behind a single API key, also pass a stable human_id per user. For security, Tavily hashes human IDs before processing or storing them.See the SDK references or the API HTTP headers for how to set these.
Use query and chunks_per_source for targeted, focused extraction
Choose Extract API when you need control over which URLs to extract from
Filter URLs before extraction using scores, re-ranking, or domain trust
Choose appropriate extract_depth based on content complexity
Batch up to 20 URLs in each Extract request
Implement error handling to manage failed extractions gracefully
Validate extracted content before downstream processing
Optimize costs by extracting only necessary content with chunks_per_source
Use session_id and human_id to link related calls across multi-step agent workflows
Start with query and chunks_per_source for targeted extraction. Filter URLs strategically, extract with appropriate depth, and handle errors gracefully for production-ready pipelines.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Tavily Docs","colors":{"primary":"#80AF9B","light":"#80AF9B","dark":"#817FFF"},"logo":{"light":"https://mintcdn.com/tavilyai/4_uvKy_66YQwB55y/logo/light.svg?fit=max\u0026auto=format\u0026n=4_uvKy_66YQwB55y\u0026q=85\u0026s=dc43e5efe7e46e07f0eb136402479de8","dark":"https://mintcdn.com/tavilyai/4_uvKy_66YQwB55y/logo/dark.svg?fit=max\u0026auto=format\u0026n=4_uvKy_66YQwB55y\u0026q=85\u0026s=683273a1e0164bedd5796c0292b7486e","href":"https://tavily.com/"},"favicon":"https://mintcdn.com/tavilyai/8Hb954Quc_LiMlq3/favicon.ico?fit=max\u0026auto=format\u0026n=8Hb954Quc_LiMlq3\u0026q=85\u0026s=585516a7dd162d47508ea9da086baec2","api":{"openapi":["documentation/api-reference/openapi.json","documentation/enterprise/openapi.json"],"playground":{"display":"simple"}},"background":{"color":{"light":"#FFFCF6","dark":"#1F1E1E"}},"navbar":{"links":[{"href":"mailto:support@tavily.com","label":"Support"}],"primary":{"type":"button","label":"Get an API key","href":"https://app.tavily.com"}},"footer":{"socials":{"linkedin":"https://linkedin.com/company/tavily","x":"https://x.com/tavilyai","github":"https://github.com/tavily-ai","youtube":"https://www.youtube.com/@TavilyAI"},"links":[{"header":"Resources","items":[{"label":"Get started","href":"/"},{"label":"Tavily Search Crawler","href":"/documentation/search-crawler"},{"label":"Tavily Status","href":"https://status.tavily.com/"}]},{"header":"Legal","items":[{"label":"Security \u0026 Compliance","href":"https://trust.tavily.com/"},{"label":"Privacy Policy","href":"https://www.tavily.com/privacy"},{"label":"Website Terms of Use","href":"https://www.tavily.com/website-terms"},{"label":"Platform Terms of Use","href":"https://www.tavily.com/terms"},{"label":"Cookie Notice","href":"https://www.tavily.com/cookie-policy"}]}]},"seo":{"metatags":{"canonical":"https://docs.tavily.com"}},"fonts":{"heading":{"family":"SuisseIntl","weight":700,"source":"fonts/SuisseIntl-Medium.woff2","format":"woff2"},"body":{"family":"SuisseIntl","weight":400,"source":"fonts/SuisseIntl-Regular.woff2","format":"woff2"}},"integrations":{"cookies":{"key":"tavily_mintlify_telemetry_consent","value":"granted"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/tavilyai/xMLYLDqESGBETUw7/images/og-background.png?fit=max\u0026auto=format\u0026n=xMLYLDqESGBETUw7\u0026q=85\u0026s=b8592c875dc9b99e8536ae24dc6a742f"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"API Playground","icon":"play","href":"https://app.tavily.com/playground"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tavilyai","hasAudioNarration":false,"actualSubdomain":"tavilyai","customDomains":["docs.tavily.com"],"gitSource":{"type":"github","owner":"tavily-ai","repo":"new-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aea809bdac2fbd9f78e7eeb","collectionId":"a8e34f51-12b0-4b9f-b8a1-8eb541e4fa7c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aea809bdac2fbd9f78e7eeb"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aea809bdac2fbd9f78e7eeb","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"Integrations","count":81},{"language":"default","tag":"Documentation","count":31},{"language":"default","tag":"Examples","count":24},{"language":"default","tag":"More","count":23},{"language":"default","tag":"API Reference","count":16},{"language":"default","tag":"Coding agents","count":12},{"language":"default","tag":"Apps","count":8},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Agent Toolkit","count":7},{"language":"default","tag":"Cookbook","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--tavily-off-white:#fffcf6;--tavily-black:#1f1e1e;--tavily-green:#80af9b;--tavily-light-blue:#79deeb;--tavily-lavender:#817fff;--tavily-pink:#f49eff}[data-component-part=tab-content] .code-group{margin-top:.5rem;margin-bottom:.5rem}.footer-social-icons>a>svg.icon{background-color:rgb(var(--gray-400));transition:background-color .15s ease}.footer-social-icons>a:hover>svg.icon{background-color:rgb(var(--gray-200))}.hidden.lg\\:flex>.nav-tabs{width:100%}.hidden.lg\\:flex>.nav-tabs>a.nav-tabs-item[href*=\"/changelog\"]{margin-left:auto}.qs-widget{--qs-ink:var(--tavily-black);display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:\"title actions\";align-items:center;gap:1.25rem 1.5rem;margin:.5rem 0 2rem;padding:1.5rem 1.75rem;border-radius:16px;background:var(--tavily-green);color:var(--qs-ink)}.qs-widget-copy{grid-area:title;display:flex;flex-direction:column;gap:.25rem;min-width:0}.qs-widget-title{font-size:1.375rem;font-weight:600;line-height:1.25}.qs-widget-subtitle{font-size:.9375rem;line-height:1.4;opacity:.75}.qs-widget-actions{grid-area:actions;display:flex;gap:.5rem}.qs-widget-button{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 14px;border:0;border-radius:.75rem;background:var(--tavily-black);color:var(--tavily-off-white)!important;font-size:1rem;font-weight:500;line-height:1;white-space:nowrap;text-decoration:none!important;transition:background-color .15s ease}.qs-widget-button:hover{background:rgb(31 30 30/.85)}.qs-widget-button:focus-visible{outline:2px solid var(--qs-ink);outline-offset:3px}.agent-field{--af-ink:var(--tavily-black);--af-ink-60:rgb(31 30 30 / 0.6);--af-ink-10:rgb(31 30 30 / 0.1);--af-ink-5:rgb(31 30 30 / 0.05);--af-surface:var(--tavily-off-white);position:relative;display:inline-flex;align-items:stretch;min-height:36px;border-radius:.75rem;background:var(--af-surface)}.agent-field-copy,.agent-field-trigger{position:relative;display:inline-flex;align-items:center;justify-content:center;border:0;background:0 0;color:var(--af-ink-60);font-family:inherit;font-size:1rem;cursor:pointer;transition:color .2s ease}.agent-field-copy:hover,.agent-field-trigger:hover{color:var(--af-ink)}.agent-field-copy:focus-visible,.agent-field-trigger:focus-visible{outline:2px solid var(--af-ink);outline-offset:3px}.agent-field-copy::after,.agent-field-trigger::after{content:\"\";position:absolute;inset:4px;z-index:0;border-radius:.5rem;background:0 0;transition:background-color .2s ease;pointer-events:none}.agent-field-copy:hover::after,.agent-field-trigger:hover::after{background:var(--af-ink-5)}.agent-field-copy{gap:8px;padding:0 16px;border-radius:.75rem 0 0 .75rem;font-weight:400;line-height:1;white-space:nowrap}.agent-field-trigger{gap:6px;padding:0 14px;border-radius:0 .75rem .75rem 0}.agent-field-trigger::after{left:5px}.agent-field-trigger::before{content:\"\";position:absolute;top:10px;bottom:10px;left:0;width:1px;background:var(--af-ink-10)}.agent-field-chevron,.agent-field-icon,.agent-field-label,.agent-field-logos{position:relative;z-index:1}.agent-field-icon{display:flex;flex-shrink:0}.agent-field-icon-copied{color:#43705c}.agent-field-label{padding-bottom:1px;color:var(--af-ink);font-weight:500}.agent-field-logos{display:flex;flex-shrink:0}.agent-field-logo{position:relative;width:22px;height:22px;margin:0;padding:4px;border-radius:50%;background:var(--af-surface);box-shadow:0 0 0 1px var(--af-ink-10);object-fit:contain}.agent-field-logo+.agent-field-logo{margin-left:-7px}.agent-field-logo:nth-child(1){z-index:3}.agent-field-logo:nth-child(2){z-index:2}.agent-field-logo:nth-child(3){z-index:1}.agent-field-chevron{display:flex;transition:transform .2s ease}.agent-field-chevron-open{transform:rotate(180deg)}.agent-field-popover{position:absolute;top:calc(100% + 8px);right:0;z-index:20;display:flex;flex-direction:column;gap:2px;min-width:220px;padding:6px;border:1px solid var(--af-ink-10);border-radius:14px;background:var(--af-surface);box-shadow:0 12px 28px rgb(31 30 30/.12);text-align:left}.agent-field-group-header{padding:5px 10px 7px}.agent-field-group-label{font-size:11px;font-weight:500;letter-spacing:.06em;text-transform:uppercase;color:var(--af-ink-60)}.agent-field-divider{height:1px;margin:5px 4px;background:var(--af-ink-10)}.agent-field-option{display:flex;align-items:center;gap:10px;padding:9px 10px;border:0;border-radius:9px;background:0 0;color:var(--af-ink)!important;font-family:inherit;font-size:.875rem;line-height:1.25;text-align:left;text-decoration:none!important;white-space:nowrap;cursor:pointer;transition:background-color .2s ease}.agent-field-option:hover{background:var(--af-ink-5)}.agent-field-option:focus-visible{outline:2px solid var(--af-ink);outline-offset:-2px}.agent-field-option-logo{flex-shrink:0;margin:0;object-fit:contain}.agent-field-option-icon{display:flex;flex-shrink:0;justify-content:center;width:16px;color:var(--af-ink-60)}.agent-field-option-action{display:flex;flex-shrink:0;margin-left:auto;padding-left:12px;color:rgb(31 30 30/.55)}.agent-field-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media (max-width:640px){.qs-widget{grid-template-columns:minmax(0,1fr);grid-template-areas:\"title\" \"actions\";padding:1.25rem}.qs-widget-actions{flex-direction:column}.agent-field-copy{flex:1;padding:0 14px}.agent-field-logo{width:20px;height:20px}.agent-field-logo+.agent-field-logo{margin-left:-6px}.agent-field-trigger{padding:0 12px}.agent-field-trigger::before{top:9px;bottom:9px}.agent-field-popover{min-width:200px}}@media (prefers-reduced-motion:reduce){.agent-field,.agent-field-chevron,.agent-field-copy,.agent-field-copy::after,.agent-field-option,.agent-field-trigger,.agent-field-trigger::after,.qs-widget-button{transition:none}}.install-picker{--picker-line:rgb(31 30 30 / 0.1);--picker-hover:rgb(31 30 30 / 0.04);--picker-chip:rgb(31 30 30 / 0.07);--picker-text:rgb(31 30 30 / 0.6);--picker-text-active:var(--tavily-black);margin:1.5rem 0;overflow:hidden;border:1px solid var(--picker-line);border-radius:16px}.dark .install-picker{--picker-line:rgb(255 252 246 / 0.1);--picker-hover:rgb(255 252 246 / 0.05);--picker-chip:rgb(255 252 246 / 0.1);--picker-text:rgb(255 252 246 / 0.6);--picker-text-active:var(--tavily-off-white)}.install-picker [data-component-part=tabs-list]{gap:.25rem!important;min-width:0!important;margin:0!important;padding:.375rem!important;border-bottom:1px solid var(--picker-line)!important}.install-picker [data-component-part=tabs-list]>li{display:flex;flex:1 0 auto}.install-picker [data-component-part=tab-button]{flex:1 1 auto;justify-content:center;max-width:none!important;margin:0!important;padding:.5rem .875rem!important;border:0!important;border-radius:.75rem;color:var(--picker-text)!important;transition:background-color .15s ease,color .15s ease}.install-picker [data-component-part=tab-button]:hover{background:var(--picker-hover);color:var(--picker-text-active)!important}.install-picker [data-component-part=tab-button][data-active=true]{background:var(--picker-chip);color:var(--picker-text-active)!important}.install-picker [data-component-part=tab-button] img{width:16px;height:16px;border-radius:4px}.dark .install-picker [data-component-part=tab-button] img[src*=cursor]{filter:invert(1)}.install-picker [data-component-part=tab-content]{margin:0!important;padding:1.25rem 1.5rem!important}.install-picker [data-component-part=tab-content]>:first-child{margin-top:0!important}.install-picker [data-component-part=tab-content]>:last-child{margin-bottom:0!important}@media (max-width:640px){.install-picker [data-component-part=tabs-list]{flex-wrap:wrap!important;overflow:visible!important}.install-picker [data-component-part=tabs-list]>li{flex:1 1 calc(50% - .25rem);min-width:0}.install-picker [data-component-part=tab-button]{min-width:0;padding:.5rem .625rem!important;font-size:.8125rem;line-height:1.25;white-space:normal!important;text-align:center}.install-picker [data-component-part=tab-content]{padding:1rem!important}}.install-button{display:inline-flex;align-items:center;gap:8px;min-height:36px;margin-bottom:.75rem;padding:0 14px 0 12px;border:0;border-radius:.75rem;background:rgb(31 30 30/.04);color:var(--tavily-black)!important;font-family:inherit;font-size:.9375rem;font-weight:500;line-height:1;white-space:nowrap;text-decoration:none!important;cursor:pointer;transition:background-color .15s ease}.install-button:hover{background:rgb(31 30 30/.1)}.install-button:focus-visible{outline:2px solid var(--tavily-lavender);outline-offset:3px}.install-button-logo{flex-shrink:0;width:18px;height:18px;margin:0!important;object-fit:contain}.dark .install-button{background:rgb(255 252 246/.05);color:var(--tavily-off-white)!important}.dark .install-button:hover{background:rgb(255 252 246/.1)}.dark #navigation-items a img[src*=\"/images/logos/editors/cursor.webp\"],.dark .install-button-logo-invert,.dark img[src*=\"/images/logos/editors/cursor.webp\"]{filter:invert(1)}@media (prefers-reduced-motion:reduce){.install-button,.install-picker [data-component-part=tab-button]{transition:none}}#topbar-cta-button [class*=bg-primary]{background-color:rgb(var(--primary))!important}#topbar-cta-button a,#topbar-cta-button a *{color:var(--tavily-black)!important}#topbar-cta-button a:hover{filter:brightness(1.08)}.nav-logo{height:36px!important}#navigation-items a img{transition:filter 150ms ease}#navigation-items a:not([aria-current=page]) img{filter:grayscale(1)}.dark #navigation-items a:not([aria-current=page]) img[src*=\"/images/logos/editors/cursor.webp\"]{filter:grayscale(1) invert(1)}@media (prefers-reduced-motion:reduce){#navigation-items a img{transition:none}}.integration-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.75rem;margin:1rem 0 2.5rem}.integration-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:128px;padding:1.25rem .75rem;border:1px solid rgb(31 30 30/.08);border-radius:14px;background:var(--tavily-off-white);text-align:center;text-decoration:none;transition:border-color 150ms ease,box-shadow 150ms ease,transform 150ms ease}.integration-tile:hover{border-color:rgb(var(--primary));box-shadow:0 4px 16px rgb(31 30 30/.06);transform:translateY(-1px)}.integration-tile-logo{width:48px;height:48px;border-radius:10px;object-fit:contain}.integration-tile-name{font-size:.875rem;font-weight:500;line-height:1.3;color:rgb(var(--gray-900, 17 24 39))}.dark .integration-tile{border-color:rgb(255 252 246/.1);background:rgb(255 252 246/.03)}.dark .integration-tile:hover{border-color:rgb(var(--primary-light, var(--primary)));box-shadow:none}.dark .integration-tile-name{color:rgb(var(--gray-200, 229 231 235))}@media (max-width:480px){.integration-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (prefers-reduced-motion:reduce){.integration-tile{transition:none}.integration-tile:hover{transform:none}}#ask-assistant-code-block-button,#assistant-entry,#assistant-entry-mobile,#header .eyebrow,[data-assistant-bar]{display:none!important}#pagination{display:flex!important;justify-content:space-between;gap:1.5rem;margin-bottom:3rem}#pagination>a{min-width:0;padding:0!important;border:0!important;border-radius:0!important;background:0 0!important}#pagination [data-component-part=pagination-title]{font-size:.875rem;font-weight:500}#pagination>a>div{display:flex;align-items:center;gap:.375rem}#pagination>a>div>*{margin:0!important}#pagination [data-component-part=pagination-prev]>div>:last-child{order:-1}#pagination [data-component-part=pagination-label]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}#pagination>a:hover [data-component-part=pagination-title]{text-decoration:underline;text-decoration-color:rgb(var(--primary));text-underline-offset:4px}#footer>div{padding-top:3.5rem;padding-bottom:3.5rem}#footer div:has(>p.font-semibold){gap:.75rem}#footer div:has(>p.font-semibold)>a{max-width:none;overflow:visible;text-overflow:clip;white-space:nowrap}#onetrust-consent-sdk #onetrust-banner-sdk{background-color:var(--tavily-off-white)!important;font-family:inherit!important}#onetrust-consent-sdk #onetrust-banner-sdk.otFloatingRoundedCorner{border-radius:1rem!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-text,#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-title{font-family:inherit!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-title{color:var(--tavily-black)!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-text{color:rgb(31 30 30/.72)!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-text a{color:var(--tavily-black)!important;font-weight:500!important;text-decoration:underline!important;text-decoration-color:rgb(var(--primary, 128 175 155))!important;text-underline-offset:3px!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-accept-btn-handler,#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-pc-btn-handler,#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-reject-all-handler{border-color:transparent!important;border-radius:.75rem!important;background-color:rgb(31 30 30/.04)!important;color:var(--tavily-black)!important;font-family:inherit!important;font-weight:500!important;letter-spacing:normal!important;text-decoration:none!important;opacity:1!important;transition:background-color .15s ease,opacity .15s ease!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-accept-btn-handler{background-color:rgb(var(--primary, 128 175 155))!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-pc-btn-handler:hover,#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-reject-all-handler:hover{background-color:rgb(31 30 30/.1)!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-accept-btn-handler:hover{opacity:.9!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-button-group button:focus-visible{outline:2px solid var(--tavily-lavender)!important;outline-offset:2px!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-close-btn-container button{opacity:.5!important}#onetrust-consent-sdk #onetrust-banner-sdk #onetrust-close-btn-container button:hover{opacity:.9!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk{background-color:rgb(var(--background-dark, 31 30 30))!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-text a,.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-title{color:var(--tavily-off-white)!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-policy-text{color:rgb(255 252 246/.65)!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-pc-btn-handler,.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-reject-all-handler{background-color:rgb(255 252 246/.05)!important;color:var(--tavily-off-white)!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-pc-btn-handler:hover,.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-reject-all-handler:hover{background-color:rgb(255 252 246/.1)!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-accept-btn-handler{color:var(--tavily-black)!important}.dark #onetrust-consent-sdk #onetrust-banner-sdk #onetrust-close-btn-container button,.dark #onetrust-consent-sdk #onetrust-banner-sdk .ot-bnr-logo{filter:invert(1)!important}.onetrust-pc-dark-filter{background:rgb(31 30 30/.45)!important;backdrop-filter:blur(2px)}#onetrust-consent-sdk #onetrust-pc-sdk{border:1px solid rgb(31 30 30/.08)!important;border-radius:1rem!important;background-color:var(--tavily-off-white)!important;box-shadow:0 24px 48px rgb(31 30 30/.18)!important;font-family:inherit!important}#onetrust-consent-sdk #onetrust-pc-sdk *{font-family:inherit!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-header{border-bottom-color:rgb(31 30 30/.08)!important;display:flex!important;align-items:center!important;justify-content:space-between!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-header .ot-pc-logo{float:none!important;height:28px!important;max-height:28px!important;margin:0!important;background-position:left center!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-header .ot-pc-logo img{height:100%!important;width:auto!important;margin:0!important;object-fit:contain!important;object-position:left center!important}#onetrust-consent-sdk #onetrust-pc-sdk #close-pc-btn-handler{float:none!important;flex-shrink:0!important;width:2rem!important;height:2rem!important;margin:0 1rem 0 0!important;border:0!important;border-radius:.5rem!important;background-size:.625rem!important;opacity:.6!important;transition:background-color .15s ease,opacity .15s ease!important}#onetrust-consent-sdk #onetrust-pc-sdk #close-pc-btn-handler:focus:not(:focus-visible){outline:0!important;box-shadow:none!important}#onetrust-consent-sdk #onetrust-pc-sdk #close-pc-btn-handler:hover{background-color:rgb(31 30 30/.06)!important;opacity:1!important}#onetrust-consent-sdk #onetrust-pc-sdk #ot-category-title,#onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-title{color:var(--tavily-black)!important;font-size:1.0625rem!important;font-weight:600!important;line-height:1.4!important}#onetrust-consent-sdk #onetrust-pc-sdk #ot-category-title{font-size:.9375rem!important}#onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-desc,#onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-grpdesc,#onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-txt p{color:rgb(31 30 30/.72)!important;font-size:.8125rem!important;line-height:1.6!important}#onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-desc a,#onetrust-consent-sdk #onetrust-pc-sdk .privacy-notice-link{color:var(--tavily-black)!important;font-weight:500!important;text-decoration:underline!important;text-decoration-color:rgb(var(--primary, 128 175 155))!important;text-underline-offset:3px!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout.ot-cat-item{border-color:rgb(31 30 30/.08)!important;border-radius:0!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout.ot-cat-item:first-of-type{border-top-left-radius:.75rem!important;border-top-right-radius:.75rem!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout.ot-cat-item:last-of-type{border-bottom-left-radius:.75rem!important;border-bottom-right-radius:.75rem!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout .ot-acc-hdr:hover{background-color:rgb(31 30 30/.02)!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-cat-header{color:var(--tavily-black)!important;font-size:.875rem!important;font-weight:500!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-plus-minus span{background:rgb(31 30 30/.6)!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-always-active{color:rgb(31 30 30/.6)!important;font-size:.8125rem!important;font-weight:500!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-switch-nob{border:0!important;background-color:rgb(31 30 30/.18)!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-tgl input:checked+.ot-switch .ot-switch-nob{border:0!important;background-color:rgb(var(--primary, 128 175 155))!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-tgl input:focus-visible+.ot-switch .ot-switch-nob{outline:2px solid var(--tavily-lavender)!important;outline-offset:2px!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-footer{border-top-color:rgb(31 30 30/.08)!important}#onetrust-consent-sdk #onetrust-pc-sdk #accept-recommended-btn-handler,#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-refuse-all-handler,#onetrust-consent-sdk #onetrust-pc-sdk .save-preference-btn-handler{min-height:2.5rem!important;height:auto!important;padding:.5rem 1rem!important;border:0!important;border-radius:.75rem!important;background-color:rgb(31 30 30/.04)!important;color:var(--tavily-black)!important;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem!important;letter-spacing:normal!important;opacity:1!important;transition:background-color .15s ease,opacity .15s ease!important}#onetrust-consent-sdk #onetrust-pc-sdk #accept-recommended-btn-handler,#onetrust-consent-sdk #onetrust-pc-sdk .save-preference-btn-handler{background-color:rgb(var(--primary, 128 175 155))!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-refuse-all-handler:hover,#page-context-menu-button+button:hover,#page-context-menu-button:hover{background-color:rgb(31 30 30/.1)!important}#onetrust-consent-sdk #onetrust-pc-sdk #accept-recommended-btn-handler:hover,#onetrust-consent-sdk #onetrust-pc-sdk .save-preference-btn-handler:hover{opacity:.9!important}#onetrust-consent-sdk #onetrust-pc-sdk #accept-recommended-btn-handler:focus-visible,#onetrust-consent-sdk #onetrust-pc-sdk #close-pc-btn-handler:focus-visible,#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-footer button:focus-visible{outline:2px solid var(--tavily-lavender)!important;outline-offset:2px!important}#onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-footer-logo{background:0 0!important;opacity:.5!important}@media only screen and (max-width:600px){#onetrust-consent-sdk #onetrust-pc-sdk{border:0!important;border-radius:0!important}}.dark #onetrust-consent-sdk #onetrust-pc-sdk{border-color:rgb(255 252 246/.1)!important;background-color:rgb(var(--background-dark, 31 30 30))!important;box-shadow:0 24px 48px rgb(0 0 0/.6)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout.ot-cat-item,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-footer,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-header{border-color:rgb(255 252 246/.1)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk #ot-category-title,.dark #onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-desc a,.dark #onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-title,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-cat-header,.dark #onetrust-consent-sdk #onetrust-pc-sdk .privacy-notice-link,.dark #onetrust-consent-sdk #onetrust-pc-sdk ul.ot-subgrps li.ot-subgrp>h5,.dark #onetrust-consent-sdk #onetrust-pc-sdk ul.ot-subgrps li.ot-subgrp>p[aria-level=\"5\"]{color:var(--tavily-off-white)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk #ot-pc-desc,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-grpdesc,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-txt p,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-always-active,.dark #onetrust-consent-sdk #onetrust-pc-sdk ul.ot-subgrps li.ot-subgrp .ot-subgrp-desc{color:rgb(255 252 246/.65)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-grpcntr.ot-acc-txt,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-txt .ot-subgrp-tgl .ot-switch.ot-toggle,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-accordion-layout .ot-acc-hdr:hover{background-color:rgb(255 252 246/.03)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-acc-grpcntr .ot-subgrp-cntr{border-top-color:rgb(255 252 246/.1)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-plus-minus span{background:rgb(255 252 246/.6)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-switch-nob{background-color:rgb(255 252 246/.2)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-tgl input:checked+.ot-switch .ot-switch-nob{background-color:rgb(var(--primary, 128 175 155))!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-refuse-all-handler{background-color:rgb(255 252 246/.05)!important;color:var(--tavily-off-white)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-refuse-all-handler:hover,.dark #page-context-menu-button+button:hover,.dark #page-context-menu-button:hover{background-color:rgb(255 252 246/.1)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk #accept-recommended-btn-handler,.dark #onetrust-consent-sdk #onetrust-pc-sdk .save-preference-btn-handler{color:var(--tavily-black)!important}.dark #onetrust-consent-sdk #onetrust-pc-sdk #close-pc-btn-handler,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-footer-logo img,.dark #onetrust-consent-sdk #onetrust-pc-sdk .ot-pc-header .ot-pc-logo{filter:invert(1)!important}#onetrust-consent-sdk #ot-sdk-btn-floating .ot-floating-button__back svg{margin:0 auto!important}[data-component-part=tabs-list]:not(.install-picker *){gap:.25rem!important;padding-bottom:0!important;border-bottom:0!important}[data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button]{margin:0!important;padding:.375rem .75rem!important;border:0!important;border-radius:.75rem;color:rgb(31 30 30/.6)!important;font-weight:500!important;transition:background-color .15s ease,color .15s ease}[data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button]:hover{background:rgb(31 30 30/.04);color:var(--tavily-black)!important}[data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button][data-active=true]{background:rgb(31 30 30/.07);color:var(--tavily-black)!important}.dark [data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button]{color:rgb(255 252 246/.6)!important}.dark [data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button]:hover{background:rgb(255 252 246/.05);color:var(--tavily-off-white)!important}.dark [data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button][data-active=true]{background:rgb(255 252 246/.1);color:var(--tavily-off-white)!important}#page-context-menu-button,#page-context-menu-button+button{border-color:transparent!important;background-color:rgb(31 30 30/.04)!important;transition:background-color .15s ease}#page-context-menu-button+button{box-shadow:inset 1px 0 0 rgb(31 30 30/.08)}.dark #page-context-menu-button,.dark #page-context-menu-button+button{background-color:rgb(255 252 246/.05)!important}.dark #page-context-menu-button+button{box-shadow:inset 1px 0 0 rgb(255 252 246/.08)}@media (prefers-reduced-motion:reduce){#page-context-menu-button,#page-context-menu-button+button,[data-component-part=tabs-list]:not(.install-picker *) [data-component-part=tab-button]{transition:none}}.callout[data-callout-type=note]{--callout-accent:121 222 235}.callout[data-callout-type=tip]{--callout-accent:128 175 155}.callout[data-callout-type=info]{--callout-accent:129 127 255}.callout:is([data-callout-type=\"note\"], [data-callout-type=\"tip\"], [data-callout-type=\"info\"]){border-color:rgb(var(--callout-accent)/.55)!important;background-color:rgb(var(--callout-accent)/.14)!important}.callout:is([data-callout-type=\"note\"], [data-callout-type=\"tip\"], [data-callout-type=\"info\"]) :is([data-component-part=\"callout-icon\"] svg, [data-component-part=\"callout-content\"]){color:var(--tavily-black)!important}.dark .callout:is([data-callout-type=\"note\"], [data-callout-type=\"tip\"], [data-callout-type=\"info\"]){border-color:rgb(var(--callout-accent)/.3)!important;background-color:rgb(var(--callout-accent)/.08)!important}.dark .callout:is([data-callout-type=\"note\"], [data-callout-type=\"tip\"], [data-callout-type=\"info\"]) [data-component-part=callout-icon] svg{color:rgb(var(--callout-accent))!important}.dark .callout:is([data-callout-type=\"note\"], [data-callout-type=\"tip\"], [data-callout-type=\"info\"]) [data-component-part=callout-content]{color:rgb(255 252 246/.88)!important}html:not(.dark) a[aria-current=page][class*=text-primary]{background-color:rgb(128 175 155/.2)!important;color:var(--tavily-black)!important}::selection{background-color:var(--tavily-green);color:var(--tavily-black)}.code-block,.code-group{padding:0!important;border:0!important;background-color:rgb(31 30 30/.04)!important}.code-group .code-block,.dark .code-group .code-block,[data-component-part=code-block-root]{background-color:transparent!important}[data-fade-overlay]{--fade-color-light:color-mix(in srgb, var(--tavily-black) 4%, var(--tavily-off-white))!important;--fade-color-dark:#0b0c0e!important}[data-component-part=code-block-header],[data-component-part=code-group-tab-bar]{border-bottom:1px solid rgb(31 30 30/.06)}.dark .code-block,.dark .code-group{background-color:rgb(255 252 246/.04)!important}.dark [data-component-part=code-block-header],.dark [data-component-part=code-group-tab-bar]{border-bottom-color:rgb(255 252 246/.06)}.card{border-width:0!important;background-color:rgb(31 30 30/.04)!important;transition:background-color .15s ease}.card:hover{background-color:rgb(31 30 30/.08)!important}.dark .card{background-color:rgb(255 252 246/.04)!important}.dark .card:hover{background-color:rgb(255 252 246/.08)!important}@media (prefers-reduced-motion:reduce){.card{transition:none}}html:root{--gray-50:248 245 240;--gray-100:239 236 231;--gray-200:226 223 218;--gray-300:208 205 201;--gray-400:165 163 160;--gray-500:130 128 125;--gray-600:103 101 99;--gray-700:80 79 78;--gray-800:60 59 58;--gray-900:31 30 30;--gray-950:31 30 30;--color-white:#fffcf6;--color-black:#1f1e1e;--tooltip-foreground:255 252 246}html .prose{--tw-prose-body:var(--tavily-black);--tw-prose-headings:var(--tavily-black);--tw-prose-lead:rgb(31 30 30 / 0.72);--tw-prose-links:var(--tavily-black);--tw-prose-bold:var(--tavily-black);--tw-prose-counters:rgb(31 30 30 / 0.6);--tw-prose-bullets:rgb(31 30 30 / 0.3);--tw-prose-hr:rgb(31 30 30 / 0.1);--tw-prose-quotes:var(--tavily-black);--tw-prose-quote-borders:rgb(31 30 30 / 0.12);--tw-prose-captions:rgb(31 30 30 / 0.6);--tw-prose-kbd:var(--tavily-black);--tw-prose-code:var(--tavily-black);--tw-prose-th-borders:rgb(31 30 30 / 0.18);--tw-prose-td-borders:rgb(31 30 30 / 0.1);--tw-prose-invert-body:rgb(255 252 246 / 0.88);--tw-prose-invert-headings:var(--tavily-off-white);--tw-prose-invert-lead:rgb(255 252 246 / 0.7);--tw-prose-invert-links:var(--tavily-off-white);--tw-prose-invert-bold:var(--tavily-off-white);--tw-prose-invert-counters:rgb(255 252 246 / 0.6);--tw-prose-invert-bullets:rgb(255 252 246 / 0.3);--tw-prose-invert-hr:rgb(255 252 246 / 0.1);--tw-prose-invert-quotes:var(--tavily-off-white);--tw-prose-invert-quote-borders:rgb(255 252 246 / 0.15);--tw-prose-invert-captions:rgb(255 252 246 / 0.6);--tw-prose-invert-kbd:var(--tavily-off-white);--tw-prose-invert-code:var(--tavily-off-white);--tw-prose-invert-th-borders:rgb(255 252 246 / 0.18);--tw-prose-invert-td-borders:rgb(255 252 246 / 0.1)}html.dark .prose{--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-kbd:var(--tw-prose-invert-kbd);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}"}],"page":{"pagePath":"documentation/best-practices/best-practices-extract","slug":"/documentation/best-practices/best-practices-extract","pageMetadata":{"title":"Best Practices for Extract","sidebarTitle":"Extract","description":"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.","href":"/documentation/best-practices/best-practices-extract"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,blockquote:`blockquote`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`extract-parameters`,children:`Extract Parameters`}),`\n`,_jsx(Heading,{level:`3`,id:`query`,children:`Query`}),`\n`,_jsx(_components.p,{children:`Use query to rerank extracted content chunks based on relevance:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/article\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"machine learning applications in healthcare\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`When to use query:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`To extract only relevant portions of long documents`}),`\n`,_jsx(_components.li,{children:`When you need focused content instead of full page extraction`}),`\n`,_jsx(_components.li,{children:`For targeted information retrieval from specific URLs`}),`\n`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`query`}),` is provided, chunks are reranked based on relevance to the query.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`chunks-per-source`,children:`Chunks Per Source`}),`\n`,_jsx(_components.p,{children:`Control the amount of content returned per URL to prevent context window explosion:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/article\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"machine learning applications in healthcare\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` chunks_per_source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Key benefits:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Returns only relevant content snippets (about 800 characters each) instead of full page content`}),`\n`,_jsx(_components.li,{children:`Prevents context window from exploding`}),`\n`,_jsxs(_components.li,{children:[`Chunks appear in `,_jsx(_components.code,{children:`raw_content`}),` as: `,_jsx(_components.code,{children:`\u003cchunk 1> [...] \u003cchunk 2> [...] \u003cchunk 3>`})]}),`\n`,_jsx(_components.li,{children:`Must be between 1 and 5 chunks per source`}),`\n`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`chunks_per_source`}),` is only available when `,_jsx(_components.code,{children:`query`}),` is provided.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example with multiple URLs:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://example.com/ml-healthcare\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://example.com/ai-diagnostics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://example.com/medical-ai\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AI diagnostic tools accuracy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` chunks_per_source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This returns the 2 most relevant chunks from each URL, giving you focused, relevant content without overwhelming your context window.`}),`\n`,_jsx(Heading,{level:`2`,id:`extraction-approaches`,children:`Extraction Approaches`}),`\n`,_jsx(Heading,{level:`3`,id:`search-with-include_raw_content`,children:`Search with include_raw_content`}),`\n`,_jsx(_components.p,{children:`Enable include_raw_content=true in Search API calls to retrieve both search results and extracted content simultaneously.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.search(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AI healthcare applications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` include_raw_content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_results`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`When to use:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Quick prototyping`}),`\n`,_jsx(_components.li,{children:`Simple queries where search results are likely relevant`}),`\n`,_jsx(_components.li,{children:`Single API call convenience`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`direct-extract-api`,children:`Direct Extract API`}),`\n`,_jsx(_components.p,{children:`Use the Extract API when you want control over which specific URLs to extract from.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/article1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/article2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"machine learning applications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` chunks_per_source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`When to use:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You already have specific URLs to extract from`}),`\n`,_jsx(_components.li,{children:`You want to filter or curate URLs before extraction`}),`\n`,_jsx(_components.li,{children:`You need targeted extraction with query and chunks_per_source`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key difference:`}),` The main distinction is control, with Extract you choose exactly which URLs to extract from, while Search with `,_jsx(_components.code,{children:`include_raw_content`}),` extracts from all search results.`]}),`\n`,_jsx(Heading,{level:`2`,id:`extract-depth`,children:`Extract Depth`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`extract_depth`}),` parameter controls extraction comprehensiveness:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Depth`}),_jsx(_components.th,{children:`Use case`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`basic`}),` (default)`]}),_jsx(_components.td,{children:`Simple text extraction, faster processing`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`advanced`})}),_jsx(_components.td,{children:`Complex pages, tables, structured data, media`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`using-extract_depth=advanced`,children:[`Using `,_jsx(_components.code,{children:`extract_depth=advanced`})]}),`\n`,_jsx(_components.p,{children:`Best for content requiring detailed extraction:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/complex-page\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extract_depth`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"advanced\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`When to use advanced:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Dynamic content or JavaScript-rendered pages`}),`\n`,_jsx(_components.li,{children:`Tables and structured information`}),`\n`,_jsx(_components.li,{children:`Embedded media and rich content`}),`\n`,_jsx(_components.li,{children:`Higher extraction success rates needed`}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`extract_depth=advanced`}),` provides better accuracy but increases latency and\ncost. Use `,_jsx(_components.code,{children:`basic`}),` for simple content.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`advanced-filtering-strategies`,children:`Advanced Filtering Strategies`}),`\n`,_jsx(_components.p,{children:`Beyond query-based filtering, consider these approaches for curating URLs before extraction:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Strategy`}),_jsx(_components.th,{children:`When to use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Re-ranking`}),_jsx(_components.td,{children:`Use dedicated re-ranking models for precision`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`LLM-based`}),_jsx(_components.td,{children:`Let an LLM assess relevance before extraction`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Clustering`}),_jsx(_components.td,{children:`Group similar documents, extract from clusters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Domain-based`}),_jsx(_components.td,{children:`Filter by trusted domains before extracting`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Score-based`}),_jsx(_components.td,{children:`Filter search results by relevance score`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`example-score-based-filtering`,children:`Example: Score-based filtering`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncTavilyClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tavily_client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncTavilyClient(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tvly-YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` filtered_extraction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Search first`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.search(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AI healthcare applications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` search_depth`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"advanced\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_results`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Filter by relevance score (>0.5)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` relevant_urls `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'url'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'results'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'score'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.5`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Extract from filtered URLs with targeted query`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extracted_data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`relevant_urls,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"machine learning diagnostic tools\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` chunks_per_source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extract_depth`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"advanced\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extracted_data`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`asyncio.run(filtered_extraction())`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`integration-with-search`,children:`Integration with Search`}),`\n`,_jsx(Heading,{level:`3`,id:`optimal-workflow`,children:`Optimal workflow`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Search`}),` to discover relevant URLs`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Filter`}),` by relevance score, domain, or content snippet`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Re-rank`}),` if needed using specialized models`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Extract`}),` from top-ranked sources with query and chunks_per_source`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validate`}),` extracted content quality`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Process`}),` for your RAG or AI application`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`example-end-to-end-pipeline`,children:`Example end-to-end pipeline`}),`\n`,_jsx(_components.p,{children:`Extract accepts up to 20 URLs in one request. This example keeps the first 20 unique URLs selected from the search results and submits them together.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` content_pipeline`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`topic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 1. Search with sub-queries`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` queries `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` generate_subqueries(topic)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` responses `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio.gather(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[tavily_client.search(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`q) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` q `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` queries]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 2. Filter and aggregate`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urls `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` responses:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urls.extend([`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'url'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'results'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'score'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.5`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ])`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 3. Deduplicate while preserving the selected order`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urls `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`dict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.fromkeys(urls))[:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urls:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"results\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [], `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"failed_results\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: []}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 4. Extract once, retaining successes and per-URL failures`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tavily_client.extract(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`urls`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`urls, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`extract_depth`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"advanced\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The function returns one Extract response dictionary: `,_jsx(_components.code,{children:`results`}),` contains successful extractions and `,_jsx(_components.code,{children:`failed_results`}),` contains per-URL failures. If no URLs qualify, both lists are empty and no Extract request is sent. Authentication and network errors raise exceptions that the caller must handle.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-session-tracking-for-multi-step-workflows`,children:`Use Session Tracking for Multi-Step Workflows`}),`\n`,_jsxs(_components.p,{children:[`When an agent issues several Tavily calls to answer a single user task — for example, retrieving sources, then extracting full content from a subset, then running follow-up searches — pass a `,_jsxs(_components.strong,{children:[`consistent `,_jsx(_components.code,{children:`session_id`}),` across all related calls`]}),`.`]}),`\n`,_jsxs(_components.p,{children:[`If your agent serves multiple end-users behind a single API key, also pass a stable `,_jsx(_components.code,{children:`human_id`}),` per user. For security, Tavily hashes human IDs before processing or storing them.`]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/sdk/python/reference#session-tracking`,children:`SDK references`}),` or the `,_jsx(_components.a,{href:`/documentation/api-headers#session-tracking`,children:`API HTTP headers`}),` for how to set these.`]}),`\n`,_jsx(Heading,{level:`2`,id:`summary`,children:`Summary`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use query and chunks_per_source`}),` for targeted, focused extraction`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Choose Extract API`}),` when you need control over which URLs to extract from`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Filter URLs`}),` before extraction using scores, re-ranking, or domain trust`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Choose appropriate extract_depth`}),` based on content complexity`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Batch up to 20 URLs`}),` in each Extract request`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Implement error handling`}),` to manage failed extractions gracefully`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validate extracted content`}),` before downstream processing`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Optimize costs`}),` by extracting only necessary content with chunks_per_source`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Use `,_jsx(_components.code,{children:`session_id`}),` and `,_jsx(_components.code,{children:`human_id`})]}),` to link related calls across multi-step agent workflows`]}),`\n`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsx(_components.p,{children:`Start with query and chunks_per_source for targeted extraction. Filter URLs strategically, extract with appropriate depth, and handle errors gracefully for production-ready pipelines.`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Best Practices for Extract","sidebarTitle":"Extract","description":"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.","href":"/documentation/best-practices/best-practices-extract"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Extract Parameters","slug":"extract-parameters","depth":2,"children":[{"title":"Query","slug":"query","depth":3,"children":[]},{"title":"Chunks Per Source","slug":"chunks-per-source","depth":3,"children":[]}]},{"title":"Extraction Approaches","slug":"extraction-approaches","depth":2,"children":[{"title":"Search with include_raw_content","slug":"search-with-include_raw_content","depth":3,"children":[]},{"title":"Direct Extract API","slug":"direct-extract-api","depth":3,"children":[]}]},{"title":"Extract Depth","slug":"extract-depth","depth":2,"children":[{"title":"Using extract_depth=advanced","slug":"using-extract_depth=advanced","depth":3,"children":[]}]},{"title":"Advanced Filtering Strategies","slug":"advanced-filtering-strategies","depth":2,"children":[{"title":"Example: Score-based filtering","slug":"example-score-based-filtering","depth":3,"children":[]}]},{"title":"Integration with Search","slug":"integration-with-search","depth":2,"children":[{"title":"Optimal workflow","slug":"optimal-workflow","depth":3,"children":[]},{"title":"Example end-to-end pipeline","slug":"example-end-to-end-pipeline","depth":3,"children":[]}]},{"title":"Use Session Tracking for Multi-Step Workflows","slug":"use-session-tracking-for-multi-step-workflows","depth":2,"children":[]},{"title":"Summary","slug":"summary","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/tavilyai/9da7eb98a484e5c8/onetrust.js","/_mintlify/custom/tavilyai/a9b4e0873a112f9c/onetrust-footer.js","/_mintlify/custom/tavilyai/98702b1e3ae51284/equalweb-footer.js","/_mintlify/custom/tavilyai/f6ddee891c08979f/equalweb.js","/_mintlify/custom/tavilyai/562a8ca14773644d/posthog.js","/_mintlify/custom/tavilyai/9c8bb0080d8283b3/attribution.js","/_mintlify/custom/tavilyai/bba230751effe516/mintlify-telemetry.js"],"subdomain":"tavilyai","siteName":"Tavily Docs","title":"Best Practices for Extract - Tavily Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T18:37:56.924Z","originalFileLocation":"documentation/best-practices/best-practices-extract.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tavily Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Best Practices for Extract - Tavily Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tavily Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tavily.com/documentation/best-practices/best-practices-extract\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tavilyai.mintlify.app/_mintlify/api/og/v2?division=Best+practices\u0026amp;title=Best+Practices+for+Extract\u0026amp;description=Learn+how+to+optimize+content+extraction%2C+choose+the+right+approach%2C+and+configure+parameters+for+better+performance.\u0026amp;theme=88bb4908d020ca724b26acfd\u0026amp;signature=4f4c2e0bd8be4ab6ff7fdbda806a6dd66d7c51efcdeb37bcd41144656b0694b3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Best Practices for Extract - Tavily Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tavilyai.mintlify.app/_mintlify/api/og/v2?division=Best+practices\u0026amp;title=Best+Practices+for+Extract\u0026amp;description=Learn+how+to+optimize+content+extraction%2C+choose+the+right+approach%2C+and+configure+parameters+for+better+performance.\u0026amp;theme=88bb4908d020ca724b26acfd\u0026amp;signature=4f4c2e0bd8be4ab6ff7fdbda806a6dd66d7c51efcdeb37bcd41144656b0694b3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tavilyai/SXaxSfweEU3ftIlh/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tavily Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#80AF9B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tavily.com/documentation/best-practices/best-practices-extract\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/best-practices/best-practices-extract.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tavily.com/#organization\",\"name\":\"Tavily Docs\",\"url\":\"https://docs.tavily.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tavilyai/4_uvKy_66YQwB55y/logo/light.svg?fit=max\u0026auto=format\u0026n=4_uvKy_66YQwB55y\u0026q=85\u0026s=dc43e5efe7e46e07f0eb136402479de8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tavily.com#website\",\"name\":\"Tavily Docs\",\"url\":\"https://docs.tavily.com\",\"publisher\":{\"@id\":\"https://docs.tavily.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract#webpage\",\"url\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract\",\"name\":\"Best Practices for Extract\",\"description\":\"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\",\"dateModified\":\"2026-10-21T18:37:56.924Z\",\"isPartOf\":{\"@id\":\"https://docs.tavily.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Best practices\",\"item\":\"https://docs.tavily.com/documentation/best-practices/best-practices-search\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Best Practices for Extract\",\"item\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract#article\",\"headline\":\"Best Practices for Extract\",\"name\":\"Best Practices for Extract\",\"description\":\"Learn how to optimize content extraction, choose the right approach, and configure parameters for better performance.\",\"url\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tavily.com/documentation/best-practices/best-practices-extract#webpage\"},\"dateModified\":\"2026-10-21T18:37:56.924Z\",\"publisher\":{\"@id\":\"https://docs.tavily.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tavily.com#website\"}}]}\u003c/script>","siteName":"Tavily Docs","nav":{"global":{"anchors":[{"anchor":"API Playground","icon":"play","href":"https://app.tavily.com/playground"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Connect your AI agent to the web","sidebarTitle":"Quickstart","mode":"wide","href":""},{"title":"Tavily MCP","sidebarTitle":"MCP","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/icons/mcp.svg","href":"/documentation/mcp"},{"title":"Tavily Agent Skills","sidebarTitle":"Agent Skills","icon":"scroll","href":"/documentation/agent-skills"},{"title":"Claude","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/icons/claude.svg","href":"/documentation/integrations/claude"},{"title":"Tavily CLI","sidebarTitle":"CLI","icon":"square-terminal","href":"/documentation/tavily-cli"},{"title":"Quickstart","sidebarTitle":"Python SDK","icon":"python","href":"/sdk/python/quick-start"},{"title":"Quickstart","sidebarTitle":"JavaScript SDK","icon":"js","href":"/sdk/javascript/quick-start"}]},{"group":"Coding agents","pages":[{"title":"Claude Code","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/editors/claude.webp","href":"/documentation/integrations/claude-code"},{"title":"Codex","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/editors/codex.webp","href":"/documentation/integrations/codex"},{"title":"Cursor","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/editors/cursor.webp","href":"/documentation/integrations/cursor"},{"title":"Kiro","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/editors/kiro.svg","href":"/documentation/integrations/kiro"},{"title":"Kilo","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/kilo.svg","href":"/documentation/integrations/kilo"},{"title":"OpenCode","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/opencode.png","href":"/documentation/integrations/opencode"},{"title":"Hermes Agent","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/hermes-agent.svg","href":"/documentation/integrations/hermes-agent"},{"title":"Pi","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/pi.svg","href":"/documentation/integrations/pi"},{"title":"NanoClaw","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/nanoclaw.png","href":"/documentation/integrations/nanoclaw"},{"title":"OpenClaw","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/openclaw.svg","href":"/documentation/integrations/openclaw"},{"title":"Grok Build","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/grok.png","href":"/documentation/integrations/grok-build"},{"title":"Replit","icon":"https://mintlify.s3.us-west-1.amazonaws.com/tavilyai/images/logos/agents/replit.svg","href":"/documentation/integrations/replit"}]},{"group":"API keys \u0026 credits","pages":[{"title":"Try Tavily Without an API Key","href":"/documentation/keyless"},{"title":"API Key Management","href":"/documentation/best-practices/api-key-management"},{"title":"Headers \u0026 Authentication","href":"/documentation/api-headers"},{"title":"Credits \u0026 Pricing","href":"/documentation/api-credits"},{"title":"Rate Limits","href":"/documentation/rate-limits"}]},{"group":"Best practices","pages":[{"title":"Best Practices for Search","sidebarTitle":"Search","description":"Optimize individual queries, and run search reliably at scale with batch workflows.","href":"/documentation/best-practices/best-practices-search"},{"title":"Best Practices for Extract","sidebarTitle":"Extract","href":"/documentation/best-practices/best-practices-extract"},{"title":"Best Practices for Crawl","sidebarTitle":"Crawl","description":"Learn how to optimize crawl parameters, focus your crawls, and efficiently extract content from websites.","href":"/documentation/best-practices/best-practices-crawl"},{"title":"Best Practices for Research","sidebarTitle":"Research","href":"/documentation/best-practices/best-practices-research"},{"title":"Tavily Knowledge - Company","sidebarTitle":"Company Data","href":"/documentation/best-practices/company-data"}]},{"group":"Help","pages":[{"title":"Frequently Asked Questions","href":"/faq/faq"},{"title":"Help Center","url":"https://help.tavily.com","href":"/documentation/help"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/documentation/api-reference/endpoint/search"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/documentation/integrations/overview"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/hub"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Best Practices for Extract - Tavily Docs","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":[],"chunks":[]}