Skip to main content
POST
/
companies
/
{company_id}
/
report
/
cached_metrics
Get Metrics Data
curl --request POST \
  --url https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "period": {
    "end_date": "2023-11-07T05:31:56Z",
    "start_date": "2023-11-07T05:31:56Z"
  },
  "grouping": "NONE"
}
'
import requests

url = "https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics"

payload = {
"period": {
"end_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z"
},
"grouping": "NONE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
period: {end_date: '2023-11-07T05:31:56Z', start_date: '2023-11-07T05:31:56Z'},
grouping: 'NONE'
})
};

fetch('https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'period' => [
'end_date' => '2023-11-07T05:31:56Z',
'start_date' => '2023-11-07T05:31:56Z'
],
'grouping' => 'NONE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics"

payload := strings.NewReader("{\n \"period\": {\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\"\n },\n \"grouping\": \"NONE\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": {\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\"\n },\n \"grouping\": \"NONE\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.getmeasure.com/api/v1/companies/{company_id}/report/cached_metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": {\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\"\n },\n \"grouping\": \"NONE\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "metrics": [
      {
        "grouping": {},
        "period": {
          "end_date": "2023-11-07T05:31:56Z",
          "start_date": "2023-11-07T05:31:56Z"
        },
        "value": "<unknown>"
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

The idempotency key that will be used to ensure the request is only performed once

Path Parameters

company_id
string
required

The company ID with the prefix 'cmp_'.

Body

application/json
frequency
enum<string>
required
Available options:
DAY,
WEEK,
MONTH,
QUARTER
metric
enum<string>
required

The metric chart type

Available options:
ACTIVE_SUBS,
NEW_SUBS,
CHURNED_SUBS,
ACTIVE_TRIALS,
NEW_TRIALS,
CHURNED_TRIALS,
CONVERTED_TRIALS,
ACTIVE_CUSTOMERS,
NEW_CUSTOMERS,
CHURNED_CUSTOMERS,
NET_REVENUE,
TOTAL_REVENUE,
TOTAL_INVOICED_REVENUE,
MRR,
ARR,
MRR_GROWTH,
FEES,
UPGRADES,
DOWNGRADES,
USER_CHURN,
REVENUE_CHURN,
NET_REVENUE_CHURN,
ARPU,
LTV,
ARPL,
OTHER_REVENUE,
LICENSES,
HISTORICAL_ARPU,
APPLICATION_FEES_CONNECTED_ACCOUNTS,
REVENUE_CONNECTED_ACCOUNTS,
DISCOUNTS_REDEEMED,
FAILED_CHARGES,
REFUNDS,
NEW_REFUNDS,
REACTIVATIONS
period
object
required

The period with a start and end date range

grouping
enum<string>
default:NONE
Available options:
NONE,
PRODUCT,
PRICING,
PRODUCT_TAGS,
PRICING_TAGS

Response

200 - application/json

OK

metrics
object[]