---
title: Retrieve API Traffic Statistics
description: Returns API traffic usage statistics for the organization.
url: https://storyblok.com/docs/api/management/statistics/retrieve-api-traffic-statistics
---

# Retrieve API Traffic Statistics

GET

```html
https://mapi.storyblok.com/v1/orgs/me/statistics/:all_traffic
```

Returns API traffic usage statistics for the organization. Filter the response by date.

## Query parameters

-   `start_date` (string)
    
    Start date for traffic statistics. Provide date in `YYYY-MM-DD` format.
    
-   `end_date` (string)
    
    End date for traffic statistics. Provide date in `YYYY-MM-DD` format.
    
-   `group_by` (string)
    
    Group statistics by `day`, `month`, or `year`. Defaults to `month`.
    

## 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-DD` format.
            
        -   `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-DD` format.
        
    -   `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-DD` format.
        
    -   `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

Example Request

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic" \
      -H "Authorization: YOUR_OAUTH_TOKEN"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import 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)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $client->get('orgs/me/statistics/all_traffic')->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/orgs/me/statistics/all_traffic")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .asString();
    ```
    
-   C#
    
    ```csharp
    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);
    ```
    
-   Python
    
    ```python
    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)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    client.get('orgs/me/statistics/all_traffic')
    ```
    
-   Swift
    
    ```swift
    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))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.get("orgs/me/statistics/all_traffic")
    
    println(response.body<JsonElement>())
    ```

Response Example

```json
{
  "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
    }
  ]
}
```

## Pagination

-   [Previous: Statistics](/docs/api/management/statistics)
-   [Next: Retrieve Assets Traffic Statistics](/docs/api/management/statistics/retrieve-assets-traffic-statistics)
