import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const result = await creem.stats.getSummary("USD");
console.log(result);
}
run();curl --request GET \
--url https://api.creem.io/v1/stats/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creem.io/v1/stats/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creem.io/v1/stats/summary', 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.creem.io/v1/stats/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.creem.io/v1/stats/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.creem.io/v1/stats/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/stats/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totals": {
"totalProducts": 12,
"totalSubscriptions": 48,
"totalCustomers": 35,
"totalPayments": 62,
"activeSubscriptions": 21,
"totalRevenue": 553939,
"totalNetRevenue": 478094,
"netMonthlyRecurringRevenue": 89500,
"monthlyRecurringRevenue": 94200
},
"periods": [
{
"timestamp": 1763337600000,
"grossRevenue": 2999,
"netRevenue": 2909
},
{
"timestamp": 1763942400000,
"grossRevenue": 32989,
"netRevenue": 31998
},
{
"timestamp": 1764547200000,
"grossRevenue": 47984,
"netRevenue": 46542
},
{
"timestamp": 1765152000000,
"grossRevenue": 125958,
"netRevenue": 122173
},
{
"timestamp": 1765756800000,
"grossRevenue": 343968,
"netRevenue": 278372
},
{
"timestamp": 1766361600000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1766966400000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1767571200000,
"grossRevenue": 225240,
"netRevenue": 192096
}
]
}Get store metrics summary
Retrieve aggregated store metrics including counts, revenue, and MRR. When startDate and endDate are provided, totals are filtered to that date range. When interval is also provided, the response includes a periods array with time-series data points grouped by that interval. The periods array starts from the storeās first transaction or startDate, whichever is later, to avoid empty leading buckets. All monetary amounts are in cents (integer, no decimals).
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const result = await creem.stats.getSummary("USD");
console.log(result);
}
run();curl --request GET \
--url https://api.creem.io/v1/stats/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creem.io/v1/stats/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creem.io/v1/stats/summary', 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.creem.io/v1/stats/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.creem.io/v1/stats/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.creem.io/v1/stats/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/stats/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totals": {
"totalProducts": 12,
"totalSubscriptions": 48,
"totalCustomers": 35,
"totalPayments": 62,
"activeSubscriptions": 21,
"totalRevenue": 553939,
"totalNetRevenue": 478094,
"netMonthlyRecurringRevenue": 89500,
"monthlyRecurringRevenue": 94200
},
"periods": [
{
"timestamp": 1763337600000,
"grossRevenue": 2999,
"netRevenue": 2909
},
{
"timestamp": 1763942400000,
"grossRevenue": 32989,
"netRevenue": 31998
},
{
"timestamp": 1764547200000,
"grossRevenue": 47984,
"netRevenue": 46542
},
{
"timestamp": 1765152000000,
"grossRevenue": 125958,
"netRevenue": 122173
},
{
"timestamp": 1765756800000,
"grossRevenue": 343968,
"netRevenue": 278372
},
{
"timestamp": 1766361600000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1766966400000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1767571200000,
"grossRevenue": 225240,
"netRevenue": 192096
}
]
}Authorizations
API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.
Query Parameters
Start of the date range as a Unix timestamp in milliseconds (e.g. 1740614400000). When provided with endDate, filters totals to this range. Required when interval is specified.
End of the date range as a Unix timestamp in milliseconds (e.g. 1772150400000). When provided with startDate, filters totals to this range. Required when interval is specified.
Groups time-series data into buckets of this size. Requires startDate and endDate. Returns a periods array with one entry per bucket containing grossRevenue and netRevenue.
day, week, month EUR, USD Response
Successfully retrieved store metrics summary
Aggregated totals for the queried date range
Show child attributes
Show child attributes
Time-series data points grouped by the requested interval. Only present when interval, startDate, and endDate are provided.
Show child attributes
Show child attributes
[
{
"timestamp": 1763337600000,
"grossRevenue": 2999,
"netRevenue": 2909
},
{
"timestamp": 1763942400000,
"grossRevenue": 32989,
"netRevenue": 31998
},
{
"timestamp": 1764547200000,
"grossRevenue": 47984,
"netRevenue": 46542
},
{
"timestamp": 1765152000000,
"grossRevenue": 125958,
"netRevenue": 122173
},
{
"timestamp": 1765756800000,
"grossRevenue": 343968,
"netRevenue": 278372
},
{
"timestamp": 1766361600000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1766966400000,
"grossRevenue": 0,
"netRevenue": 0
},
{
"timestamp": 1767571200000,
"grossRevenue": 225240,
"netRevenue": 192096
}
]