curl --get https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
--data-urlencode "effortMode=shipped"
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())
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());
{
"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"
}
{ "code": 16, "message": "unauthenticated" }
API
Get coding time statistics
Trends of estimated coding time and commit counts, with projections for partial periods.
curl --get https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
--data-urlencode "effortMode=shipped"
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())
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());
{
"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"
}
{ "code": 16, "message": "unauthenticated" }
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.
Fields with
Authorization
Requires workspace Read and Productivity. This read grants no repository access. There is no pagination or caller-selected trend granularity; checkhistoryUpdating and shippedNotReady before interpreting zero values as zero activity.
string
required
Bearer <key>. See Authentication.Path parameters
string
required
GITHUB_ORGANIZATION or GITHUB_USER.string
required
Numeric GitHub ID of the organization or user.
Query parameters
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.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.string
default:"all"
all counts all tracked activity. shipped counts landed activity and accounts for squashed commits. Neither measures deployments.Response
TrendPoint[]
Estimated coding time in person-minutes, not elapsed time. Newest first, at most six points.
TrendPoint[]
Commits with an effort estimate and an identified contributor. Same ordering and projection rules as
codingTimeMinutesTrend.string
Start of the effective period (RFC 3339). Trend points have their own boundaries.
string
End of the effective period (RFC 3339).
string
Start of the comparison period, 7 or 14 days before
from. Its working hours set the projection scale.string
End of the comparison period. Equal to
from.string
IANA timezone used for calendar boundaries and working hours in this response.
boolean
true when historical results are still being processed. Zeros are then not definitive.boolean
true when shipped data for any evaluated period is not ready yet.false, zero, or empty values are omitted from the JSON.
TrendPoint
string
Start of the period (RFC 3339).
string
End of the period (RFC 3339). For a projection, the end of the full period.
string
Total for the period (int64 as string). Projected full-period value when
extrapolated is true.boolean
true when the current period is partial (at least eight working hours) and value is projected from working hours.string
Measured value so far (int64 as string). Present only when
extrapolated is true.boolean
true when shipped data for this point is not ready. A zero is then not a measured zero.curl --get https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/codingTimeStatistics \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
--data-urlencode "effortMode=shipped"
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())
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());
{
"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"
}
{ "code": 16, "message": "unauthenticated" }