---
title: "Export video metrics history"
method: POST
path: "/videos/{platform}/{platformVideoId}/history/export"
tags: ["Video Analytics"]
---

# Export video metrics history

`POST /videos/{platform}/{platformVideoId}/history/export`

## Request

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

Exports recent daily metrics history for a specific video as CSV with a presigned download URL.

## Path parameters

- `platform` 'facebook' | 'instagram' | 'tiktok' | 'youtube' | 'snapchat', required: Social media platform (facebook, instagram, tiktok, youtube, snapchat)
- `platformVideoId` string, required: Native platform video id found in the URL of the video

## Request body

- object: Request parameters for exporting video metrics history by platform and video ID
  - `days` integer: Number of most recent days to include in the export.

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