Get growth stats
curl --request GET \
--url https://api.kit.com/v4/account/growth_stats \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/account/growth_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'GET', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/account/growth_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/account/growth_stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/account/growth_stats",
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-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/account/growth_stats"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"stats": {
"cancellations": 0,
"net_new_subscribers": 3,
"new_subscribers": 3,
"subscribers": 3,
"starting": "2023-02-10T00:00:00-05:00",
"ending": "2023-02-24T23:59:59-05:00"
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"Starting date is incorrectly formatted. Use YYYY-MM-DD.",
"Ending date is incorrectly formatted. Use YYYY-MM-DD.",
"Starting date must be before the ending date."
]
}Accounts
Get growth stats
Get growth stats for a specific time period. Defaults to last 90 days.
NOTE: We return your stats in your sending time zone. This endpoint does not return timestamps in UTC.
GET
/
v4
/
account
/
growth_stats
Get growth stats
curl --request GET \
--url https://api.kit.com/v4/account/growth_stats \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/account/growth_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'GET', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/account/growth_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/account/growth_stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/account/growth_stats",
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-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/account/growth_stats"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"stats": {
"cancellations": 0,
"net_new_subscribers": 3,
"new_subscribers": 3,
"subscribers": 3,
"starting": "2023-02-10T00:00:00-05:00",
"ending": "2023-02-24T23:59:59-05:00"
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"Starting date is incorrectly formatted. Use YYYY-MM-DD.",
"Ending date is incorrectly formatted. Use YYYY-MM-DD.",
"Starting date must be before the ending date."
]
}Authorizations
API KeyOAuth2
Authenticate API requests via an API Key
Query Parameters
Get stats for time period ending on this date (format yyyy-mm-dd). Defaults to today.
Get stats for time period beginning on this date (format yyyy-mm-dd). Defaults to 90 days ago.
Response
Returns your growth stats for the provided starting and ending dates
Show child attributes
Show child attributes
Was this page helpful?
⌘I