# Get tokens from text analysis **POST /{index}/_analyze** **All methods and paths for this operation:**
GET /_analyze
POST /_analyze
GET /{index}/_analyze
POST /{index}/_analyze
The analyze API performs analysis on a text string and returns the resulting tokens. Generating excessive amount of tokens may cause a node to run out of memory. The `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced. If more than this limit of tokens gets generated, an error occurs. The `_analyze` endpoint without a specified index will always use `10000` as its limit. ## Required authorization * Index privileges: `index` [External documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/analysis.html) ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth - Basic auth - Bearer auth ## Parameters ### Path parameters - **index** (string) Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. ### Query parameters - **index** (string) Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. ### Body: application/json (object) - **analyzer** (string) The name of the analyzer that should be applied to the provided `text`. This could be a built-in analyzer, or an analyzer that’s been configured in the index. - **attributes** (array[string]) Array of token attributes used to filter the output of the `explain` parameter. - **char_filter** (array) Array of character filters used to preprocess characters before the tokenizer. - **explain** (boolean) If `true`, the response includes token attributes and additional details. - **field** (string) Field used to derive the analyzer. To use this parameter, you must specify an index. If specified, the `analyzer` parameter overrides this value. - **filter** (array) Array of token filters used to apply after the tokenizer. - **normalizer** (string) Normalizer to use to convert text into a single token. - **text** (string | array[string]) Text to analyze. If an array of strings is provided, it is analyzed as a multi-value field. - **tokenizer** () Tokenizer to use to convert text into tokens. ## Responses ### 200 #### Body: application/json (object) - **detail** (object) - **tokens** (array[object]) [Powered by Bump.sh](https://bump.sh)