[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Mon Sep 02 2019

How to Export Bitmovin Analytics Data

OverviewLink Icon

While its the easiest way to leverage the Bitmovin Analytics API using our API clients, you can also export the raw analytics data to your own storage and process that data in your own custom way.

The export itself is handled as task and takes some time to process, depending on how much data needs to be exported. Therefore, please see below how you can create an export task and how you can track its progress.

RequirementsLink Icon

Currently, Bitmovin only allows exporting analytics data to an S3 role-based output. First, you must create the bucket on your S3 account as well as create the output on Bitmovin. Learn how to do create one here.

WorkflowLink Icon

  1. Create an Export Task - In order to export Analytics Data the following parameters are required
  • name - A descriptive name for the export task
  • startTime/endTime - It describes a datetime range that shall be exported
  • licenseKey - The Analytics License that holds the data that shall be exported
  • output - A configuration that holds the ID of an existing S3 role-based Analytics Output, and an output path the export shall be transferred to
  1. Track the status of your Export Task - An Export Task can have 4 different states:
  • QUEUED - Your Export Task was created successfully, and is waiting for a free slot to be processed
  • STARTED - Your Export Task is in progress. Please see the progress property which indicates the current progress in percent.
  • FINISHED - Your Export Task has finished and was transferred successfully
  • ERROR - We were probably unable to transfer the export to your storage. Please check your AWS Role configuration in this case. Please see this tutorial for more details about it. If you come to the conclusion that it should work as expected please reach out to our support team.

(Java) Analytics Export Task ExampleLink Icon

This example uses our latest Open API client for Java, which is available on Github.

Create an Analytics Export Task

1bitmovinApi = BitmovinApi.builder().withApiKey("YOUR_BITMOVIN_API_KEY").build();
2
3ZonedDateTime startDateTime = ZonedDateTime.parse("2019-09-01T12:00:00Z");
4ZonedDateTime endDateTime = ZonedDateTime.parse("2019-09-30T12:00:00Z");
5
6S3RoleBasedOutput s3RoleBasedOutput =
7 bitmovinApi.analytics.outputs.s3RoleBased.get("<YOUR_S3_ROLE_BASED_OUTPUT_ID>");
8
9AnalyticsExportTaskOutputTarget analyticsExportOutputConfiguration =
10 new AnalyticsExportTaskOutputTarget();
11analyticsExportOutputConfiguration.setOutputId(s3RoleBasedOutput.getId());
12analyticsExportOutputConfiguration.setOutputPath(
13 "path/to/your/desired/destination-on-your-bucket/");
14
15AnalyticsExportTask analyticsExportTask = new AnalyticsExportTask();
16analyticsExportTask.setName("Example Analytics Export");
17analyticsExportTask.setLicenseKey("<YOUR_ANALYTICS_LICENSE_KEY>");
18analyticsExportTask.setOutput(analyticsExportOutputConfiguration);
19analyticsExportTask.setStartTime(Date.from(startDateTime.toInstant()));
20analyticsExportTask.setEndTime(Date.from(endDateTime.toInstant()));
21
22analyticsExportTask = bitmovinApi.analytics.exports.create(analyticsExportTask);

Get Details of an existing Analytics Export Task

1bitmovinApi = BitmovinApi.builder().withApiKey("<YOUR_BITMOVIN_API_KEY>").build();
2
3AnalyticsExportTask analyticsExportTask = bitmovinApi.analytics.exports.get("<YOUR_ANALYTICS_EXPORT_TASK_ID>");

(CURL) Analytics Export Task ExampleLink Icon

Create an Analytics Export Task

API Reference: Create Export Task

1curl -X POST \
2 https://api.bitmovin.com/v1/analytics/exports/ \
3 -H 'Content-Type: application/json' \
4 -H 'X-Api-Key: <YOUR_BITMOVIN_API_KEY>' \
5 -d '{
6 "startTime": "2019-09-01T12:00:00.000Z",
7 "endTime": "2018-09-30T12:00:00.000Z",
8 "name": "Your first Analytics Export Task",
9 "licenseKey": "<YOUR_ANALYTICS_LICENSE_KEY>",
10 "output": {
11 "outputPath": "path/to/your/desired/destination-on-your-bucket/",
12 "outputId": "<YOUR_S3_ROLE_BASED_OUTPUT_ID>" // the output ID you already created
13 }
14}'

Get Details of an existing Analytics Export Task

API Reference: Get Export Task

1curl https://api.bitmovin.com/v1/analytics/exports/YOUR_ANALYTICS_EXPORT_TASK_ID \
2 -H 'Content-Type: application/json' \
3 -H 'X-Api-Key: <YOUR_BITMOVIN_API_KEY>' \

Give us feedback