Metric Endpoints
Metrics Channel List
A list of possible channels that a user may access metrics around, for example Facebook. The list will be determined by which channels a customer has enabled in their TrackMaven account.
GET
GET /api/v1/workspaces/{workspace_id}/metrics
Required URL parameters:
Example response:
$ curl https://trackmavens.com/api/v1/workspaces/1/metrics/
{
"data": {
"channels": [
"website",
"blog",
"alexa",
"instagram",
"pinterest",
"twitter",
"googleplus",
"youtube",
"linkedin",
"tumblr",
"facebook",
"mixrank",
"whatrunswhere",
"newsentity",
"compete"
]
}
}
Metrics Channel Detail
A list of possible metrics that a user may query for a single channel, for example Facebook Likes.
GET
GET /api/v1/workspaces/{workspace_id}/metrics/{channel_name}/
Required URL parameters:
Example response:
$ curl https://trackmavens.com/api/v1/workspaces/1/metrics/facebook/
{
"data": {
"metrics": {
"1": "Number of Posts",
"5": "Interactions",
"6": "Average Likes Per Post",
"7": "Average Shares Per Post",
"8": "Average Comments Per Post",
"9": "Average Interactions Per Post",
"10": "Average Interactions Per Post Per 1,000 Fans",
"11": "People Talking About",
"12": "Page Likes"
},
"channel": "Facebook"
}
}
Metrics Detail
The endpoint where specific metric data for a set of brands and/or groups can
be retrieved. By default, this endpoint will return a list of data streams for the relevant metric for each brand in the workspace. Data will be returned within the designated timeframe specified by start_date
and end_date
.
- Specifying
brands
orgroups
as query parameters will return data streams for only those specific entities. - Adding the
average=True
query parameter will return the mean data stream over all brands and groups selected. - Adding the
verbose=True
query parameter will return a data stream with the components of each datum specified in a dictionary containing a numerator and denominator. This is useful particularly for derived metrics.
GET
GET /api/v1/workspaces/{workspace_id}/metrics/{channel_name}/{metric_id}/
Required URL parameters:
Required query parameters:
Optional query parameters:
Example responses:
Example 1: Retrieve Facebook Likes between September 1 and September 8 for the brand TrackMaven with ID 1.
$ curl https://trackmavens.com/api/v1/workspaces/1/metrics/facebook/12/?brands=1&start_date=2014-09-01&end_date=2014-09-08
Example 2: Retrieve average number of Tweets for all brands in the workspace on September 1.
$ curl https://trackmavens.com/api/v1/workspaces/1/metrics/twitter/1/?start_date=2014-09-01&end_date=2014-09-01&average=true
Example 3: Retrieve Alexa rank for two brands, and the average Alexa rank for one group, for the month of September.
$ curl https://trackmavens.com/api/v1/workspaces/1/metrics/twitter/1/?brands=1,2&groups=4&start_date=2014-09-01&end_date=2014-09-30