traffic-by-servergeo

The following shows how to generate the traffic-by-servergeo report using either the Reporting API's Generate a report POST operation or the Get a cacheable report GET operation. Details about each report's supported products, metrics, filters, and available data intervals are also available dynamically by running the API's Get a report type operation, also shown below. See also other available reports.

Report definition

Returns daily traffic data by server country or region.

Business object: cpcode

Data available for: 90 days

Available metrics

MetricDescription
Data metrics
edgeBytesThe volume for the amount of API traffic that left the Akamai network.
edgeHitsThe request count delivered from Akamai edge servers to the end user.
server_countryThe country or area generating traffic.

Available filters

FilterTypeDescription
Optional filters
countryEnumerationThe country or area generating traffic.
delivery_typeEnumerationDistinguishes secure from non-secure traffic.

POST request

POST /reporting-api/v1/reports/traffic-by-servergeo/versions/1/report-data{?start,​end}

Sample: /reporting-api/v1/reports/traffic-by-servergeo/versions/1/report-data?start​=2020-10-01T00%3A00%3A00Z​&end​=2020-11-01T00%3A00%3A00Z

Query parameters

ParameterTypeSampleDescription
Required
startString2020-10-01T00:00:00ZSpecifies the start of the reported period as an ISO-8601 timestamp with optional time zone. The report includes data that matches the start value's timestamp.
endString2020-11-01T00:00:00ZSpecifies the end of the reported period as an ISO-8601 timestamp with optional time zone. The report excludes any data that matches the end value's timestamp.

JSON request members

MemberTypeDescription
objectIdsArraySpecifies the set of cpcode values you want to report on.
objectIdsEnumerationAs an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required.
metricsArrayThe set of desired metrics. If omitted, the report includes all available metrics.
filtersMap of arraysSpecifies a set of custom filters, with each filter's name keying an array with each filter's set of values.

Request body:

{
    "objectIds": [
        "55232",
        "23433",
        "32433"
    ],
    "metrics": [
        "edgeBytes",
        "edgeHits",
        "server_country"
    ],
    "filters": {
        "country": [
            "GB",
            "FR"
        ],
        "delivery_type": [
            "secure",
            "non-secure"
        ]
    }
}

GET request

GET /reporting-api/v1/reports/traffic-by-servergeo/versions/1/report-data{?start,​end,​objectIds,​allObjectIds,​metrics,​filters}

Sample: /reporting-api/v1/reports/traffic-by-servergeo/versions/1/report-data?start​=2020-10-01T00%3A00%3A00Z​&end​=2020-11-01T00%3A00%3A00Z​&objectIds​=55232,​23433,​32433​&metrics​=edgeBytes%2CedgeHits​&filters​=country%3DGB%2Ccountry%3DUS%2Cdelivery_type%3Dsecure%2Cdelivery_type%3Dnon-secure

Query parameters

ParameterTypeSampleDescription
Required
startString2022-06-23T13:55:00ZSpecifies the start of the reported period as an ISO-8601 timestamp with optional time zone. The report includes data that matches the start value’s timestamp.
endString2022-06-23T14:15:00ZSpecifies the end of the reported period as an ISO-8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
Optional
allObjectIdsBooleantrueAs an alternative to objectIds, enabling this generates a report that includes all IDs available for the cpcode objectType. This parameter is ignored if the request also specifies a set of objectIds.
objectIdsString55232,​23433,​32433As an alternative to allObjectIds, specifies the set of unique IDs for the cpcode objectType you want to report on, formatted as a comma-delimited list.
metricsStringedgeBytes,​edgeHitsSpecifies a comma-separated list of metrics to include in the report, otherwise all metrics if omitted. The set of available metrics depends on the type of report. URL-encode the entire value in the GET request.
filtersStringcountry=​GB,country=​US,delivery_type=​secure,​delivery_type=​non-secureSpecifies criteria to filter the report's data. The set of available filters depends on the type of report. Separate each filter name and value with an equals (=) character, and separate various name/value pairs with commas (,). To specify more than one filter value, repeat the filter name. See the accompanying example for guidance. URL-encode the entire value in the GET request.

JSON response

Status 200 application/json

Response body:

{
    "metadata": {
        "name": "traffic-by-servergeo",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "ghost_country_geo"
        ],
        "start": "2020-10-01T00:00:00Z",
        "end": "2020-11-01T00:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "country",
                "values": [
                    "GB",
                    "DE"
                ]
            },
            {
                "name": "delivery_type",
                "values": [
                    "secure",
                    "non-secure"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "ghost_country_geo"
            },
            {
                "name": "edgeBytes",
                "label": "Edge Bytes"
            },
            {
                "name": "edgeHits",
                "label": "Edge Hits"
            },
            {
                "name": "server_country",
                "label": "Country/Area"
            }
        ],
        "objectType": "cpcode",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "ghost_country_geo": "10001",
            "edgeBytes": "4745",
            "edgeHits": "629",
            "server_country": "CA"
        },
        {
            "ghost_country_geo": "77",
            "edgeBytes": "274",
            "edgeHits": "1099",
            "server_country": "FR"
        },
        {
            "ghost_country_geo": "3",
            "edgeBytes": "1667",
            "edgeHits": "3464",
            "server_country": "Other"
        },
        {
            "ghost_country_geo": "112",
            "edgeBytes": "4276",
            "edgeHits": "3090",
            "server_country": "JP"
        }
    ],
    "summaryStatistics": {}
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,​traffic-by-servergeo
version,​1
source,​traffic-by-servergeo/versions/1
groupBy,​ghost_country_geo
start,​2020-10-01T00:00:00Z
end,​2020-11-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,​4
objectType,​cpcode
objectIds,​55232,​23433,​32433
country,GB,DE
delivery_type,​secure,​non-secure
#METADATA_END

#SUMMARYSTATISTICS_START

#SUMMARYSTATISTICS_END

#COLUMNS_START
ghost_country_geo,​edgeBytes,​edgeHits,​server_country
#COLUMNS_END

#DATA_START
10001,​4745,​629,CA
77,​274,​1099,FR
3,​1667,​3464,Other
112,​4276,​3090,JP
#DATA_END

Get report details

This sample Get a report type operation gets the same information you need to run the traffic-by-servergeo report as provided in this reference documentation, but available dynamically to your API client application.

GET /reporting-api/v1/reports/traffic-by-servergeo/versions/1

Status 200 application/json

Response body:

{
    "name": "traffic-by-servergeo",
    "businessObjectName": "cpcode",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": false,
    "supportsPagination": false,
    "outputType": "FLAT",
    "requiredProducts": [
        "Basic Traffic Reports"
    ],
    "requiredRoles": [
        "Reports - View only"
    ],
    "available": true,
    "metrics": [
        {
            "name": "server_country",
            "label": "Country/Area",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "edgeBytes",
            "label": "Edge Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        },
        {
            "name": "edgeHits",
            "label": "Edge Hits",
            "unit": "COUNT",
            "summaryStatistic": false
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "ghost_country_geo"
    ],
    "filters": [
        {
            "name": "country",
            "type": "enum",
            "values": [
                {
                    "value": "PR"
                },
                {
                    "value": "PS"
                },
                {
                    "value": "PT"
                },
                {
                    "value": "PW"
                },
                {
                    "value": "PY"
                },
                {
                    "value": "QA"
                },
                {
                    "value": "AD"
                },
                {
                    "value": "AE"
                },
                {
                    "value": "AF"
                },
                {
                    "value": "AG"
                },
                {
                    "value": "AI"
                },
                {
                    "value": "AL"
                },
                {
                    "value": "AM"
                },
                {
                    "value": "AO"
                },
                {
                    "value": "AQ"
                },
                {
                    "value": "AR"
                },
                {
                    "value": "AS"
                },
                {
                    "value": "AT"
                },
                {
                    "value": "RE"
                },
                {
                    "value": "AU"
                },
                {
                    "value": "AW"
                },
                {
                    "value": "AZ"
                },
                {
                    "value": "RO"
                },
                {
                    "value": "BA"
                },
                {
                    "value": "BB"
                },
                {
                    "value": "RS"
                },
                {
                    "value": "BD"
                },
                {
                    "value": "BE"
                },
                {
                    "value": "RU"
                },
                {
                    "value": "BF"
                },
                {
                    "value": "BG"
                },
                {
                    "value": "RW"
                },
                {
                    "value": "BH"
                },
                {
                    "value": "BI"
                },
                {
                    "value": "BJ"
                },
                {
                    "value": "BL"
                },
                {
                    "value": "BM"
                },
                {
                    "value": "BN"
                },
                {
                    "value": "BO"
                },
                {
                    "value": "SA"
                },
                {
                    "value": "BQ"
                },
                {
                    "value": "SB"
                },
                {
                    "value": "BR"
                },
                {
                    "value": "SC"
                },
                {
                    "value": "BS"
                },
                {
                    "value": "SD"
                },
                {
                    "value": "BT"
                },
                {
                    "value": "SE"
                },
                {
                    "value": "BV"
                },
                {
                    "value": "SG"
                },
                {
                    "value": "BW"
                },
                {
                    "value": "SH"
                },
                {
                    "value": "SI"
                },
                {
                    "value": "BY"
                },
                {
                    "value": "SJ"
                },
                {
                    "value": "BZ"
                },
                {
                    "value": "SK"
                },
                {
                    "value": "SL"
                },
                {
                    "value": "SM"
                },
                {
                    "value": "SN"
                },
                {
                    "value": "SO"
                },
                {
                    "value": "CA"
                },
                {
                    "value": "SR"
                },
                {
                    "value": "CC"
                },
                {
                    "value": "SS"
                },
                {
                    "value": "CD"
                },
                {
                    "value": "ST"
                },
                {
                    "value": "CF"
                },
                {
                    "value": "SV"
                },
                {
                    "value": "CG"
                },
                {
                    "value": "CH"
                },
                {
                    "value": "SX"
                },
                {
                    "value": "CI"
                },
                {
                    "value": "SY"
                },
                {
                    "value": "SZ"
                },
                {
                    "value": "CK"
                },
                {
                    "value": "CL"
                },
                {
                    "value": "CM"
                },
                {
                    "value": "CN"
                },
                {
                    "value": "CO"
                },
                {
                    "value": "CR"
                },
                {
                    "value": "TC"
                },
                {
                    "value": "TD"
                },
                {
                    "value": "CU"
                },
                {
                    "value": "TF"
                },
                {
                    "value": "CV"
                },
                {
                    "value": "TG"
                },
                {
                    "value": "CW"
                },
                {
                    "value": "TH"
                },
                {
                    "value": "CX"
                },
                {
                    "value": "CY"
                },
                {
                    "value": "TJ"
                },
                {
                    "value": "CZ"
                },
                {
                    "value": "TK"
                },
                {
                    "value": "TL"
                },
                {
                    "value": "TM"
                },
                {
                    "value": "TN"
                },
                {
                    "value": "TO"
                },
                {
                    "value": "TR"
                },
                {
                    "value": "TT"
                },
                {
                    "value": "DE"
                },
                {
                    "value": "TV"
                },
                {
                    "value": "TW"
                },
                {
                    "value": "DJ"
                },
                {
                    "value": "TZ"
                },
                {
                    "value": "DK"
                },
                {
                    "value": "DM"
                },
                {
                    "value": "DO"
                },
                {
                    "value": "UA"
                },
                {
                    "value": "UG"
                },
                {
                    "value": "DZ"
                },
                {
                    "value": "UM"
                },
                {
                    "value": "EC"
                },
                {
                    "value": "US"
                },
                {
                    "value": "EE"
                },
                {
                    "value": "EG"
                },
                {
                    "value": "EH"
                },
                {
                    "value": "UY"
                },
                {
                    "value": "UZ"
                },
                {
                    "value": "VA"
                },
                {
                    "value": "ER"
                },
                {
                    "value": "VC"
                },
                {
                    "value": "ES"
                },
                {
                    "value": "ET"
                },
                {
                    "value": "VE"
                },
                {
                    "value": "EU"
                },
                {
                    "value": "VG"
                },
                {
                    "value": "VI"
                },
                {
                    "value": "VN"
                },
                {
                    "value": "VU"
                },
                {
                    "value": "FI"
                },
                {
                    "value": "FJ"
                },
                {
                    "value": "FK"
                },
                {
                    "value": "FM"
                },
                {
                    "value": "FO"
                },
                {
                    "value": "FR"
                },
                {
                    "value": "WF"
                },
                {
                    "value": "GA"
                },
                {
                    "value": "GB"
                },
                {
                    "value": "WS"
                },
                {
                    "value": "GD"
                },
                {
                    "value": "GE"
                },
                {
                    "value": "GF"
                },
                {
                    "value": "GG"
                },
                {
                    "value": "GH"
                },
                {
                    "value": "GI"
                },
                {
                    "value": "GL"
                },
                {
                    "value": "GM"
                },
                {
                    "value": "GN"
                },
                {
                    "value": "GP"
                },
                {
                    "value": "GQ"
                },
                {
                    "value": "GR"
                },
                {
                    "value": "GS"
                },
                {
                    "value": "GT"
                },
                {
                    "value": "GU"
                },
                {
                    "value": "GW"
                },
                {
                    "value": "GY"
                },
                {
                    "value": "HK"
                },
                {
                    "value": "HM"
                },
                {
                    "value": "HN"
                },
                {
                    "value": "HR"
                },
                {
                    "value": "HT"
                },
                {
                    "value": "YE"
                },
                {
                    "value": "HU"
                },
                {
                    "value": "ID"
                },
                {
                    "value": "YT"
                },
                {
                    "value": "IE"
                },
                {
                    "value": "IL"
                },
                {
                    "value": "IM"
                },
                {
                    "value": "IN"
                },
                {
                    "value": "IO"
                },
                {
                    "value": "ZA"
                },
                {
                    "value": "IQ"
                },
                {
                    "value": "IR"
                },
                {
                    "value": "IS"
                },
                {
                    "value": "IT"
                },
                {
                    "value": "ZM"
                },
                {
                    "value": "JE"
                },
                {
                    "value": "ZW"
                },
                {
                    "value": "JM"
                },
                {
                    "value": "JO"
                },
                {
                    "value": "JP"
                },
                {
                    "value": "KE"
                },
                {
                    "value": "KG"
                },
                {
                    "value": "KH"
                },
                {
                    "value": "KI"
                },
                {
                    "value": "KM"
                },
                {
                    "value": "KN"
                },
                {
                    "value": "KP"
                },
                {
                    "value": "KR"
                },
                {
                    "value": "KW"
                },
                {
                    "value": "KY"
                },
                {
                    "value": "KZ"
                },
                {
                    "value": "LA"
                },
                {
                    "value": "LB"
                },
                {
                    "value": "LC"
                },
                {
                    "value": "LI"
                },
                {
                    "value": "LK"
                },
                {
                    "value": "LR"
                },
                {
                    "value": "LS"
                },
                {
                    "value": "LT"
                },
                {
                    "value": "LU"
                },
                {
                    "value": "LV"
                },
                {
                    "value": "LY"
                },
                {
                    "value": "MA"
                },
                {
                    "value": "MC"
                },
                {
                    "value": "MD"
                },
                {
                    "value": "ME"
                },
                {
                    "value": "MF"
                },
                {
                    "value": "MG"
                },
                {
                    "value": "MH"
                },
                {
                    "value": "MK"
                },
                {
                    "value": "ML"
                },
                {
                    "value": "MM"
                },
                {
                    "value": "MN"
                },
                {
                    "value": "MO"
                },
                {
                    "value": "MP"
                },
                {
                    "value": "MQ"
                },
                {
                    "value": "MR"
                },
                {
                    "value": "MS"
                },
                {
                    "value": "MT"
                },
                {
                    "value": "MU"
                },
                {
                    "value": "MV"
                },
                {
                    "value": "MW"
                },
                {
                    "value": "MX"
                },
                {
                    "value": "MY"
                },
                {
                    "value": "MZ"
                },
                {
                    "value": "NA"
                },
                {
                    "value": "NC"
                },
                {
                    "value": "NE"
                },
                {
                    "value": "NF"
                },
                {
                    "value": "NG"
                },
                {
                    "value": "NI"
                },
                {
                    "value": "NL"
                },
                {
                    "value": "NO"
                },
                {
                    "value": "NP"
                },
                {
                    "value": "NR"
                },
                {
                    "value": "NU"
                },
                {
                    "value": "NZ"
                },
                {
                    "value": "OM"
                },
                {
                    "value": "PA"
                },
                {
                    "value": "PE"
                },
                {
                    "value": "PF"
                },
                {
                    "value": "PG"
                },
                {
                    "value": "PH"
                },
                {
                    "value": "PK"
                },
                {
                    "value": "PL"
                },
                {
                    "value": "PM"
                },
                {
                    "value": "PN"
                }
            ],
            "required": false
        },
        {
            "name": "delivery_type",
            "type": "enum",
            "values": [
                {
                    "value": "secure"
                },
                {
                    "value": "non_secure"
                }
            ],
            "required": false
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 90,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/traffic-by-servergeo/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/traffic-by-servergeo/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/traffic-by-servergeo/versions/1/report-data"
        }
    ]
}