Skip to main content
GET
/
traffic
Go (SDK)
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-06-16T18:45:37Z", "2025-07-16T18:45:37Z", latitudeshgosdk.Pointer("sv_kjQwdEMXdYNVP"), nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.Traffic != nil {
        // handle response
    }
}
{
  "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