# Video performance

> Views on videos posted from your deals, Canvas posts included: each video's views, likes, comments and shares, what it cost, and the cost per 1,000 views both all-in (with the service fee) and at the creator's price alone, with totals per campaign. Each video has a `watch` link to its deal on Yap Factory; creators' handles and post links are never included. Flat-rate deals that weren't posted through Yap Factory have no views here.

```http
GET https://yapfactory.com/api/v1/performance
```

|   |   |
| --- | --- |
| Who can use it | Brands |
| Tier | `read`: Reads. Changes nothing. |
| Scope | `campaigns:read`, or `read` |
| Idempotency-Key | Not used |
| Rate limit | Reads: 120 a minute |
| MCP tool | [`get_performance`](https://yapfactory.com/developers/tools.md#get_performance) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | query | `uuid` | no | Only this campaign. |
| `limit` | query | `integer` | no | How many to return. 1 to 50. Default `20`. |
| `cursor` | query | `string` | no | The `nextCursor` from the previous page. Leave out for the first page. |

## Example request

```bash
curl "https://yapfactory.com/api/v1/performance?campaignId=8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f" \
  -H "Authorization: Bearer $YAP_API_KEY"
```

## Response

`200` with a list. Each item in `data` is what the MCP tool returns in `videos`, and `meta` carries the summary fields. Pass `nextCursor` back as `cursor` until `hasMore` is false. [How paging works](https://yapfactory.com/developers/pagination.md).

```json
{
  "data": [
    {
      "id": "7e6d5c4b-3a29-4180-9f7e-6d5c4b3a2910",
      "kind": "canvas_post",
      "campaign": {
        "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
        "title": "Morning routine with Sleepwell"
      },
      "creator": {
        "id": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
        "name": "Maya R."
      },
      "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
      "postNumber": 1,
      "platform": "tiktok",
      "postedAt": "2026-12-12T18:04:00.000Z",
      "disclosureFound": true,
      "views": 23049,
      "likes": 1840,
      "comments": 62,
      "shares": 95,
      "measuredAt": "2026-12-15T06:00:00.000Z",
      "cost": {
        "allIn": {
          "minor": 2750,
          "currency": "USD",
          "formatted": "$27.50"
        },
        "creatorPrice": {
          "minor": 2500,
          "currency": "USD",
          "formatted": "$25.00"
        }
      },
      "costPer1kViews": {
        "allIn": {
          "minor": 119,
          "currency": "USD",
          "formatted": "$1.19"
        },
        "creatorPrice": {
          "minor": 108,
          "currency": "USD",
          "formatted": "$1.08"
        }
      },
      "watch": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
    }
  ],
  "nextCursor": null,
  "hasMore": false,
  "meta": {
    "campaigns": [
      {
        "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
        "title": "Morning routine with Sleepwell",
        "currency": "USD",
        "videos": 3,
        "views": 61240,
        "cost": {
          "allIn": {
            "minor": 8250,
            "currency": "USD",
            "formatted": "$82.50"
          },
          "creatorPrice": {
            "minor": 7500,
            "currency": "USD",
            "formatted": "$75.00"
          }
        },
        "costPer1kViews": {
          "allIn": {
            "minor": 135,
            "currency": "USD",
            "formatted": "$1.35"
          },
          "creatorPrice": {
            "minor": 122,
            "currency": "USD",
            "formatted": "$1.22"
          }
        }
      }
    ],
    "totals": [
      {
        "currency": "USD",
        "videos": 3,
        "views": 61240,
        "cost": {
          "allIn": {
            "minor": 8250,
            "currency": "USD",
            "formatted": "$82.50"
          },
          "creatorPrice": {
            "minor": 7500,
            "currency": "USD",
            "formatted": "$75.00"
          }
        },
        "costPer1kViews": {
          "allIn": {
            "minor": 135,
            "currency": "USD",
            "formatted": "$1.35"
          },
          "creatorPrice": {
            "minor": 122,
            "currency": "USD",
            "formatted": "$1.22"
          }
        }
      }
    ],
    "note": "A deal's cost is its creator price (plus views paid so far on Canvas) and, all-in, the service fee too, split evenly across the videos posted from it. Views are the latest count we measured."
  }
}
```

An example: fields that don't apply are `null`, and new fields can be added at any time, so ignore ones you don't know. Every response carries `Request-Id` and the `RateLimit-*` headers.

## Errors

| Code | Status | When |
| --- | --- | --- |
| `invalid_request` | 400 | A field failed validation (see `meta.issues`), or an unknown query parameter. |
| `unauthorized` | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
| `insufficient_scope` | 403 | The token doesn't have `campaigns:read` (or `read`). |
| `forbidden` | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
| `rate_limited` | 429 | Over the limit. Wait for `Retry-After` seconds. |
| `internal` | 500 | Our fault. Retry later, and send us the `requestId` if it keeps happening. |

Every error has the same shape. See [Errors](https://yapfactory.com/developers/errors.md) for what to do about each one.

---

HTML version: https://yapfactory.com/developers/api/get_performance
