---
title: "Export videos to CSV"
method: POST
path: "/videos/export"
tags: ["Video Analytics"]
---

# Export videos to CSV

`POST /videos/export`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/videos/export`
- Auth: API key in header `x-api-key`

Exports filtered videos data as CSV file stored in R2. Returns a presigned download URL valid for 5 minutes.

## Request body

- object: Filtering options for videos export (excludes pagination)
  - `platforms` string[], nullable: Social media platforms (facebook, instagram, tiktok, youtube, snapchat)
  - `accountUsername` string: Account username on the platform
  - `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.
  - `dateRange` object: 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)
  - `expand` string[]: Expand related resources in the response
  - `viewMode` 'internal' | 'competitors' | 'all'
  - `visibility` 'visible' | 'excluded': Exclusion-state filter: "visible" (default) hides excluded videos, "excluded" returns only excluded videos

## 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)
