---
title: "Export detailed video daily gains as CSV"
method: POST
path: "/analytics/video-daily-gains/export"
tags: ["General Analytics"]
---

# Export detailed video daily gains as CSV

`POST /analytics/video-daily-gains/export`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/analytics/video-daily-gains/export`
- Auth: API key in header `x-api-key`

Exports daily video performance metrics as CSV with presigned download URL. Includes video details, daily gains (views, likes, comments, shares, bookmarks), engagement rates, and metadata. Row-level data with one entry per video per day. Returns secure download URL valid for 5 minutes. Use narrow filters for faster processing of large datasets.

## Request body

- object: Request parameters for fetching daily interaction metrics and totals
  - `dateRange` object, required: Date range filter for analytics queries
    - `from` string, required: Start date in ISO format (YYYY-MM-DD)
    - `to` string, required: End date in ISO format (YYYY-MM-DD)
  - `platforms` string[], nullable: Social media platforms (facebook, instagram, tiktok, youtube, snapchat)
  - `accounts` string[], nullable: Organization account IDs
  - `contentTypes` string[], nullable: Content types (video, slideshow)
  - `projects` string[], nullable: Organization project IDs
  - `tags` string[], nullable: Tag IDs. Custom and project tags must all match (intersection); country tags and `continent:<CODE>` values combine into one geographic group satisfied by any of them. `none:<category>` values (custom/project/country/continent) match entities WITHOUT any tag of the category. Ignored when `tagGroups` is provided.
  - `tagGroups` object[], nullable: Advanced tag filter: groups combine with AND; within a group `any` matches videos carrying at least one of the tags, `all` requires every tag. `none:<category>` ids match videos without any tag of the category. Takes precedence over `tags` when provided. Also accepts the compact string form `all:orgtag_a,orgtag_b;any:systag_de,continent:EU`.
    - `mode` 'any' | 'all', required: How the group's tags combine: `any` = OR, `all` = intersection.
    - `ids` string[], required: Tag IDs, including `continent:<CODE>` and `none:<category>` values.
  - `viewMode` 'internal' | 'competitors' | 'all'
  - `publicationMode` 'allEligible' | 'onlyPublished'

## Response `200`

OK

- object: Export file download information with presigned URL and metadata
  - `downloadUrl` string, uri, required: Presigned download URL for the CSV export file
  - `expiresAt` string, date-time, required: Expiration timestamp for the download URL (typically 5 minutes)
  - `rowCount` number, required: Total number of data rows included in the export file
  - `fileName` string, required: Generated filename for the export (includes timestamp)

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `404`: 404
- `408`: 408
- `429`: 429
- `500`: 500

---

[API](https://skmtc.dev/viral/apis/viral-app-api.md) · [All operations](https://skmtc.dev/viral/apis/viral-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/viral/apis/viral-app-api/revisions/31e97fa79ef1?raw)
