---
title: "Get metric trend"
method: GET
path: "/inventory/api/v2/analytics/trend"
tags: ["analytics"]
---

# Get metric trend

`GET /inventory/api/v2/analytics/trend`

Retrieving a list of resource counts over the course of the specified time frame based on the given input filters

## Query parameters

- `tag` string[]
- `metricType` 'assets' | 'spend'
- `ids` string[]
- `connector` string[]
- `connectionId` string[]
- `connectionGroup` string[]
- `resourceCollection` string[]
- `startTime` integer
- `endTime` integer
- `granularity` 'monthly' | 'daily' | 'yearly'

## Response `200`

OK

- GithubComOpengovernOpengovernancePkgInventoryApiResourceTypeTrendDatapoint[]
  - `count` integer
  - `countStacked` GithubComOpengovernOpengovernancePkgInventoryApiResourceCountStackedItem[]
    - `category` string[]
    - `count` integer
    - `metricID` string
    - `metricName` string
  - `date` string, date-time
  - `totalConnectionCount` integer
  - `totalSuccessfulDescribedConnectionCount` integer

---

[API](https://skmtc.net/opengovern/apis/opengovernance-service-api.md) · [All operations](https://skmtc.net/opengovern/apis/opengovernance-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opengovern/opengovernance-service-api/versions/ab05295c4094/schema)
