Skip to content

Commit c8ba997

Browse files
authored
Add Sourcegraph Analytics export API date filter options (#1193)
Add Sourcegraph Analytics export API date filter options ## Pull Request approval You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel.
1 parent 0b2793b commit c8ba997

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/analytics/cloud.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,16 @@ export GRANULARITY="<GRANULARITY>"
153153
curl -X GET "https://analytics.sourcegraph.com/api/reports/by-user-client-date?instanceURL=$INSTANCE_URL&granularity=$GRANULARITY" \
154154
-H "Authorization: Bearer $ACCESS_TOKEN"
155155
```
156+
157+
Optional `startDate` and `endDate` values (formatted as `YYYY-MM-DD`) can be specified. Both parameters are optional. If neither is specified, the default is all time. If only one is specified, then only the start or end date filter will be applied.
158+
159+
Example:
160+
161+
```sh
162+
export INSTANCE_URL="<INSTANCE_URL>" # e.g. example.sourcegraphcloud.com
163+
export START_DATE="2025-01-01"
164+
export END_DATE="2025-12-31"
165+
166+
curl -X GET "https://analytics.sourcegraph.com/api/reports/by-user-client-date?instanceURL=$INSTANCE_URL&startDate=$START_DATE&endDate=$END_DATE" \
167+
-H "Authorization: Bearer $ACCESS_TOKEN"
168+
```

0 commit comments

Comments
 (0)