*This page
applies to **Apigee** and **Apigee hybrid**.*


*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*
![](https://fonts.gstatic.com/s/i/googlematerialicons/help/v13/gm_grey-24dp/1x/gm_help_gm_grey_24dp.png)

A
[data collector](https://docs.cloud.google.com/apigee/docs/reference/apis/apigee/rest.md.txt#rest-resource:-v1.organizations.datacollectors) resource enables you to collect a wide variety of custom data from API traffic.
Once you have created a data collector, you specify the data you want to gather using the
[DataCapture](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/data-capture-policy.md.txt) policy.
The data collector is like a shopping cart, and the DataCapture policy is a shopping list
for the data you want to capture.

> [!NOTE]
> **Note:** If you use a data collector in multiple policies, the captured data will be overwritten by the last policy that executes.

For a list of the quantities related to API traffic that you can capture
using the data collector resource, see
[Metrics](https://docs.cloud.google.com/apigee/docs/api-platform/analytics/analytics-reference.md.txt).

## Creating a data collector

You can create a data collector resource in the Apigee UI or with the Apigee API:

### Apigee UI

To create a data collector resource using Apigee UI:

1. In the Google Cloud console, go to the **Apigee \> Management \> Data Collectors** page.

   [Go to Data Collectors](https://console.cloud.google.com/apigee/datacollectors)
2. In the **Data Collectors** view, click **Create**.
3. In the **Add data collector** dialog, enter the following information:
   - **Name** : A name for the data collector.

     > [!NOTE]
     > **Note:** The name for a data collector must begin with `dc_`.

     > [!WARNING]
     > **Warning:** Do *not* create two data collectors whose names differ only by case, such as `dc_my_data` and `dc_My_Data`, as then exporting data will result in a "duplicate column names" error.

   - **Type** : The type of the data to be collected (`Integer`, `String`, and so on).
   - **Description**: An informal description of the data to be collected, possibly including the reason for collecting it. This is for the benefit of other API developers who may be involved in analyzing the data.
4. Click **Add**.

To edit or delete a data collector, click the three dots at the end of its row under
**Actions** , and select either **Edit** or **Delete**.

### Apigee API

You can create a [data collector](https://docs.cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.datacollectors.md.txt) resource using the Apigee API. For example:

```
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X POST -H "content-type:application/json" \
  -d '
{
  "name": "dc_data_collector",
  "description": "Collects data for analysis.",
  "type": "STRING",
}' \
  "https://apigee.googleapis.com/v1/organizations/ORG/datacollectors"
```

where <var translate="no">ORG</var> is the name of the organization.
This creates a resource named `dc_data_collector`, which you can use in
the [DataCapture](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/data-capture-policy.md.txt) policy.

> [!NOTE]
> **Notes:**
>
> - The name of the data collector resource must begin with the prefix `dc_`.
> - If you use a data collector in multiple DataCapture policies, the captured data will be overwritten by the last policy that executes.

> [!WARNING]
> **Warning:** Do *not* create two data collectors whose names differ only by case, such as `dc_my_data` and `dc_My_Data`, as then exporting data will result in a "duplicate column names" error.