Skip to main content
GET
/
cdn
/
statistics
/
series
CDN resource statistics
curl --request GET \
  --url https://api.gcore.com/cdn/statistics/series \
  --header 'Authorization: <api-key>'
{
  "resource": {
    "1": {
      "region": {
        "asia": {
          "metrics": {
            "sent_bytes": [
              [
                1543622400,
                17329220573
              ]
            ],
            "total_bytes": [
              [
                1543622400,
                17384617989
              ]
            ],
            "upstream_bytes": [
              [
                1543622400,
                55397416
              ]
            ]
          }
        }
      }
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://gcore.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Query Parameters

service
string
required

Service name.

Possible value:

  • CDN
from
string
required

Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)

Example:

  • &from=2018-12-01T00:00:00.000
to
string
required

End of the requested time period (ISO 8601/RFC 3339 format, UTC.)

Example:

  • &to=2018-12-01T01:00:00.000
granularity
string
required

Duration of time chunks into which the data will be divided.

Possible values:

  • 1m - available only for up to 1 month in the past.
  • 5m
  • 15m
  • 1h
  • 1d
metrics
string
required

Types of statistics data.

Possible values:

  • upstream_bytes - Traffic in bytes from an origin server to CDN servers or to origin shielding when used.
  • sent_bytes - Traffic in bytes from CDN servers to clients.
  • shield_bytes - Traffic in bytes from Origin shielding to CDN servers.
  • total_bytes - shield_bytes, upstream_bytes and sent_bytes combined.
  • cdn_bytes - sent_bytes and shield_bytes combined.
  • requests - Number of requests to edge servers.
  • responses_2xx - Number of 2xx response codes.
  • responses_3xx - Number of 3xx response codes.
  • responses_4xx - Number of 4xx response codes.
  • responses_5xx - Number of 5xx response codes.
  • responses_hit - Number of responses with the header Cache: HIT.
  • responses_miss - Number of responses with the header Cache: MISS.
  • cache_hit_traffic_ratio - Formula: 1 - upstream_bytes / sent_bytes. We deduct the non-cached traffic from the total traffic amount.
group_by
string

Output data grouping.

Possible values:

  • client - Data is grouped by clients.
  • resource - Data is grouped by CDN resources.
  • region - Data is grouped by regions of CDN edge servers.
  • country - Data is grouped by countries of CDN edge servers.
  • vhost - Data is grouped by resources CNAMEs.
  • client_country - Data is grouped by countries, based on end-users' location.

To request multiple values, use:

  • &group_by=client&group_by=resource
countries
string

Names of countries for which data should be displayed.

English short names from ISO 3166 standard without the definite article ("the") should be used.

To request multiple values, use:

  • &countries=france&countries=denmark
regions
string

Regions for which data is displayed.

Possible values:

  • na - North America
  • eu - Europe
  • cis - Commonwealth of Independent States
  • asia - Asia
  • au - Australia
  • latam - Latin America
  • me - Middle East
  • africa - Africa
  • sa - South America
resource
integer

CDN resources IDs.

To request multiple values, use:

  • &resource=1&resource=2
client
integer

Client accounts IDs.

To request multiple values, use:

  • &client=1&client=2

Response

Successful.

client
object

Statistics information grouped by client accounts IDs.

resource
object

Statistics information grouped by CDN resources.

region
object

Regions for which data is displayed.

Possible values:

  • asia - Asia
  • au - Australia
  • cis - CIS (Commonwealth of Independent States)
  • eu - Europe
  • latam - Latin America
  • me - Middle East
  • na - North America.
  • africa - Africa
  • sa - South America
metrics
object

Statistics parameters.

upstream_bytes
integer[]

Bytes from the upstream to the CDN servers.

Represented by two values, for example:

  • 1543622400 - time in the UNIX timestamp when statistics were received.
  • 17329220573 - bytes.
sent_bytes
integer[]

Bytes from CDN servers to the end-users.

Represented by two values, for example:

  • 1543622400 - time in the UNIX timestamp when statistics were received.
  • 17329220573 - bytes.
total_bytes
integer[]

Upstream bytes and sent_bytes combined.

Represented by two values, for example:

  • 1543622400 - time in the UNIX timestamp when statistics were received.
  • 17329220573 - bytes.