---
title: "Insights"
summary: "Counts, weekly trends and a one-call project overview, computed by Taskloader with the same filters as task search. Endpoints, parameters, examples and errors."
url: "https://taskloader.com/docs/api/reference/insights"
---

> Documentation index: https://taskloader.com/llms.txt

# Insights

Counts, weekly trends and a one-call project overview, computed by Taskloader with the same filters as task search. Endpoints, parameters, examples and errors.

Counts, weekly trends and a one-call project overview, computed by Taskloader with the same filters as task search. Send `today` or `timeZone` so that overdue and due soon count from the caller’s date.

## Get a project overview {#project_overview}

Returns a project, its people, counts that need attention, open tasks and recent activity.

```http
GET /api/v1/projects/{projectId}/overview
```

- **Scopes:** `projects:read`, `tasks:read`
- **Who:** Viewer or above in the project
- **[Project-limited credentials](https://taskloader.com/docs/authentication.md#project-limited-credentials):** allowed inside the credential’s projects; anything else is `not_found`
- **Retries:** a read; safe to repeat
- **Rate limit:** the `search` bucket
- **MCP tool:** `get_project_overview`

Returns what you need to start working in a project in one read: the project and your role; its members with their open tasks; counts by status, and of open, overdue, due-soon, unassigned and done-this-week tasks; the open tasks in board order (up to `indexLimit`, 0–300, default 100, with `totalOpen` and `truncated`); and the five newest history entries. Pass `today` (or `timeZone`) so overdue and this week count from your date.

#### Parameters

| Name         | In    | Type              | Required | Description                                                                                                                         |
| ------------ | ----- | ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `projectId`  | path  | id (`prj_…`)      | Yes      | Project id: prj_ followed by 32 lowercase hex digits, for example prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                             |
| `today`      | query | date (YYYY-MM-DD) | No       | Your current date (YYYY-MM-DD), for overdue and due-soon; within a day of the UTC date. Defaults to the date in timeZone, else UTC. |
| `timeZone`   | query | string            | No       | Your IANA time zone, for example Europe/Berlin, when today is not given. Up to 64 characters.                                       |
| `indexLimit` | query | integer, 0–300    | No       | How many open tasks to list, 0–300; 100 by default.                                                                                 |

#### Response

`200` with a `ProjectOverview` object.

| Field            | Type                           | Description                                              |
| ---------------- | ------------------------------ | -------------------------------------------------------- |
| `object`         | `"project_overview"`           |                                                          |
| `project`        | Project                        |                                                          |
| `currentMember`  | object                         | Your membership and role.                                |
| `members`        | array of ProjectOverviewMember | The owner first, then by when they joined.               |
| `counts`         | object                         |                                                          |
| `index`          | object                         | The open tasks at a glance; search_tasks finds the rest. |
| `recentActivity` | array of Activity              | The five newest history entries.                         |
| `today`          | string                         | The date the numbers count from (YYYY-MM-DD).            |

#### Errors

| Status | Code                                                        | Meaning                                    |
| ------ | ----------------------------------------------------------- | ------------------------------------------ |
| 400    | [`invalid_id`](https://taskloader.com/docs/api/errors.md#invalid_id)                 | The id is for a different kind of resource |
| 403    | [`insufficient_scope`](https://taskloader.com/docs/api/errors.md#insufficient_scope) | The credential lacks the required access   |
| 404    | [`not_found`](https://taskloader.com/docs/api/errors.md#not_found)                   | Not found                                  |

And the errors every operation can return: [`invalid_request`](https://taskloader.com/docs/api/errors.md#invalid_request), [`validation_failed`](https://taskloader.com/docs/api/errors.md#validation_failed), [`token_in_url`](https://taskloader.com/docs/api/errors.md#token_in_url), [`unauthenticated`](https://taskloader.com/docs/api/errors.md#unauthenticated), [`invalid_token`](https://taskloader.com/docs/api/errors.md#invalid_token), [`rate_limited`](https://taskloader.com/docs/api/errors.md#rate_limited), [`internal_error`](https://taskloader.com/docs/api/errors.md#internal_error), [`service_unavailable`](https://taskloader.com/docs/api/errors.md#service_unavailable).

#### Example

```curl
curl 'https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/overview?indexLimit=1' \
  -H "Authorization: Bearer $TASKLOADER_API_KEY"
```

```js
const response = await fetch('https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/overview?indexLimit=1', {
  headers: {
    Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
  },
});
if (!response.ok) {
  const problem = await response.json();
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const overview = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/overview",
    params={"indexLimit": "1"},
    headers={
        "Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
    },
    timeout=30,
)
if not response.ok:
    problem = response.json()
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
overview = response.json()
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "object": "project_overview",
  "project": {
    "object": "project",
    "id": "prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
    "organization": {
      "id": "org_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "name": "Northwind",
      "slug": "northwind"
    },
    "name": "Website launch",
    "slug": "website-launch",
    "ref": "northwind/website-launch",
    "url": "https://taskloader.com/northwind/website-launch",
    "description": "Everything for the new website, from copy to launch day.",
    "version": 3,
    "archived": false,
    "currentMember": {
      "memberId": "mem_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "role": "admin"
    },
    "createdAt": "2026-09-14T08:30:00.000Z"
  },
  "currentMember": {
    "memberId": "mem_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
    "role": "admin"
  },
  "members": [
    {
      "object": "member",
      "id": "mem_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "projectId": "prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "userId": "usr_kq3Xb1W9pZ0aLm7c",
      "name": "Maya Chen",
      "email": "maya@example.com",
      "role": "owner",
      "color": "sand",
      "joinedAt": "2026-09-14T08:30:00.000Z",
      "openTasks": 3
    }
  ],
  "counts": {
    "byStatus": {
      "backlog": 4,
      "progress": 2,
      "review": 1,
      "done": 9
    },
    "open": 7,
    "overdue": 1,
    "dueSoon": 2,
    "unassigned": 2,
    "doneThisWeek": 3
  },
  "index": {
    "tasks": [
      {
        "id": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
        "key": "TL-012",
        "ref": "northwind/website-launch/TL-012",
        "title": "Write the launch announcement",
        "status": "progress",
        "priority": "high",
        "assignee": "Maya Chen",
        "dueDate": "2026-11-27",
        "checklist": "1/2",
        "bookmark": false,
        "link": null,
        "version": 4,
        "updatedAt": "2026-11-18T10:00:00.123Z"
      }
    ],
    "totalOpen": 7,
    "truncated": true
  },
  "recentActivity": [
    {
      "object": "activity",
      "id": "act_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "projectId": "prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "task": {
        "id": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
        "key": "TL-012",
        "ref": "northwind/website-launch/TL-012",
        "title": "Write the launch announcement"
      },
      "kind": "updated",
      "message": "moved this task to In progress",
      "changedFields": [
        "status"
      ],
      "actor": {
        "userId": "usr_kq3Xb1W9pZ0aLm7c",
        "name": "Maya Chen"
      },
      "via": {
        "channel": "api",
        "label": "API key “CI”"
      },
      "createdAt": "2026-11-18T10:00:00.123Z"
    }
  ],
  "today": "2026-11-18"
}
```

## Count tasks {#count_tasks}

Counts a project’s tasks by a measure, optionally grouped and split.

```http
GET /api/v1/projects/{projectId}/insights/counts
```

- **Scopes:** `tasks:read`
- **Who:** Viewer or above in the project
- **[Project-limited credentials](https://taskloader.com/docs/authentication.md#project-limited-credentials):** allowed inside the credential’s projects; anything else is `not_found`
- **Retries:** a read; safe to repeat
- **Rate limit:** the `search` bucket
- **MCP tool:** `count_tasks`

Counts the tasks of a project that match a measure (tasks: tasks; open: open tasks; done: done; overdue: overdue; due_soon: due within 7 days) and the task filters of search_tasks, optionally grouped by status, assignee, priority or due date (overdue, past, this week, next week, later, no date: overdue holds open tasks due before today, past the done ones) and split within each group by status or priority. Counts are exact at any size. splitBy is ignored without groupBy or when it equals groupBy.

#### Parameters

| Name               | In    | Type                                                             | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------ | ----- | ---------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectId`        | path  | id (`prj_…`)                                                     | Yes      | Project id: prj_ followed by 32 lowercase hex digits, for example prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                                                                                                                                                                                                                                                                                             |
| `measure`          | query | `"tasks"` or `"open"` or `"done"` or `"overdue"` or `"due_soon"` | Yes      | tasks (all), open (not done), done, overdue (open and past due), due_soon (open and due within 7 days).                                                                                                                                                                                                                                                                                                             |
| `groupBy`          | query | `"status"` or `"assignee"` or `"priority"` or `"due"`            | No       | status, assignee, priority, or due: overdue (open, due before today), past (done, due before today; listed only when it holds tasks), this week, next week, later, no date.                                                                                                                                                                                                                                         |
| `splitBy`          | query | `"status"` or `"priority"`                                       | No       | A second grouping within each group: status or priority.                                                                                                                                                                                                                                                                                                                                                            |
| `q`                | query | string                                                           | No       | Words to find, for example "invoice reminder": every word must appear in the title or the description, in any case. Up to 10 words over HTTP; over MCP and in the assistant a sentence of up to 40 words, of which the first 10 other than common ones (the, my, tasks…) are searched. A key such as TL-12 here finds only tasks whose text mentions it; to find the task itself, use keys. Up to 1,010 characters. |
| `status`           | query | array of `"backlog"` or `"progress"` or `"review"` or `"done"`   | No       | Only these statuses (backlog, progress, review, done), for example ["backlog","progress"] (status=backlog,progress in a query string). Up to 4 items.                                                                                                                                                                                                                                                               |
| `priority`         | query | array of `"low"` or `"normal"` or `"high"` or `"urgent"`         | No       | Only these priorities (low, normal, high, urgent), for example ["high","urgent"] (priority=high,urgent in a query string). Up to 4 items.                                                                                                                                                                                                                                                                           |
| `assigneeMemberId` | query | array of id (`mem_…`) or `"me"` or `"unassigned"`                | No       | Only tasks assigned to any of these: members (mem_…), me, or unassigned, for example ["me","unassigned"] (me,unassigned in a query string). Member ids are per project (a person has a different one in each), and one that is not a member of the project searched is a 400. Up to 50 items.                                                                                                                       |
| `dueBefore`        | query | date (YYYY-MM-DD)                                                | No       | Due on or before this date (YYYY-MM-DD); leaves out tasks without one.                                                                                                                                                                                                                                                                                                                                              |
| `dueAfter`         | query | date (YYYY-MM-DD)                                                | No       | Due on or after this date (YYYY-MM-DD); leaves out tasks without one.                                                                                                                                                                                                                                                                                                                                               |
| `overdue`          | query | boolean                                                          | No       | true: only open tasks due before today. false or absent: no such condition.                                                                                                                                                                                                                                                                                                                                         |
| `dueSoon`          | query | boolean                                                          | No       | true: only open tasks due from today to a week from today. false or absent: no such condition.                                                                                                                                                                                                                                                                                                                      |
| `keys`             | query | array of string                                                  | No       | Only these tasks, by key, for example ["TL-1","TL-5"] (keys=TL-1,TL-5 in a query string). Up to 50 items.                                                                                                                                                                                                                                                                                                           |
| `updatedSince`     | query | string (date-time)                                               | No       | Changed at or after this time (RFC 3339), for example 2026-11-18T09:00:00Z.                                                                                                                                                                                                                                                                                                                                         |
| `completedSince`   | query | string (date-time)                                               | No       | Entered Done at or after this time (RFC 3339), for example 2026-11-18T09:00:00Z; leaves out tasks not done.                                                                                                                                                                                                                                                                                                         |
| `createdBy`        | query | id (`usr_…`) or `"me"`                                           | No       | Only tasks this person created (usr_…), or me.                                                                                                                                                                                                                                                                                                                                                                      |
| `bookmark`         | query | boolean                                                          | No       | true: only tasks that bookmark a page; false: only tasks that do not.                                                                                                                                                                                                                                                                                                                                               |
| `today`            | query | date (YYYY-MM-DD)                                                | No       | Your current date (YYYY-MM-DD), for overdue and due-soon; within a day of the UTC date. Defaults to the date in timeZone, else UTC.                                                                                                                                                                                                                                                                                 |
| `timeZone`         | query | string                                                           | No       | Your IANA time zone, for example Europe/Berlin, when today is not given. Up to 64 characters.                                                                                                                                                                                                                                                                                                                       |

#### Response

`200` with a `TaskCounts` object.

| Field           | Type                                                             | Description                                                                                                                                                                                                                                                                                                |
| --------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `object`        | `"task_counts"`                                                  |                                                                                                                                                                                                                                                                                                            |
| `measure`       | `"tasks"` or `"open"` or `"done"` or `"overdue"` or `"due_soon"` |                                                                                                                                                                                                                                                                                                            |
| `groupBy`       | `"status"` or `"assignee"` or `"priority"` or `"due"` or null    |                                                                                                                                                                                                                                                                                                            |
| `splitBy`       | `"status"` or `"priority"` or null                               | The split applied, or null.                                                                                                                                                                                                                                                                                |
| `total`         | integer, at least 0                                              | How many tasks match in all.                                                                                                                                                                                                                                                                               |
| `groups`        | array of object                                                  | Empty without groupBy. Statuses and priorities list every value; assignees list every member and, when it holds tasks, unassigned; due buckets list overdue, this_week, next_week, later and none, and past when it holds tasks.                                                                           |
| `today`         | string                                                           | The date the numbers count from (YYYY-MM-DD).                                                                                                                                                                                                                                                              |
| `searchedWords` | array of string                                                  | Present only when words of `q` were left out (over MCP and in the in-app assistant, punctuation around a word, a possessive ’s, and common words beside other words are): the words every task found contains, empty when none was left. The API searches for every word as it was sent and never adds it. |

#### Errors

| Status | Code                                                        | Meaning                                    |
| ------ | ----------------------------------------------------------- | ------------------------------------------ |
| 400    | [`invalid_id`](https://taskloader.com/docs/api/errors.md#invalid_id)                 | The id is for a different kind of resource |
| 403    | [`insufficient_scope`](https://taskloader.com/docs/api/errors.md#insufficient_scope) | The credential lacks the required access   |
| 404    | [`not_found`](https://taskloader.com/docs/api/errors.md#not_found)                   | Not found                                  |
| 422    | [`search_too_broad`](https://taskloader.com/docs/api/errors.md#search_too_broad)     | The search reads too many tasks            |

And the errors every operation can return: [`invalid_request`](https://taskloader.com/docs/api/errors.md#invalid_request), [`validation_failed`](https://taskloader.com/docs/api/errors.md#validation_failed), [`token_in_url`](https://taskloader.com/docs/api/errors.md#token_in_url), [`unauthenticated`](https://taskloader.com/docs/api/errors.md#unauthenticated), [`invalid_token`](https://taskloader.com/docs/api/errors.md#invalid_token), [`rate_limited`](https://taskloader.com/docs/api/errors.md#rate_limited), [`internal_error`](https://taskloader.com/docs/api/errors.md#internal_error), [`service_unavailable`](https://taskloader.com/docs/api/errors.md#service_unavailable).

#### Example

```curl
curl 'https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/counts?measure=open&groupBy=assignee&splitBy=status' \
  -H "Authorization: Bearer $TASKLOADER_API_KEY"
```

```js
const response = await fetch('https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/counts?measure=open&groupBy=assignee&splitBy=status', {
  headers: {
    Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
  },
});
if (!response.ok) {
  const problem = await response.json();
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const tasks = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/counts",
    params={"measure": "open", "groupBy": "assignee", "splitBy": "status"},
    headers={
        "Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
    },
    timeout=30,
)
if not response.ok:
    problem = response.json()
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
tasks = response.json()
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "object": "task_counts",
  "measure": "open",
  "groupBy": "assignee",
  "splitBy": "status",
  "total": 3,
  "groups": [
    {
      "key": "mem_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
      "label": "Maya Chen",
      "count": 3,
      "split": [
        {
          "key": "backlog",
          "label": "Backlog",
          "count": 1
        },
        {
          "key": "progress",
          "label": "In progress",
          "count": 1
        },
        {
          "key": "review",
          "label": "In review",
          "count": 1
        },
        {
          "key": "done",
          "label": "Done",
          "count": 0
        }
      ]
    }
  ],
  "today": "2026-11-18"
}
```

## Weekly trend {#weekly_trend}

Tasks created, completed and open at each week’s end, for the last 4–26 weeks.

```http
GET /api/v1/projects/{projectId}/insights/trend
```

- **Scopes:** `tasks:read`
- **Who:** Viewer or above in the project
- **[Project-limited credentials](https://taskloader.com/docs/authentication.md#project-limited-credentials):** allowed inside the credential’s projects; anything else is `not_found`
- **Retries:** a read; safe to repeat
- **Rate limit:** the `search` bucket
- **MCP tool:** `weekly_trend`

Per week (Monday to Sunday, oldest first, the current week last): how many tasks were created, how many entered Done (and are still done), and how many were open at the end of the week, for the last `weeks` weeks (4–26, default 8). The task filters of search_tasks narrow which tasks count. Days count in `timeZone` (UTC by default).

#### Parameters

| Name               | In    | Type                                                           | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------ | ----- | -------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectId`        | path  | id (`prj_…`)                                                   | Yes      | Project id: prj_ followed by 32 lowercase hex digits, for example prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718.                                                                                                                                                                                                                                                                                                             |
| `series`           | query | array of `"created"` or `"completed"` or `"open"`              | Yes      | Which series, 1–3 of created, completed and open, for example ["created","completed"] (series=created,completed in a query string). At least 1 item.                                                                                                                                                                                                                                                                |
| `weeks`            | query | integer, 4–26                                                  | No       | How many weeks, 4–26; 8 by default.                                                                                                                                                                                                                                                                                                                                                                                 |
| `q`                | query | string                                                         | No       | Words to find, for example "invoice reminder": every word must appear in the title or the description, in any case. Up to 10 words over HTTP; over MCP and in the assistant a sentence of up to 40 words, of which the first 10 other than common ones (the, my, tasks…) are searched. A key such as TL-12 here finds only tasks whose text mentions it; to find the task itself, use keys. Up to 1,010 characters. |
| `status`           | query | array of `"backlog"` or `"progress"` or `"review"` or `"done"` | No       | Only these statuses (backlog, progress, review, done), for example ["backlog","progress"] (status=backlog,progress in a query string). Up to 4 items.                                                                                                                                                                                                                                                               |
| `priority`         | query | array of `"low"` or `"normal"` or `"high"` or `"urgent"`       | No       | Only these priorities (low, normal, high, urgent), for example ["high","urgent"] (priority=high,urgent in a query string). Up to 4 items.                                                                                                                                                                                                                                                                           |
| `assigneeMemberId` | query | array of id (`mem_…`) or `"me"` or `"unassigned"`              | No       | Only tasks assigned to any of these: members (mem_…), me, or unassigned, for example ["me","unassigned"] (me,unassigned in a query string). Member ids are per project (a person has a different one in each), and one that is not a member of the project searched is a 400. Up to 50 items.                                                                                                                       |
| `dueBefore`        | query | date (YYYY-MM-DD)                                              | No       | Due on or before this date (YYYY-MM-DD); leaves out tasks without one.                                                                                                                                                                                                                                                                                                                                              |
| `dueAfter`         | query | date (YYYY-MM-DD)                                              | No       | Due on or after this date (YYYY-MM-DD); leaves out tasks without one.                                                                                                                                                                                                                                                                                                                                               |
| `overdue`          | query | boolean                                                        | No       | true: only open tasks due before today. false or absent: no such condition.                                                                                                                                                                                                                                                                                                                                         |
| `dueSoon`          | query | boolean                                                        | No       | true: only open tasks due from today to a week from today. false or absent: no such condition.                                                                                                                                                                                                                                                                                                                      |
| `keys`             | query | array of string                                                | No       | Only these tasks, by key, for example ["TL-1","TL-5"] (keys=TL-1,TL-5 in a query string). Up to 50 items.                                                                                                                                                                                                                                                                                                           |
| `updatedSince`     | query | string (date-time)                                             | No       | Changed at or after this time (RFC 3339), for example 2026-11-18T09:00:00Z.                                                                                                                                                                                                                                                                                                                                         |
| `completedSince`   | query | string (date-time)                                             | No       | Entered Done at or after this time (RFC 3339), for example 2026-11-18T09:00:00Z; leaves out tasks not done.                                                                                                                                                                                                                                                                                                         |
| `createdBy`        | query | id (`usr_…`) or `"me"`                                         | No       | Only tasks this person created (usr_…), or me.                                                                                                                                                                                                                                                                                                                                                                      |
| `bookmark`         | query | boolean                                                        | No       | true: only tasks that bookmark a page; false: only tasks that do not.                                                                                                                                                                                                                                                                                                                                               |
| `today`            | query | date (YYYY-MM-DD)                                              | No       | Your current date (YYYY-MM-DD), for overdue and due-soon; within a day of the UTC date. Defaults to the date in timeZone, else UTC.                                                                                                                                                                                                                                                                                 |
| `timeZone`         | query | string                                                         | No       | Your IANA time zone, for example Europe/Berlin, when today is not given. Up to 64 characters.                                                                                                                                                                                                                                                                                                                       |

#### Response

`200` with a `TaskTrend` object.

| Field           | Type                                              | Description                                                                                                                                                                                                                                                                                                |
| --------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `object`        | `"task_trend"`                                    |                                                                                                                                                                                                                                                                                                            |
| `series`        | array of `"created"` or `"completed"` or `"open"` | The series asked for, in order.                                                                                                                                                                                                                                                                            |
| `weeks`         | array of object                                   | Oldest first; the current week last.                                                                                                                                                                                                                                                                       |
| `today`         | string                                            | The date the numbers count from (YYYY-MM-DD).                                                                                                                                                                                                                                                              |
| `searchedWords` | array of string                                   | Present only when words of `q` were left out (over MCP and in the in-app assistant, punctuation around a word, a possessive ’s, and common words beside other words are): the words every task found contains, empty when none was left. The API searches for every word as it was sent and never adds it. |

#### Errors

| Status | Code                                                        | Meaning                                    |
| ------ | ----------------------------------------------------------- | ------------------------------------------ |
| 400    | [`invalid_id`](https://taskloader.com/docs/api/errors.md#invalid_id)                 | The id is for a different kind of resource |
| 403    | [`insufficient_scope`](https://taskloader.com/docs/api/errors.md#insufficient_scope) | The credential lacks the required access   |
| 404    | [`not_found`](https://taskloader.com/docs/api/errors.md#not_found)                   | Not found                                  |
| 422    | [`search_too_broad`](https://taskloader.com/docs/api/errors.md#search_too_broad)     | The search reads too many tasks            |

And the errors every operation can return: [`invalid_request`](https://taskloader.com/docs/api/errors.md#invalid_request), [`validation_failed`](https://taskloader.com/docs/api/errors.md#validation_failed), [`token_in_url`](https://taskloader.com/docs/api/errors.md#token_in_url), [`unauthenticated`](https://taskloader.com/docs/api/errors.md#unauthenticated), [`invalid_token`](https://taskloader.com/docs/api/errors.md#invalid_token), [`rate_limited`](https://taskloader.com/docs/api/errors.md#rate_limited), [`internal_error`](https://taskloader.com/docs/api/errors.md#internal_error), [`service_unavailable`](https://taskloader.com/docs/api/errors.md#service_unavailable).

#### Example

```curl
curl 'https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/trend?series=created,completed&weeks=4' \
  -H "Authorization: Bearer $TASKLOADER_API_KEY"
```

```js
const response = await fetch('https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/trend?series=created,completed&weeks=4', {
  headers: {
    Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
  },
});
if (!response.ok) {
  const problem = await response.json();
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const trend = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://taskloader.com/api/v1/projects/prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/insights/trend",
    params={"series": "created,completed", "weeks": "4"},
    headers={
        "Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
    },
    timeout=30,
)
if not response.ok:
    problem = response.json()
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
trend = response.json()
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "object": "task_trend",
  "series": [
    "created",
    "completed"
  ],
  "weeks": [
    {
      "weekStart": "2026-10-26",
      "created": 5,
      "completed": 2
    },
    {
      "weekStart": "2026-11-02",
      "created": 3,
      "completed": 4
    },
    {
      "weekStart": "2026-11-09",
      "created": 6,
      "completed": 3
    },
    {
      "weekStart": "2026-11-16",
      "created": 2,
      "completed": 1
    }
  ],
  "today": "2026-11-18"
}
```
