In short. Set target_language to a supported code such as EN to request one output language.
Definition: Set the Kagi Universal Summarizer API's optional
target_languageparameter to a supported language code. Kagi documents that specifying a language adds an explicit translation step, and thatENensures all passages are translated as English.
Key facts
target_languageis an optional string parameter whose description is “Desired output language” in Kagi's Universal Summarizer API documentation.- When no language is specified, Kagi says the document's original language can influence the summarizer's output.
- Specifying a language adds an explicit translation step for the summary to the desired language.
- The API documentation uses
ENas the example that ensures all passages are translated as English. - On the website, Kagi says a summary can optionally be translated using Kagi Translate in its Kagi Summarize documentation.
How does target_language work?
Kagi exposes the control on the GET/POST /summarize endpoint. The parameter table marks target_language as optional and describes it as the desired output language. Requests can use URL parameters with GET, a JSON body with POST, or a form body with POST. A GET request that asks for English can therefore look like this:
curl -G \
-H "Authorization: Bot $TOKEN" \
--data-urlencode "engine=cecil" \
--data-urlencode "url=https://www.youtube.com/watch?v=ZSRHeXYDLko" \
--data-urlencode "target_language=EN" \
"https://kagi.com/api/v0/summarize"
The code table lists EN as English, FR as French, and ZH-HANT as traditional Chinese. The API documentation also states that the request must provide either url or text, because those two parameters are exclusive.
What changes when the parameter is omitted?
Omitting target_language leaves the document's original language able to influence the output. Kagi gives a Spanish document as its example: the summary may itself be in Spanish or may contain Spanish passages. This is the documented default behavior, so a client that needs one language should send a supported code instead of relying on the input document's language.
When a code is supplied, Kagi describes an explicit translation step that translates the summary to the desired language. Its concrete example is EN: the documentation says this ensures all passages are translated as English. The page does not document a separate language-detection setting or a client-side post-processing requirement.
Is the website control the same as the API control?
Kagi's end-user documentation describes Kagi Summarize as a tool for summarizing a page, a video, or a podcast when a transcript is available. It lists three modes in the Mode dropdown: Summary, Bullet Points, and ELI5. In the Translation section, it says that a summary can optionally be translated using Kagi Translate.
That wording documents a website translation action, while the API page documents target_language as a request parameter. The API page also identifies the returned output field as the summarization output. An integration can therefore inspect that field after sending the language code.
What should an API request contain?
The language choice is only one optional field. The same API table lists engine, summary_type, and cache as optional parameters, while url and text are required alternatives. Kagi recommends POST for the text parameter to avoid URL length limits, and states that the total request size is limited to 1MB.
For a text request, the language control remains target_language and the input remains text; the API does not describe a different language parameter for raw text. The response object contains an output string and a tokens integer, according to the same documentation.
Related terms
- Kagi Universal Summarizer
- Can Kagi's Summarizer API receive text without a public URL?
- How can a Kagi webpage summary be simplified for a nontechnical reader?
- Can Kagi Summarize read PDFs, slide decks, and audio links?
FAQ
What value forces an English output?
Set target_language to EN. Kagi's API documentation says that specifying EN ensures all passages are translated as English.
What happens when target_language is left out?
The document's original language is allowed to influence the summary. Kagi gives Spanish content as an example where the output may be Spanish or contain Spanish passages.
Is Kagi Translate required for an API request?
No separate Kagi Translate action is documented for the API request. The API page documents target_language, while the website page describes optional translation using Kagi Translate.
Sources
Check how a page reads to answer engines. Open the GEO score analyzer