Skip to main content
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-04-06T21:00:00Z", filter_date_lte="2025-05-06T21:00:00Z", filter_server="sv_mw49QDB5qagKb", filter_project="proj_AW6Q2D9lqKLpr")

    # Handle response
    print(res)
{
  "data": {
    "id": "",
    "type": "traffic",
    "attributes": {
      "from_date": 1750099537,
      "to_date": 1752691537,
      "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

Authorization
string
header
required

Query Parameters

filter[server]
string

The server id to filter by

filter[project]
string

The project id to filter by

filter[date][gte]
string
required

The start timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-01T00:00:00Z

filter[date][lte]
string
required

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

data
object
I