Retrieve API Traffic Statistics
https://mapi.storyblok.com/v1/orgs/me/statistics/:all_trafficReturns API traffic usage statistics for the organization. Filter the response by date.
Query parameters
Section titled “Query parameters”- start_date string
Start date for traffic statistics. Provide date in
YYYY-MM-DDformat. - end_date string
End date for traffic statistics. Provide date in
YYYY-MM-DDformat. - group_by string
Group statistics by
day,month, oryear. Defaults tomonth.
Response properties
Section titled “Response properties”- montly_traffic_limit number
The organization’s monthly traffic limit.
- yearly_traffic_limit number
The organization’s annual traffic limit (monthly limit * 12).
- traffic_used_this_year number
The organization’s total annual traffic usage.
- cumulated_traffic object
A detailed breakdown of the aggregated traffic usage.
Show child properties
- requests_used_last_days number
API request usage in the last 7 days.
- total_requests_per_time_period number
Total API requests during the specified period.
- total_traffic_per_time_period number
Total traffic bytes during the specified period.
- traffic object[]
Traffic data grouped by date.
Show child properties
- date string
Date in
YYYY-MM-DDformat. - api_requests number
The number of API requests made on the specified period (day, month, or year).
- total_bytes number
The total bandwidth (in bytes) consumed by the API requests on the specified period (day, month, or year).
-
-
- traffic_top_spaces string[]
Top spaces by traffic usage, grouped by the
space_id.Show child properties
- date string
Date in
YYYY-MM-DDformat. - api_requests number
The number of API requests made on the specified period (day, month, or year).
- total_bytes number
The total bandwidth (in bytes) consumed by the API requests on the specified period (day, month, or year).
-
- traffic object[]
Raw traffic data per space grouped by date
Show child properties
- date string
Date in
YYYY-MM-DDformat. - api_requests number
The number of API requests made on the specified day of the month.
- total_bytes number
The total bandwidth (in bytes) consumed by the API requests on a specific day. When the response is
null, the bandwidth hasn’t been calculated yet. - space_id number
The ID of the tracked space.
-
Examples
Section titled “Examples”Example Request
curl "https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic" \ -H "Authorization: YOUR_OAUTH_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",});
try { const response = await storyblok.get('orgs/me/statistics/all_traffic', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('orgs/me/statistics/all_traffic')->getBody();HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic") .header("Authorization", "YOUR_OAUTH_TOKEN") .asString();var client = new RestClient("https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic");var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");IRestResponse response = client.Execute(request);import requests
url = "https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic"
querystring = {}
payload = ""headers = { 'Authorization': "YOUR_OAUTH_TOKEN"}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.get('orgs/me/statistics/all_traffic')let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))let request = URLRequest(storyblok: storyblok, path: "orgs/me/statistics/all_traffic")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(MAPI)) { accessToken = OAuth("YOUR_OAUTH_TOKEN") }}
val response = client.get("orgs/me/statistics/all_traffic")
println(response.body<JsonElement>()){ "montly_traffic_limit": 10000000, "yearly_traffic_limit": 120000000, "traffic_used_this_year": 15000000, "cumulated_traffic": { "requests_used_last_days": 15000, "total_requests_per_time_period": 50000, "total_traffic_per_time_period": 25000000, "traffic": [ { "date": "2023-01-01", "api_requests": 1500, "total_bytes": 2500000 } ] }, "traffic_top_spaces": { "123": [ { "date": "2023-01-01", "api_requests": 150, "total_bytes": 250000 }, { "date": "2023-01-02", "api_requests": 180, "total_bytes": 300000 } ], "456": [ { "date": "2023-01-01", "api_requests": 120, "total_bytes": 200000 } ], "other_spaces": [ { "date": "2023-01-01", "api_requests": 50, "total_bytes": 75000 } ] }, "traffic": [ { "date": "2023-01", "api_requests": 150, "total_bytes": 250000, "space_id": 789 } ]}Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window) . Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community