Subscriptions
Get subscription spans
Returns the time spans during which data was collected for this subscription. Spans are created when a subscription is activated/resumed and ended when paused/deleted.
GET
/
v1
/
subscriptions
/
{id}
/
spans
Python (ticksupply library)
# pip install ticksupply
from ticksupply import Client
client = Client(api_key="<api-key>")
spans = client.subscriptions.list_spans("sub_019478a23c5f7b8e9d12abcdef012345")
print(spans)// cargo add ticksupply
// cargo add tokio --features full
use ticksupply::Client;
#[tokio::main]
async fn main() -> ticksupply::Result<()> {
let client = Client::with_api_key("<api-key>")?;
let spans = client.subscriptions()
.list_spans("sub_019478a23c5f7b8e9d12abcdef012345")
.await?;
println!("{spans:#?}");
Ok(())
}
curl --request GET \
--url https://api.ticksupply.com/v1/subscriptions/{id}/spans \
--header 'X-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.ticksupply.com/v1/subscriptions/{id}/spans', 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.ticksupply.com/v1/subscriptions/{id}/spans",
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.ticksupply.com/v1/subscriptions/{id}/spans"
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.ticksupply.com/v1/subscriptions/{id}/spans")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ticksupply.com/v1/subscriptions/{id}/spans")
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[
{
"id": "spn_0194a1b2c3d4e5f6a7b8c9d0e1f2a3b4",
"started_at": "2024-01-15T10:00:00Z",
"ended_at": "2024-01-20T18:30:00Z"
},
{
"id": "spn_0194b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
"started_at": "2024-01-25T09:00:00Z",
"ended_at": "2024-02-01T12:00:00Z"
},
{
"id": "spn_0194c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"started_at": "2024-02-05T08:00:00Z",
"ended_at": null
}
]{
"error": {
"code": "unauthenticated",
"message": "Invalid or missing API key"
}
}{
"error": {
"code": "not_found",
"message": "Subscription not found"
}
}{
"error": {
"code": "request_timeout",
"message": "Request exceeded 10s deadline"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds."
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}Authorizations
Your API key. Get one from the dashboard at https://app.ticksupply.com/api-keys
Path Parameters
Subscription ID (prefixed format, e.g., sub_xxx)
Pattern:
^sub_[a-f0-9]{32}$Response
List of subscription spans
Last modified on February 6, 2026
Was this page helpful?
⌘I
Python (ticksupply library)
# pip install ticksupply
from ticksupply import Client
client = Client(api_key="<api-key>")
spans = client.subscriptions.list_spans("sub_019478a23c5f7b8e9d12abcdef012345")
print(spans)// cargo add ticksupply
// cargo add tokio --features full
use ticksupply::Client;
#[tokio::main]
async fn main() -> ticksupply::Result<()> {
let client = Client::with_api_key("<api-key>")?;
let spans = client.subscriptions()
.list_spans("sub_019478a23c5f7b8e9d12abcdef012345")
.await?;
println!("{spans:#?}");
Ok(())
}
curl --request GET \
--url https://api.ticksupply.com/v1/subscriptions/{id}/spans \
--header 'X-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.ticksupply.com/v1/subscriptions/{id}/spans', 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.ticksupply.com/v1/subscriptions/{id}/spans",
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.ticksupply.com/v1/subscriptions/{id}/spans"
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.ticksupply.com/v1/subscriptions/{id}/spans")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ticksupply.com/v1/subscriptions/{id}/spans")
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[
{
"id": "spn_0194a1b2c3d4e5f6a7b8c9d0e1f2a3b4",
"started_at": "2024-01-15T10:00:00Z",
"ended_at": "2024-01-20T18:30:00Z"
},
{
"id": "spn_0194b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
"started_at": "2024-01-25T09:00:00Z",
"ended_at": "2024-02-01T12:00:00Z"
},
{
"id": "spn_0194c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"started_at": "2024-02-05T08:00:00Z",
"ended_at": null
}
]{
"error": {
"code": "unauthenticated",
"message": "Invalid or missing API key"
}
}{
"error": {
"code": "not_found",
"message": "Subscription not found"
}
}{
"error": {
"code": "request_timeout",
"message": "Request exceeded 10s deadline"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds."
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}