HTTP

JSON DeepL API documentation for translating JSON objects and text by using HTTP requests.

Translate JSON Object via API

Endpoint: POST https://api.jsondeepl.com/v1/translate/json

Body Parameters

apiKey
string required
Your JSON DeepL API key. You can get your API key from your account.
src
string required
The source language code for the translations. Refer to the supported source languages for the list of available language codes. E.g. en *case insensitive
to
string[] required
The target language codes for the translations. Refer to the supported target languages for the list of available language codes. E.g. ["de", "fr", "es"] *case insensitive
json
JsonFileObject required
The JSON object to be translated.
The object can be nested and contain multiple key-value pairs. arrays are not supported.
type JsonFileObject = {
  [key: string]: string | JsonFileObject
}
formality
'prefer_less' | 'prefer_more'
defaults to prefer_less
Specifies the formality level of the translation.
  • prefer_less: Translations will be casual tone where applicable.
  • prefer_more: Translations will be more formal where applicable.

Response

status
success | error
The status of the translation request.
data
TranslateApiJsonResponse | null
The translated JSON object. Will be null on error.
type TranslateApiJsonResponse = {
  [key in TargetLanguageCode]: JsonFileObject
}

type JsonFileObject = {
  [key: string]: string | JsonFileObject
}
error
ErrorObject | null
The error object containing the error code and message. Will be null on success.
type ErrorObject = {
  code: "USER_NOT_FOUND" | "INSUFFICIENT_CREDIT" | "INTERNAL_SERVER_ERROR"
  message: string
}
  • USER_NOT_FOUND: The provided API key is invalid or user's subscription has expired.
  • INSUFFICIENT_CREDIT: The user does not have enough credit to perform the translation.
  • INTERNAL_SERVER_ERROR: An unexpected error occurred on the server.

Translate Text via API

Endpoint: POST https://api.jsondeepl.com/v1/translate/text

Body Parameters

apiKey
string required
Your JSON DeepL API key. You can get your API key from your account.
src
string required
The source language code for the translations. Refer to the supported source languages for the list of available language codes. E.g. en *case insensitive
to
string[] required
The target language codes for the translations. Refer to the supported target languages for the list of available language codes. E.g. ["de", "fr", "es"] *case insensitive
text
string required
The text to be translated.
formality
'prefer_less' | 'prefer_more'
defaults to prefer_less
Specifies the formality level of the translation.
  • prefer_less: Translations will be casual tone where applicable.
  • prefer_more: Translations will be more formal where applicable.

Response

status
success | error
The status of the translation request.
data
TranslateApiTextResponse | null
The translated JSON object. Will be null on error.
type TranslateApiTextResponse = {
  [key in TargetLanguageCode]: string
}
error
ErrorObject | null
The error object containing the error code and message. Will be null on success.
type ErrorObject = {
  code: "USER_NOT_FOUND" | "INSUFFICIENT_CREDIT" | "INTERNAL_SERVER_ERROR"
  message: string
}
  • USER_NOT_FOUND: The provided API key is invalid or user's subscription has expired.
  • INSUFFICIENT_CREDIT: The user does not have enough credit to perform the translation.
  • INTERNAL_SERVER_ERROR: An unexpected error occurred on the server.