> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creatorcore.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Post metric history

> Import posts, then read their views, likes, comments, shares, and saves over time.

CreatorCore refreshes every post in your organization's catalog on a schedule and keeps each sample. This guide shows how to add posts by URL and then read their metric history.

## 1. Import posts

Import one post with [`POST /api/v2/posts`](https://docs.creatorcore.co/api-reference/posts/import-a-post), or up to **20** at once with [`POST /api/v2/posts/bulk`](https://docs.creatorcore.co/api-reference/posts/import-several-posts):

```bash theme={null}
curl -X POST "https://beta.creatorcore.co/api/v2/posts/bulk" \
  -H "Authorization: Bearer $CREATORCORE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://www.tiktok.com/@harper.cole/video/7431122334455667788",
      "https://www.instagram.com/reel/C9xYzAbCdEf/",
      "https://example.com/not-a-post"
    ]
  }'
```

The bulk endpoint returns `200` with one result per URL, in the order you sent them. A URL that can't be imported doesn't fail the others:

```json theme={null}
{
  "success": true,
  "results": [
    {
      "url": "https://www.tiktok.com/@harper.cole/video/7431122334455667788",
      "status": "created",
      "post": {
        "link": {
          "id": "2ff91d94-03fe-45b8-816f-c139fb37f071",
          "globalPostId": "7b4b0acc-735c-448a-abd6-d58fe37be88c",
          "tracker": false,
          "refreshIntervalHours": null,
          "createdAt": "2026-11-05T03:12:45.554Z",
          "updatedAt": "2026-11-05T03:12:45.554Z"
        },
        "post": {
          "id": "7b4b0acc-735c-448a-abd6-d58fe37be88c",
          "channelId": "cdc445b9-858d-4426-ab41-5f6e7f7abdbb",
          "platform": "tiktok",
          "platformId": "7431122334455667788",
          "type": "video",
          "caption": "\u2026",
          "url": "https://www.tiktok.com/@harper.cole/video/7431122334455667788",
          "publishedAt": "2026-10-28T17:02:11.000Z",
          "latestViews": null,
          "latestLikes": null,
          "latestComments": null,
          "latestShares": null,
          "refreshStatus": "queued",
          "lastRefreshedAt": null,
          "createdAt": "2026-11-05T03:12:45.554Z",
          "updatedAt": "2026-11-05T03:12:45.593Z"
        }
      },
      "error": null
    },
    {
      "url": "https://www.instagram.com/reel/C9xYzAbCdEf/",
      "status": "already_linked",
      "post": {
        "link": {
          "id": "cc36f24d-b1ee-45ab-91a7-5eec0776d24d",
          "globalPostId": "ba0cd883-2998-4074-8ae9-042f9703f82b",
          "tracker": false,
          "refreshIntervalHours": null,
          "createdAt": "2026-11-05T03:12:45.554Z",
          "updatedAt": "2026-11-05T03:12:45.554Z"
        },
        "post": {
          "id": "ba0cd883-2998-4074-8ae9-042f9703f82b",
          "channelId": "cdc445b9-858d-4426-ab41-5f6e7f7abdbb",
          "platform": "instagram",
          "platformId": "3462211998877665544",
          "type": "video",
          "caption": "\u2026",
          "url": "https://www.instagram.com/reel/C9xYzAbCdEf/",
          "publishedAt": "2026-10-28T17:02:11.000Z",
          "latestViews": null,
          "latestLikes": 13404,
          "latestComments": null,
          "latestShares": null,
          "refreshStatus": "queued",
          "lastRefreshedAt": null,
          "createdAt": "2026-11-05T03:12:45.554Z",
          "updatedAt": "2026-11-05T03:12:45.593Z"
        }
      },
      "error": null
    },
    {
      "url": "https://example.com/not-a-post",
      "status": "failed",
      "post": null,
      "error": {
        "code": "validation_error",
        "message": "Unsupported or invalid post URL"
      }
    }
  ],
  "summary": {
    "created": 1,
    "alreadyLinked": 1,
    "failed": 1
  }
}
```

| `status` | Meaning |
| - | - |
| `created` | The post was added to your organization. |
| `already_linked` | Your organization already had this post. Nothing changed. |
| `failed` | The post wasn't imported. `error.code` and `error.message` say why. If the post couldn't be collected for a reason on our side, the message is `Couldn't collect this post. Try again later.` and the URL can be sent again later. |

Use `post.post.id` (the post id) or `post.link.id` (your organization's link id) to read the post's history below.

> [!NOTE]
>
> * The request returns once every URL is processed, so a full batch can take a few minutes. Set your HTTP client's timeout accordingly.
> * A URL sent twice in one request is imported once and reported at both positions.
> * Each new post counts toward your plan's monthly post limit. When the limit is reached, the remaining URLs fail with an error; the rest of the batch still completes.
> * A request with more than 20 URLs, or more than your plan allows in one import, is rejected with `400` before anything is imported.

## 2. Read a post's history

Use [`GET /api/v2/posts/{id}/history`](https://docs.creatorcore.co/api-reference/posts/get-a-posts-metric-history) with the post id or the link id. To read several posts, call it once per post:

```bash theme={null}
curl "https://beta.creatorcore.co/api/v2/posts/$POST_ID/history?from=2026-10-15&to=2026-10-25&granularity=24h&metrics=views,likes" \
  -H "Authorization: Bearer $CREATORCORE_API_KEY"
```

Response, trimmed to four of the ten daily points. Views dipped to 3,500 in the platform's data on October 21; the series holds at 9,500:

```json theme={null}
{
  "success": true,
  "history": {
    "id": "5c1f8e2a-7d43-4b9e-a0f6-2e8d91c4b7a3",
    "postId": "5c1f8e2a-7d43-4b9e-a0f6-2e8d91c4b7a3",
    "linkId": "e4a07b19-3c62-4f8d-9b15-7a2c6d0e8f41",
    "from": "2026-10-15T00:00:00.000Z",
    "to": "2026-10-25T00:00:00.000Z",
    "granularity": "24h",
    "metrics": [
      "views",
      "likes"
    ],
    "points": [
      {
        "time": "2026-10-15T00:00:00.000Z",
        "views": 9000,
        "likes": 450
      },
      {
        "time": "2026-10-16T00:00:00.000Z",
        "views": 9500,
        "likes": 475
      },
      {
        "time": "2026-10-17T00:00:00.000Z",
        "views": 9500,
        "likes": 475
      },
      {
        "time": "2026-10-24T00:00:00.000Z",
        "views": 9500,
        "likes": 475
      }
    ]
  }
}
```

### Query parameters

| Parameter | Default | Notes |
| - | - | - |
| `from` | 30 days before `to` | ISO 8601 date (`2026-10-01`, read as UTC midnight) or date-time with a time zone. Inclusive, rounded down to the start of its bucket. |
| `to` | now | Exclusive. Values in the future are treated as now. |
| `granularity` | finest available that fits the point limit | Bucket width. See the table below. |
| `metrics` | all five | Comma-separated or repeated: `views`, `likes`, `comments`, `shares`, `saves`. |

Unknown parameters, unknown metrics, unparseable dates, and `from` later than `to` return `400`.

### Granularity

Fine-grained history is kept for a limited time, so which bucket widths you can use depends on **how long ago `from` is**, not on how long the range is. The table is the **finest** each age allows, not a promise of a new measurement in every bucket (see [below](#finer-buckets-dont-add-measurements)):

| `from` is within the last | Finest available `granularity` (up to) |
| - | - |
| 1 day | `15m`, and everything below |
| 21 days | `1h`, `6h`, `12h`, and everything below |
| 180 days | `24h`, `3d`, `6d`, `7d`, `14d`, `15d`, and `30d` |
| 1095 days (3 years) | `30d` |

`from` is rounded down to the start of its bucket first (UTC; `7d` buckets start on Mondays), and the age is measured from that rounded value, so a `from` close to a limit can fall just past it.

Asking for a granularity that isn't available for your `from` returns `400`. The message and `details` name the earliest `from` that granularity accepts and the granularities you can use instead:

```json theme={null}
{
  "success": false,
  "error": "Granularity `1h` needs `from` on or after 2026-10-15T15:00:00.000Z. For this `from`, use one of: 24h, 3d, 6d, 7d, 14d, 15d, 30d.",
  "code": "validation_error",
  "details": {
    "granularity": "1h",
    "earliestFrom": "2026-10-15T15:00:00.000Z",
    "availableGranularities": ["24h", "3d", "6d", "7d", "14d", "15d", "30d"]
  }
}
```

One request returns at most **10,000 points**. Without `granularity`, you get the finest available one that fits, so a request without `granularity` never hits the limit; for example, a `from` 20 days ago comes back hourly. A `granularity` you choose that goes over the limit returns `400`.

**Finer buckets don't add measurements.** A granularity is the finest bucket width you can ask for, and each bucket holds up to one value; it doesn't mean the post was measured in every bucket. A post is measured on its own refresh schedule (every 48 hours is common, and older posts are refreshed less often). Between measurements the last value is carried forward, so many points repeat the one before: `1h` buckets for a post refreshed every 48 hours show the same number for 48 hours. History also thins out as it ages: samples older than a few days are kept one per few hours, then one per day, and so on, down to one per 30 days after six months. When older samples are thinned, the stored buckets are rebuilt from the samples that remain, so a range read today can have fewer distinct values than the same range read last week.

### How values are filled

* Each point is the highest count known by the end of its bucket. Buckets with no new sample repeat the previous value.
* Counts never decrease. Platforms occasionally report a lower number for a short time; those readings are ignored, so a real decrease (for example, removed likes) isn't shown either.
* A count never drops back to `0` once a positive value has been seen. Some platforms report `0` for a metric they don't track on a given post; those readings are ignored.
* `null` means unknown: the platform has never reported that metric for the post (LinkedIn and Threads often don't report views, for example). Treat it as missing, not as zero.
* Points start at the post's first collected sample. A post imported today has no points before today.
* When `to` is now (or left out), the last point includes the post's most recent refresh, even if that refresh happened minutes ago.

## Errors

| Status | When |
| - | - |
| `400` | Invalid query (unknown parameter, metric, or granularity; bad date; `from` after `to`), a granularity that isn't available for how old `from` is, a `from` more than 1095 days ago, or a granularity that would return more than 10,000 points. |
| `503` | The read took too long and was stopped (`code`: `query_timeout`). Try again in a moment with a shorter range or a coarser granularity; don't retry in a tight loop. |
| `404` | The post isn't linked to your organization. |

See [Responses and errors](https://docs.creatorcore.co/guides/responses-and-errors.md) for the error body.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.