---
title: "POST /v3/{+parent}:detectLanguage"
method: POST
path: "/v3/{+parent}:detectLanguage"
tags: ["projects"]
---

# POST /v3/{+parent}:detectLanguage

`POST /v3/{+parent}:detectLanguage`

Detects the language of text within a request.

## Path parameters

- `parent` string, required

## Request body

- DetectLanguageRequest — The request message for language detection.
  - `model` string — Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used.
  - `mimeType` string — Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
  - `documentInputConfig` DocumentInputConfig — A document translation request input config.
    - `gcsSource` GcsSource — The Google Cloud Storage location for the input content.
      - `inputUri` string — Required. Source data URI. For example, `gs://my_bucket/my_object`.
    - `content` string, byte — Document's content represented as a stream of bytes.
    - `mimeType` string — Specifies the input document's mime_type. If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content the mime_type must be provided. Currently supported mime types are: - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  - `labels` object — Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/advanced/labels for more information.
  - `content` string — The content of the input stored as a string.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/translate.md) · [All operations](https://skmtc.dev/google/apis/translate/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/translate/revisions/1597c11ae5de/schema)
