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

# Get coding time statistics

> Trends of estimated coding time and commit counts, with projections for partial periods.

Returns up to six reporting-period points of estimated coding time and commit count for the workspace, newest first. Aggregates are workspace-wide and are not filtered by repository.

## Authorization

Requires workspace Read and Productivity. This read grants no repository access. There is no pagination or caller-selected trend granularity; check `historyUpdating` and `shippedNotReady` before interpreting zero values as zero activity.

**Authorization** `string` *required*

`Bearer <key>`. See [Authentication](https://docs.macroscope.com/api#authentication).

## Path parameters

**workspaceType** `string` *required*

`GITHUB_ORGANIZATION` or `GITHUB_USER`.

**workspaceId** `string` *required*

Numeric GitHub ID of the organization or user.

## Query parameters

**from** `string`

Inclusive start (RFC 3339). If `from` or `to` is omitted, both are ignored for period selection and the latest completed interval of the current reporting period is used, or the previous period if none has working hours. Even a lone bound must be a valid timestamp later than `0001-01-01T00:00:00Z`.

**to** `string`

End (RFC 3339). Must be after `from`, and the range can be at most 366 days. Commits at either endpoint are included, so adjacent ranges can overlap. If `from` is the start of the current reporting period, the effective end can extend to the latest processed data. Read `from` and `to` in the response for the period actually used.

**effortMode** `string` (default: all)

`all` counts all tracked activity. `shipped` counts landed activity and accounts for squashed commits. Neither measures deployments.

## Response

**codingTimeMinutesTrend** `TrendPoint[]`

Estimated coding time in person-minutes, not elapsed time. Newest first, at most six points.

**commitCountTrend** `TrendPoint[]`

Commits with an effort estimate and an identified contributor. Same ordering and projection rules as `codingTimeMinutesTrend`.

**from** `string`

Start of the effective period (RFC 3339). Trend points have their own boundaries.

**to** `string`

End of the effective period (RFC 3339).

**previousFrom** `string`

Start of the comparison period, 7 or 14 days before `from`. Its working hours set the projection scale.

**previousTo** `string`

End of the comparison period. Equal to `from`.

**timezone** `string`

IANA timezone used for calendar boundaries and working hours in this response.

**historyUpdating** `boolean`

`true` when historical results are still being processed. Zeros are then not definitive.

**shippedNotReady** `boolean`

`true` when shipped data for any evaluated period is not ready yet.

Fields with `false`, zero, or empty values are omitted from the JSON.

### TrendPoint

**periodStart** `string`

Start of the period (RFC 3339).

**periodEnd** `string`

End of the period (RFC 3339). For a projection, the end of the full period.

**value** `string`

Total for the period (int64 as string). Projected full-period value when `extrapolated` is `true`.

**extrapolated** `boolean`

`true` when the current period is partial (at least eight working hours) and `value` is projected from working hours.

**actualValue** `string`

Measured value so far (int64 as string). Present only when `extrapolated` is `true`.

**shippedNotReady** `boolean`

`true` when shipped data for this point is not ready. A zero is then not a measured zero.

```bash cURL theme={null}
curl --get https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics \
  -H "Authorization: Bearer $MACROSCOPE_API_KEY" \
  --data-urlencode "effortMode=shipped"
```

```python Python theme={null}
import os, requests

r = requests.get(
    "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics",
    headers={"Authorization": f"Bearer {os.environ['MACROSCOPE_API_KEY']}"},
    params={"effortMode": "shipped"},
)
print(r.json())
```

```javascript JavaScript theme={null}
const res = await fetch(
  "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics?effortMode=shipped",
  { headers: { Authorization: `Bearer ${process.env.MACROSCOPE_API_KEY}` } }
);
console.log(await res.json());
```

```json 200 theme={null}
{
  "codingTimeMinutesTrend": [
    {
      "periodStart": "2026-09-21T07:00:00Z",
      "periodEnd": "2026-09-28T07:00:00Z",
      "value": "12000",
      "extrapolated": true,
      "actualValue": "6000"
    },
    {
      "periodStart": "2026-09-14T07:00:00Z",
      "periodEnd": "2026-09-21T07:00:00Z",
      "value": "11500"
    }
  ],
  "commitCountTrend": [
    {
      "periodStart": "2026-09-21T07:00:00Z",
      "periodEnd": "2026-09-28T07:00:00Z",
      "value": "240",
      "extrapolated": true,
      "actualValue": "120"
    },
    {
      "periodStart": "2026-09-14T07:00:00Z",
      "periodEnd": "2026-09-21T07:00:00Z",
      "value": "230"
    }
  ],
  "from": "2026-09-21T07:00:00Z",
  "to": "2026-09-24T19:00:00Z",
  "previousFrom": "2026-09-14T07:00:00Z",
  "previousTo": "2026-09-21T07:00:00Z",
  "timezone": "America/Los_Angeles"
}
```

```json 401 theme={null}
{ "code": 16, "message": "unauthenticated" }
```


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