---
type: api
title: Get behavioral analytics collections
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics
products:
  - Elasticsearch
---

# Get behavioral analytics collections


deprecated

Availability: Experimental since 8.8

## Paths

- `GET` `/_application/analytics/{name}`
- `GET` `/_application/analytics`

#### Path parameters

- `name` (string[]) — optional, leave it out to use `/_application/analytics`
  A list of analytics collections to limit the returned information

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Response

`application/json`

- `<string>` (object)
  - `event_data_stream` (object)
    Data stream for the collection.
    - `name` (string)
## Code examples

#### Console

```console
GET _application/analytics/my*
```

#### JavaScript

```javascript
const response = await client.searchApplication.getBehavioralAnalytics({
  name: "my*",
});
```

#### Python

```python
resp = client.search_application.get_behavioral_analytics(
    name="my*",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_application/analytics/my*" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.searchApplication().getBehavioralAnalytics(g -> g
    .name("my*")
);
```

#### C#

```c#
var response = await client.SearchApplication
    .GetBehavioralAnalyticsAsync(d1 => d1
        .Name(["my*"])
    );
```

#### PHP

```php
$resp = $client->searchApplication()->getBehavioralAnalytics([
    "name" => "my*",
]);
```

#### Ruby

```ruby
response = client.search_application.get_behavioral_analytics(
  name: "my*"
)
```

## Response examples

#### Behavioral analytics get response example1

A successful response from `GET _application/analytics/my*`

```json
{
  "my_analytics_collection": {
      "event_data_stream": {
          "name": "behavioral_analytics-events-my_analytics_collection"
      }
  },
  "my_analytics_collection2": {
      "event_data_stream": {
          "name": "behavioral_analytics-events-my_analytics_collection2"
      }
  }
}
```

