The context parameter helps DeepL’s API translate ambiguous words and short text snippets more accurately by providing the surrounding content. Think of it like showing a human translator the paragraphs before and after the sentence being translated.The context parameter can help with:
Picking the correct translation for ambiguous words
Providing grammatical clues for gender, number, or case that isn’t clear from the text alone
Improving translations of short snippets such as headlines or product names
“Tor” could mean “gate” or “goal” in German. Without context, DeepL may not know which meaning you intend:
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "Die Person stand vor dem Tor." ], "target_lang": "EN-US"}'
Output without context:
"The person was standing in front of the gate."
If you’re writing about a football game, provide context to clarify:
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "Die Person stand vor dem Tor." ], "target_lang": "EN-US", "context": "Es war ein Fußballspiel."}'
Without context, DeepL may not use the desired gender when translating:
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "The teacher asked the class to tidy up after they finished the lesson." ], "target_lang": "DE"}'
Output without context: (uses masculine form “Lehrer”)
"Der Lehrer bat die Klasse, nach der Stunde aufzuräumen."
You can provide context from the surrounding text that clarifies the teacher’s gender:
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "The teacher asked the class to tidy up after they finished the lesson." ], "target_lang": "DE", "context": "She did not want to tidy up herself."}'
Output with context: (uses feminine form “Lehrerin”)
"Die Lehrerin bat die Klasse, nach der Stunde aufzuräumen."
As noted in the text field reference, each text in the array is translated independently and texts do not share context with each other. This results in different transliterations for the name “Sergej”.
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "Sergej gibt Stellungnahme ab", "Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden." ], "source_lang": "DE", "target_lang": "EN-US"}'
Output without context:
{ "translations": [ { "detected_source_language": "DE", "text": "Sergej makes a statement" }, { "detected_source_language": "DE", "text": "Sergei Zhivkov explained yesterday that new measures will be taken." } ]}
Providing a longer snippet of context containing the complete name results in consistent transliteration:
curl -X POST 'https://api.deepl.com/v2/translate' \--header 'Authorization: DeepL-Auth-Key [your key]' \--header 'Content-Type: application/json' \--data '{ "text": [ "Sergej gibt Stellungnahme ab", "Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden." ], "source_lang": "DE", "target_lang": "EN-US", "context": "Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden."}'
Output with context:
{ "translations": [ { "detected_source_language": "DE", "text": "Sergei issues statement" }, { "detected_source_language": "DE", "text": "Sergei Zhivkov declared yesterday that new measures will be taken." } ]}
The context parameter is one of several ways to influence translation output. For a comparison of context with glossaries, style rules, custom instructions, and translation memories, see Choosing the right feature.
As noted in the text field reference, each text in the array is translated independently — they do not share context with each other.In this example, “Tor” might be translated as “gate” instead of “goal” because the first text doesn’t have access to the second one’s content.
{ "text": [ "Die Person stand vor dem Tor.", "Es war ein Fußballspiel." ], "target_lang": "EN-US"}
To ensure “Tor” is translated as “goal”, you can add additional sentences into the context parameter, or keep related content together in one text parameter.If you send a request with both context and multiple text parameters, the context parameter will be applied to each one.
When using the document translation endpoint, the engine automatically uses the broader document context. You don’t need to provide explicit context for full documents.
When using tag_handling=xml or tag_handling=html, tags are not used as a context boundary. The translation engine automatically looks across all content provided in each text parameter. As with other types of texts, you may need to provide additional context when translating single tags without surrounding content.
Enforce terminology: Learn how to use glossaries for consistent translations across all content
Control style and tone: Explore style rules for formatting and tone instructions
Translate full documents: Understand how document translation automatically handles context
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"DeepL Documentation","description":"Developer documentation for the DeepL API: translate text and documents, transcribe and translate speech in real time, improve text, and customize output with glossaries, style rules, and translation memories.","colors":{"primary":"#0f2b46","light":"#ffffff","dark":"#0f2b46"},"logo":{"light":"https://mintcdn.com/deepl-c950b784/QiF37QSCmRj62dXZ/_assets/logo/light_with_text.svg?fit=max\u0026auto=format\u0026n=QiF37QSCmRj62dXZ\u0026q=85\u0026s=2dfc0d736effb479c0ac145abe2ab2c3","dark":"https://mintcdn.com/deepl-c950b784/QiF37QSCmRj62dXZ/_assets/logo/dark_with_text.svg?fit=max\u0026auto=format\u0026n=QiF37QSCmRj62dXZ\u0026q=85\u0026s=1c796b7a29370a15d010c5f6cda342f3"},"favicon":"https://mintcdn.com/deepl-c950b784/QiF37QSCmRj62dXZ/_assets/favicon.svg?fit=max\u0026auto=format\u0026n=QiF37QSCmRj62dXZ\u0026q=85\u0026s=b46ca099e325b1b5f0ce2f0fc351e394","api":{"openapi":"api-reference/openapi.yaml","asyncapi":"api-reference/voice/voice.asyncapi.yaml","playground":{"proxy":false},"examples":{"defaults":"required","languages":["curl"]}},"appearance":{"default":"light","strict":false},"background":{"color":{"light":"#ffffff"}},"navbar":{"links":[{"href":"https://www.deepl.com/en/pro#api","label":"Pricing"}],"primary":{"type":"button","label":"Free API Key","href":"https://www.deepl.com/en/checkout?is_api=true"}},"footer":{"socials":{"facebook":"https://www.facebook.com/DeepLcom","linkedin":"https://www.linkedin.com/company/deepl","github":"https://github.com/DeepL","instagram":"https://www.instagram.com/deeplhq"},"links":[{"items":[{"label":"API Status","href":"https://status.deepl.com/?tab=api"},{"label":"DeepL Status","href":"https://status.deepl.com"},{"label":"Contact","href":"/docs/resources/contact"}]}]},"seo":{"metatags":{"google-site-verification":"0VDGg3gJk53xL5burIUykHtV_eBhXTp5AMdzaeffbbU"},"organization":{"id":"https://www.deepl.com/","name":"DeepL","legalName":"DeepL SE","url":"https://www.deepl.com","logo":"https://static.deepl.com/img/logo/deepl-logo-blue.svg","sameAs":["https://github.com/DeepL","https://www.linkedin.com/company/deepl","https://x.com/DeepLcom","https://www.instagram.com/deeplhq/","https://www.youtube.com/@DeepLcom"]},"indexing":"navigable"},"fonts":{"heading":{"family":"Roboto"},"body":{"family":"Roboto"}},"integrations":{"cookies":{"key":"deepl_cookie_consent","value":"accepted"}},"banner":{"content":"Help shape the DeepL API roadmap. [Take the survey](https://deepl.qualtrics.com/jfe/form/SV_8fbjoZx1wQUkAC2)","dismissible":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page does not exist. Humans: check out the [Quickstart](/docs/getting-started/quickstart) or the [API reference](/api-reference/translate/request-translation). Machines: try [/llms.txt](/llms.txt), [the docs MCP server](https://developers.deepl.com/mcp), or OpenAPI specs for [Text](/api-reference/openapi.yaml) and [Voice](/api-reference/voice/voice.asyncapi.yaml)."}},"contextual":{"options":["copy","download-spec","chatgpt","claude","cursor","vscode"],"display":"header"},"markdown":{"instructions":["Use the DeepL API when a task needs machine translation or text improvement, including translating text strings, whole documents with formatting preservation, or transcribing and translating live speech. Preferred terminology and phrasing may be enforced using customizations (glossaries, style rules, and translation memories). Retrieve supported languages for each product from the `/v3/languages` endpoints.","Read the machine-readable API surface instead of inferring request shapes from prose: the REST spec is at https://developers.deepl.com/api-reference/openapi.yaml (also served as openapi.json) and the Voice WebSocket protocol is at https://developers.deepl.com/api-reference/voice/voice.asyncapi.yaml. These docs also expose an MCP server at https://developers.deepl.com/mcp (Streamable HTTP, no authentication).","Use https://api.deepl.com for Pro plans and https://api-free.deepl.com for the Free plan. Authenticate every request with the header `Authorization: DeepL-Auth-Key \u003capi-key>`. Never fabricate an API key: ask the user for one, or point them at https://developers.deepl.com/docs/getting-started/quickstart.","Errors use standard HTTP status codes with a JSON body containing a `message` field, plus a `code` field where available, and an `X-Trace-ID` response header that identifies the request in DeepL's logs. Log `X-Trace-ID` by default. Retry 429 and 5xx with exponential backoff. Do not retry 456, which means the account quota is exhausted, or 400, which means the request itself is invalid."]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"deepl-c950b784","hasAudioNarration":false,"actualSubdomain":"deepl-c950b784","customDomains":["developers.deepl.com"],"gitSource":{"type":"github","owner":"deepl","repo":"api-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adf546c6c71dd37a987fec4","collectionId":"14e3f4cf-3d64-4e31-b78c-6a7fda71bcd7","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adf546c6c71dd37a987fec4"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6adf546c6c71dd37a987fec4","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"API Reference","count":66},{"language":"default","tag":"Customize","count":55},{"language":"default","tag":"Home","count":35},{"language":"default","tag":"Translate","count":23},{"language":"default","tag":"Glossaries","count":17},{"language":"default","tag":"Admin","count":14},{"language":"default","tag":"Style Rules","count":12},{"language":"default","tag":"Spoken Terms","count":10},{"language":"default","tag":"Text Translation","count":10},{"language":"default","tag":"Voice","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"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":"editor-v7-file-tree","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":"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"editor-agent-model-picker","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"cookie-banner.css","content":"#cookie-banner{position:fixed;bottom:0;left:0;width:100%;background:#0f2b46;color:#fff;padding:20px;display:flex;justify-content:space-between;align-items:center;gap:20px;z-index:10000;box-shadow:0 -2px 10px rgba(0,0,0,.2);font-family:Roboto,sans-serif}#cookie-banner-content{flex:1}#cookie-banner-text{margin:0;font-size:14px;line-height:1.5}#cookie-banner-text a{color:#4fc3f7;text-decoration:underline}#cookie-banner-buttons{display:flex;gap:12px;flex-shrink:0}#cookie-accept,#cookie-reject{padding:10px 20px;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s;font-family:Roboto,sans-serif}#cookie-reject{background:0 0;color:#fff;border:1px solid #fff}#cookie-reject:hover{background:rgba(255,255,255,.1)}#cookie-accept{background:#fff;color:#0f2b46;border:0}#cookie-accept:hover{background:#e6e6e6}@media (max-width:768px){#cookie-banner{flex-direction:column;align-items:stretch;gap:16px;padding:16px}#cookie-banner-buttons{width:100%;justify-content:stretch}#cookie-accept,#cookie-reject{flex:1}}"},{"filePath":"user-study-popup.css","content":"#user-study-popup{position:fixed;right:24px;bottom:24px;z-index:9999;pointer-events:none;font-family:Roboto,sans-serif}#user-study-card{position:relative;width:360px;max-width:calc(100vw - 48px);padding:24px;background:#fff;border:1px solid rgba(15,43,70,.12);border-radius:16px;box-shadow:0 20px 45px rgba(15,43,70,.16),0 6px 16px rgba(15,43,70,.1);pointer-events:auto;transform:translateX(calc(100% + 48px));transition:transform .35s ease}#user-study-card.slide-in{transform:translateX(0)}#user-study-card.slide-out{transform:translateX(calc(100% + 48px));transition:transform .25s ease-in}#user-study-close{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:999px;background:0 0;color:#6b7280;font-size:24px;line-height:1;cursor:pointer}#user-study-close:hover{background:rgba(15,43,70,.06);color:#0f2b46}#user-study-eyebrow{margin:0 0 8px;color:#0f2b46;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}#user-study-content h3{margin:0 28px 12px 0;color:#111827;font-size:22px;font-weight:700;line-height:1.2}#user-study-content p{margin:0 0 18px;color:#4b5563;font-size:14px;line-height:1.5}#user-study-cta{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:44px;border-radius:999px;background:#0f2b46;color:#fff;font-size:14px;font-weight:600;text-decoration:none}#user-study-cta:hover{background:#133858}@media (max-width:480px){#user-study-popup{right:16px;bottom:16px;left:16px}#user-study-card{width:auto;max-width:none;padding:20px}#user-study-content h3{font-size:20px}}"},{"filePath":"navbar-cta.css","content":"html.dark #topbar-cta-button a>span:first-child{background-color:#fff!important}html.dark #topbar-cta-button a,html.dark #topbar-cta-button a span,html.dark #topbar-cta-button a svg{color:#292929!important}"}],"page":{"pagePath":"docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter","slug":"/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter","pageMetadata":{"title":"How to Use the Context Parameter Effectively","description":"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.","public":true,"href":"/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter"},"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 when and how to use the context parameter to improve translation accuracy for ambiguous content.\"\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`,code:`code`,em:`em`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`This guide shows you:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`When to use `,_jsx(_components.code,{children:`context`}),` (and when not to)`]}),`\n`,_jsxs(_components.li,{children:[`How to use `,_jsx(_components.code,{children:`context`}),` to resolve ambiguous words, genders, or transliterations`]}),`\n`,_jsxs(_components.li,{children:[`Where to find a comparison of `,_jsx(_components.code,{children:`context`}),` with DeepL’s customization features`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`what-the-context-parameter-is-for`,children:`What the context parameter is for`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`context`}),` parameter helps DeepL’s API translate ambiguous words and short text snippets more accurately by providing the surrounding content. Think of it like showing a human translator the paragraphs before and after the sentence being translated.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`context`}),` parameter can help with:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Picking the correct translation for ambiguous words`}),`\n`,_jsx(_components.li,{children:`Providing grammatical clues for gender, number, or case that isn’t clear from the text alone`}),`\n`,_jsx(_components.li,{children:`Improving translations of short snippets such as headlines or product names`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-the-context-parameter-is-not-for`,children:`What the context parameter is NOT for`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Common Misconception:`}),` Many users try to use `,_jsx(_components.code,{children:`context`}),` like ChatGPT system prompts. `,_jsx(_components.strong,{children:`This does not work reliably.`})]})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`context`}),` parameter is `,_jsx(_components.strong,{children:`not`}),` designed for:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`LLM-style instructions: “Translate with a friendly, casual tone”`}),`\n`,_jsx(_components.li,{children:`Translation rules: “Always translate ‘Tor’ as ‘gate’”`}),`\n`,_jsx(_components.li,{children:`Cultural context: “Adapt for German cultural norms”`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Using `,_jsx(_components.code,{children:`context`}),` like this will produce unpredictable results. The parameter is optimized for document content, not commands.`]}),`\n`,_jsx(_components.p,{children:`Instead, try:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/customize/using-style-rules`,children:`Style rules and custom instructions`}),`: For tone, style, formatting, and translation instructions`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/docs/customize/managing-glossaries`,children:`Glossaries`}),`: For consistent terminology and brand names`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`how-to-use-context-for-ambiguous-words`,children:`How to use context for ambiguous words`}),`\n`,_jsx(_components.p,{children:`When a word has multiple meanings, surrounding context helps the translation engine choose the correct interpretation.`}),`\n`,_jsx(Heading,{level:`3`,id:`example`,children:`Example`}),`\n`,_jsx(_components.p,{children:`“Tor” could mean “gate” or “goal” in German. Without context, DeepL may not know which meaning you intend:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Die Person stand vor dem Tor.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"EN-US\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Output without context:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\"The person was standing in front of the gate.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`If you’re writing about a football game, provide context to clarify:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Die Person stand vor dem Tor.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"EN-US\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"context\": \"Es war ein Fußballspiel.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Output with context:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\"The person was standing in front of the goal.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`when-to-use-this-approach`,children:`When to use this approach`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You’re translating short snippets that lack built-in context`}),`\n`,_jsx(_components.li,{children:`The text contains words with multiple meanings`}),`\n`,_jsx(_components.li,{children:`The surrounding content makes the intended meaning clear`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`how-to-use-context-for-grammatical-gender`,children:`How to use context for grammatical gender`}),`\n`,_jsx(_components.p,{children:`When grammatical gender isn’t clear from the source text, context can provide the necessary clues.`}),`\n`,_jsx(Heading,{level:`3`,id:`example-2`,children:`Example`}),`\n`,_jsx(_components.p,{children:`Without context, DeepL may not use the desired gender when translating:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The teacher asked the class to tidy up after they finished the lesson.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"DE\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Output without context:`}),` (uses masculine form “Lehrer”)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\"Der Lehrer bat die Klasse, nach der Stunde aufzuräumen.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`You can provide context from the surrounding text that clarifies the teacher’s gender:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The teacher asked the class to tidy up after they finished the lesson.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"DE\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"context\": \"She did not want to tidy up herself.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Output with context:`}),` (uses feminine form “Lehrerin”)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\"Die Lehrerin bat die Klasse, nach der Stunde aufzuräumen.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`when-to-use-this-approach-2`,children:`When to use this approach`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Translating into languages with grammatical gender`}),`\n`,_jsx(_components.li,{children:`The source text doesn’t specify gender`}),`\n`,_jsx(_components.li,{children:`You have surrounding sentences that contain gender clues`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`how-to-use-context-for-consistent-name-translation`,children:`How to use context for consistent name translation`}),`\n`,_jsx(_components.p,{children:`When translating names in headlines or short snippets, the same name might be transliterated differently unless additional context is provided.`}),`\n`,_jsx(Heading,{level:`3`,id:`example-3`,children:`Example`}),`\n`,_jsxs(_components.p,{children:[`As noted in the `,_jsxs(_components.a,{href:`/api-reference/translate/request-translation`,children:[_jsx(_components.code,{children:`text`}),` field reference`]}),`, each text in the array is translated independently and texts do not share context with each other. This results in different transliterations for the name “Sergej”.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sergej gibt Stellungnahme ab\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source_lang\": \"DE\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"EN-US\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Output without context:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"translations\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"detected_source_language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sergej makes a statement\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"detected_source_language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sergei Zhivkov explained yesterday that new measures will be taken.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Providing a longer snippet of `,_jsx(_components.code,{children:`context`}),` containing the complete name results in consistent transliteration:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.deepl.com/v2/translate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: DeepL-Auth-Key [your key]'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sergej gibt Stellungnahme ab\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source_lang\": \"DE\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\": \"EN-US\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"context\": \"Sergej Zhivkov erklärte gestern, dass neue Maßnahmen ergriffen werden.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Output with context:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"translations\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"detected_source_language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sergei issues statement\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"detected_source_language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sergei Zhivkov declared yesterday that new measures will be taken.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`when-to-use-this-approach-3`,children:`When to use this approach`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Translating news headlines separately from article bodies`}),`\n`,_jsx(_components.li,{children:`Transliterating names with multiple possible spellings in your target language`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`choosing-the-right-feature`,children:`Choosing the right feature`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`context`}),` parameter is one of several ways to influence translation output. For a comparison of `,_jsx(_components.code,{children:`context`}),` with glossaries, style rules, custom instructions, and translation memories, see `,_jsx(_components.a,{href:`/docs/customize/overview#choosing-the-right-feature`,children:`Choosing the right feature`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`technical-details`,children:`Technical details`}),`\n`,_jsx(Heading,{level:`3`,id:`cost`,children:`Cost`}),`\n`,_jsxs(_components.p,{children:[`Characters in the `,_jsx(_components.code,{children:`context`}),` parameter do not count toward billing. Only characters sent in the `,_jsx(_components.code,{children:`text`}),` parameter are billed.`]}),`\n`,_jsx(Heading,{level:`3`,id:`size-limit`,children:`Size limit`}),`\n`,_jsxs(_components.p,{children:[`There is no size limit for the `,_jsx(_components.code,{children:`context`}),` parameter itself, but the request body size limit of 128 KiB applies to all text translation requests.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`multi-text-requests`,children:[`Multi-`,_jsx(_components.code,{children:`text`}),` requests`]}),`\n`,_jsxs(_components.p,{children:[`As noted in the `,_jsxs(_components.a,{href:`/api-reference/translate/request-translation`,children:[_jsx(_components.code,{children:`text`}),` field reference`]}),`, each text in the array is translated independently — they do not share context with each other.`]}),`\n`,_jsxs(_components.p,{children:[`In this example, “Tor” might be translated as “gate” instead of “goal” because the first `,_jsx(_components.code,{children:`text`}),` doesn’t have access to the second one’s content.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,children:[_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\"`}),_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:` \"Die Person stand vor dem Tor.\"`}),_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:` \"Es war ein Fußballspiel.\"`})}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"target_lang\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"EN-US\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`To ensure “Tor” is translated as “goal”, you can add additional sentences into the `,_jsx(_components.code,{children:`context`}),` parameter, or keep related content together in one `,_jsx(_components.code,{children:`text`}),` parameter.`]}),`\n`,_jsxs(_components.p,{children:[`If you send a request with both `,_jsx(_components.code,{children:`context`}),` and multiple `,_jsx(_components.code,{children:`text`}),` parameters, the `,_jsx(_components.code,{children:`context`}),` parameter will be applied to each one.`]}),`\n`,_jsx(Heading,{level:`3`,id:`document-translation`,children:`Document translation`}),`\n`,_jsxs(_components.p,{children:[`When using the `,_jsx(_components.a,{href:`/api-reference/document/upload-and-translate-a-document`,children:`document translation endpoint`}),`, the engine automatically uses the broader document context. You don’t need to provide explicit context for full documents.`]}),`\n`,_jsx(Heading,{level:`3`,id:`tag-handling`,children:`Tag handling`}),`\n`,_jsxs(_components.p,{children:[`When using `,_jsx(_components.code,{children:`tag_handling=xml`}),` or `,_jsx(_components.code,{children:`tag_handling=html`}),`, tags are `,_jsx(_components.em,{children:`not`}),` used as a context boundary. The translation engine automatically looks across all content provided in each `,_jsx(_components.code,{children:`text`}),` parameter. As with other types of texts, you may need to provide additional `,_jsx(_components.code,{children:`context`}),` when translating single tags without surrounding content.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsx(_components.p,{children:`Now that you understand the context parameter:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Try it yourself:`}),` Review the `,_jsx(_components.a,{href:`/api-reference/translate/request-translation`,children:`text translation API reference`}),` for complete context parameter specifications`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Enforce terminology:`}),` Learn how to use `,_jsx(_components.a,{href:`/docs/customize/managing-glossaries`,children:`glossaries`}),` for consistent translations across all content`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Control style and tone:`}),` Explore `,_jsx(_components.a,{href:`/docs/customize/using-style-rules`,children:`style rules`}),` for formatting and tone instructions`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Translate full documents:`}),` Understand how `,_jsx(_components.a,{href:`/api-reference/document/upload-and-translate-a-document`,children:`document translation`}),` automatically handles context`]}),`\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":"How to Use the Context Parameter Effectively","description":"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.","public":true,"href":"/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What the context parameter is for","slug":"what-the-context-parameter-is-for","depth":2,"children":[]},{"title":"What the context parameter is NOT for","slug":"what-the-context-parameter-is-not-for","depth":2,"children":[]},{"title":"How to use context for ambiguous words","slug":"how-to-use-context-for-ambiguous-words","depth":2,"children":[{"title":"Example","slug":"example","depth":3,"children":[]},{"title":"When to use this approach","slug":"when-to-use-this-approach","depth":3,"children":[]}]},{"title":"How to use context for grammatical gender","slug":"how-to-use-context-for-grammatical-gender","depth":2,"children":[{"title":"Example","slug":"example-2","depth":3,"children":[]},{"title":"When to use this approach","slug":"when-to-use-this-approach-2","depth":3,"children":[]}]},{"title":"How to use context for consistent name translation","slug":"how-to-use-context-for-consistent-name-translation","depth":2,"children":[{"title":"Example","slug":"example-3","depth":3,"children":[]},{"title":"When to use this approach","slug":"when-to-use-this-approach-3","depth":3,"children":[]}]},{"title":"Choosing the right feature","slug":"choosing-the-right-feature","depth":2,"children":[]},{"title":"Technical details","slug":"technical-details","depth":2,"children":[{"title":"Cost","slug":"cost","depth":3,"children":[]},{"title":"Size limit","slug":"size-limit","depth":3,"children":[]},{"title":"Multi-text requests","slug":"multi-text-requests","depth":3,"children":[]},{"title":"Document translation","slug":"document-translation","depth":3,"children":[]},{"title":"Tag handling","slug":"tag-handling","depth":3,"children":[]}]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/deepl-c950b784/79954643574228d7/analytics.js","/_mintlify/custom/deepl-c950b784/7c795428034ccd8b/cookie-banner.js","/_mintlify/custom/deepl-c950b784/e09568492714dd0f/user-study-popup.js","/_mintlify/custom/deepl-c950b784/06c83788a8296584/user-data.js"],"subdomain":"deepl-c950b784","siteName":"DeepL Documentation","title":"How to Use the Context Parameter Effectively - DeepL Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-28T19:57:16.670Z","originalFileLocation":"docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter.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=\"light\"}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 when and how to use the context parameter to improve translation accuracy for ambiguous content.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DeepL Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_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/deepl-c950b784/hSlhr1iEcolF1mhS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How to Use the Context Parameter Effectively - DeepL Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DeepL Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://deepl-c950b784.mintlify.app/_mintlify/api/og/v2?division=Text+Translation\u0026amp;title=How+to+Use+the+Context+Parameter+Effectively\u0026amp;description=Learn+when+and+how+to+use+the+context+parameter+to+improve+translation+accuracy+for+ambiguous+content.\u0026amp;theme=a0c51edccdcaa2c1bb0516c1\u0026amp;signature=30f0c09f0ee548cf9591e5c25137b40c26acce9b148343e9eccba5188bebd86a\">\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=\"How to Use the Context Parameter Effectively - DeepL Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://deepl-c950b784.mintlify.app/_mintlify/api/og/v2?division=Text+Translation\u0026amp;title=How+to+Use+the+Context+Parameter+Effectively\u0026amp;description=Learn+when+and+how+to+use+the+context+parameter+to+improve+translation+accuracy+for+ambiguous+content.\u0026amp;theme=a0c51edccdcaa2c1bb0516c1\u0026amp;signature=30f0c09f0ee548cf9591e5c25137b40c26acce9b148343e9eccba5188bebd86a\">\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/deepl-c950b784/hSlhr1iEcolF1mhS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DeepL Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0f2b46\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"0VDGg3gJk53xL5burIUykHtV_eBhXTp5AMdzaeffbbU\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.deepl.com/\",\"name\":\"DeepL\",\"legalName\":\"DeepL SE\",\"url\":\"https://www.deepl.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://static.deepl.com/img/logo/deepl-logo-blue.svg\"},\"sameAs\":[\"https://github.com/DeepL\",\"https://www.linkedin.com/company/deepl\",\"https://x.com/DeepLcom\",\"https://www.instagram.com/deeplhq/\",\"https://www.youtube.com/@DeepLcom\"]},{\"@type\":\"WebSite\",\"@id\":\"https://developers.deepl.com#website\",\"name\":\"DeepL Documentation\",\"url\":\"https://developers.deepl.com\",\"publisher\":{\"@id\":\"https://www.deepl.com/\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter#webpage\",\"url\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter\",\"name\":\"How to Use the Context Parameter Effectively\",\"description\":\"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.\",\"dateModified\":\"2026-07-28T19:57:16.670Z\",\"isPartOf\":{\"@id\":\"https://developers.deepl.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Text Translation\",\"item\":\"https://developers.deepl.com/docs/translate/translate-text-quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use the Context Parameter Effectively\",\"item\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter#article\",\"headline\":\"How to Use the Context Parameter Effectively\",\"name\":\"How to Use the Context Parameter Effectively\",\"description\":\"Learn when and how to use the context parameter to improve translation accuracy for ambiguous content.\",\"url\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter\",\"mainEntityOfPage\":{\"@id\":\"https://developers.deepl.com/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter#webpage\"},\"dateModified\":\"2026-07-28T19:57:16.670Z\",\"publisher\":{\"@id\":\"https://www.deepl.com/\"},\"isPartOf\":{\"@id\":\"https://developers.deepl.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DeepL Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DeepL Documentation","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":"/docs/getting-started/quickstart"}]},{"tab":"Translate","icon":"language","pages":[{"title":"Translate","sidebarTitle":"Overview","href":"/docs/translate/overview"},{"group":"Text Translation","pages":[{"title":"Translate Text Quickstart","description":"Send your first text translation request to the DeepL API and batch multiple strings into a single call.","href":"/docs/translate/translate-text-quickstart"},{"title":"How to Use the Context Parameter Effectively","href":"/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter"},{"title":"Translating Large Volumes of Text","description":"Batch texts, control sentence splitting, and parallelize requests to translate high volumes efficiently with the text translation endpoint.","href":"/docs/translate/translating-large-volumes"},{"title":"Understanding Model Types","href":"/docs/translate/understanding-model-types"},{"title":"How to Use Custom Reporting Tags","href":"/docs/learning-how-tos/examples-and-guides/how-to-use-custom-reporting-tags"},{"title":"How to Translate Between Language Variants","href":"/docs/learning-how-tos/examples-and-guides/translating-between-variants"},{"title":"Mustache placeholder tags","href":"/docs/learning-how-tos/examples-and-guides/placeholder-tags"},{"title":"Translating XML","href":"/docs/translate/translating-xml"},{"title":"Translating HTML","href":"/docs/translate/translating-html"},{"title":"Language detection","mode":"wide","href":"/docs/best-practices/language-detection"}]},{"group":"Document Translation","pages":[{"title":"Translate Documents Quickstart","href":"/docs/translate/translate-documents-quickstart"},{"title":"Document translations","mode":"wide","href":"/docs/best-practices/document-translations"}]},{"group":"Write","pages":[{"title":"Write Quickstart","href":"/docs/translate/write-quickstart"},{"title":"Controlling Writing Style and Tone","href":"/docs/translate/controlling-writing-style-and-tone"}]}]},{"tab":"Voice","icon":"waveform-lines","pages":[{"title":"Voice","href":"/docs/voice/overview"}]},{"tab":"Customize","icon":"wand-magic-sparkles","pages":[{"title":"Customize","href":"/docs/customize/overview"}]},{"tab":"Admin","icon":"sliders","pages":[{"title":"Admin","href":"/docs/admin/overview"}]},{"tab":"API Reference","icon":"code","pages":[{"title":"API Reference","href":"/api-reference/translate/request-translation"}]}]},"title":"How to Use the Context Parameter Effectively - DeepL Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":["10e4515597"],"chunks":["BannerMarkdown-BVNUlwBc.js","dist-aeztFa9U.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-rL8ZCCw4.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}