Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.traffic.get(filter_date_gte="2025-12-14T15:57:10Z", filter_date_lte="2026-01-14T15:57:10Z", filter_server="sv_A05EdQ50dvKYQ", filter_project="proj_AW6Q2D9lqKLpr")
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Traffic.Get(ctx, "2025-12-14T15:57:10Z", "2026-01-14T15:57:10Z", latitudeshgosdk.Pointer("sv_A05EdQ50dvKYQ"), latitudeshgosdk.Pointer("proj_AW6Q2D9lqKLpr"))
if err != nil {
log.Fatal(err)
}
if res.Traffic != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.traffic.get({
filterServer: "sv_A05EdQ50dvKYQ",
filterDateGte: "2025-12-14T15:57:10Z",
filterDateLte: "2026-01-14T15:57:10Z",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/traffic \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/traffic', 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.latitude.sh/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/traffic")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "",
"type": "traffic",
"attributes": {
"from_date": 1765727830,
"to_date": 1768406230,
"total_inbound_gb": 102,
"total_outbound_gb": 241,
"total_inbound_95th_percentile_mbps": 1832.91,
"total_outbound_95th_percentile_mbps": 1819.99,
"regions": [
{
"region_slug": "brazil",
"total_inbound_gb": 102,
"total_outbound_gb": 241,
"total_inbound_95th_percentile_mbps": 1832.91,
"total_outbound_95th_percentile_mbps": 1819.99,
"data": [
{
"date": "2021-07-01T00:00:00.000+00:00",
"inbound_gb": 10,
"outbound_gb": 102,
"avg_outbound_speed_mbps": 1.19,
"avg_inbound_speed_mbps": 0.13
},
{
"date": "2021-07-02T00:00:00.000+00:00",
"inbound_gb": 2,
"outbound_gb": 6,
"avg_outbound_speed_mbps": 0.08,
"avg_inbound_speed_mbps": 0.02
},
{
"date": "2021-07-03T00:00:00.000+00:00",
"inbound_gb": 5,
"outbound_gb": 15,
"avg_outbound_speed_mbps": 0.18,
"avg_inbound_speed_mbps": 0.06
},
{
"date": "2021-07-04T00:00:00.000+00:00",
"inbound_gb": 57,
"outbound_gb": 32,
"avg_outbound_speed_mbps": 0.38,
"avg_inbound_speed_mbps": 0.66
},
{
"date": "2021-07-05T00:00:00.000+00:00",
"inbound_gb": 11,
"outbound_gb": 59,
"avg_outbound_speed_mbps": 0.69,
"avg_inbound_speed_mbps": 0.13
},
{
"date": "2021-07-06T00:00:00.000+00:00",
"inbound_gb": 17,
"outbound_gb": 27,
"avg_outbound_speed_mbps": 0.32,
"avg_inbound_speed_mbps": 0.2
}
]
}
]
}
},
"meta": {}
}Traffic
Retrieve traffic
GET
/
traffic
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.traffic.get(filter_date_gte="2025-12-14T15:57:10Z", filter_date_lte="2026-01-14T15:57:10Z", filter_server="sv_A05EdQ50dvKYQ", filter_project="proj_AW6Q2D9lqKLpr")
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Traffic.Get(ctx, "2025-12-14T15:57:10Z", "2026-01-14T15:57:10Z", latitudeshgosdk.Pointer("sv_A05EdQ50dvKYQ"), latitudeshgosdk.Pointer("proj_AW6Q2D9lqKLpr"))
if err != nil {
log.Fatal(err)
}
if res.Traffic != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.traffic.get({
filterServer: "sv_A05EdQ50dvKYQ",
filterDateGte: "2025-12-14T15:57:10Z",
filterDateLte: "2026-01-14T15:57:10Z",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/traffic \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/traffic', 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.latitude.sh/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/traffic")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "",
"type": "traffic",
"attributes": {
"from_date": 1765727830,
"to_date": 1768406230,
"total_inbound_gb": 102,
"total_outbound_gb": 241,
"total_inbound_95th_percentile_mbps": 1832.91,
"total_outbound_95th_percentile_mbps": 1819.99,
"regions": [
{
"region_slug": "brazil",
"total_inbound_gb": 102,
"total_outbound_gb": 241,
"total_inbound_95th_percentile_mbps": 1832.91,
"total_outbound_95th_percentile_mbps": 1819.99,
"data": [
{
"date": "2021-07-01T00:00:00.000+00:00",
"inbound_gb": 10,
"outbound_gb": 102,
"avg_outbound_speed_mbps": 1.19,
"avg_inbound_speed_mbps": 0.13
},
{
"date": "2021-07-02T00:00:00.000+00:00",
"inbound_gb": 2,
"outbound_gb": 6,
"avg_outbound_speed_mbps": 0.08,
"avg_inbound_speed_mbps": 0.02
},
{
"date": "2021-07-03T00:00:00.000+00:00",
"inbound_gb": 5,
"outbound_gb": 15,
"avg_outbound_speed_mbps": 0.18,
"avg_inbound_speed_mbps": 0.06
},
{
"date": "2021-07-04T00:00:00.000+00:00",
"inbound_gb": 57,
"outbound_gb": 32,
"avg_outbound_speed_mbps": 0.38,
"avg_inbound_speed_mbps": 0.66
},
{
"date": "2021-07-05T00:00:00.000+00:00",
"inbound_gb": 11,
"outbound_gb": 59,
"avg_outbound_speed_mbps": 0.69,
"avg_inbound_speed_mbps": 0.13
},
{
"date": "2021-07-06T00:00:00.000+00:00",
"inbound_gb": 17,
"outbound_gb": 27,
"avg_outbound_speed_mbps": 0.32,
"avg_inbound_speed_mbps": 0.2
}
]
}
]
}
},
"meta": {}
}Authorizations
Query Parameters
The server id to filter by
The project id to filter by
The start timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-01T00:00:00Z
The end timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-31T23:59:59Z
Response
200 - application/vnd.api+json
Success
Show child attributes
Show child attributes
Was this page helpful?
⌘I