GET /categories/statistics

Warning

This call is deprecated. Please use the faster and more flexible generic endpoint POST /metrics/data instead, with the following payload to get the equivalent data:

POST /api/sellside/metrics/data
Content-Type: application/sellside.metrics.data-v1+json
Accept: application/json

{
    "timeRanges": [{
        "period": "custom",
        "from": "2020-01-01",
        "to": "2020-01-01"
    }],
    "dimensions": ["am:categoryID"],
        "metrics": ["am:countDistinctAdID", "am:impressions", "am:clicks", "am:websiteClicks", "am:emails", "am:spent"]
    "filters": [{ // optional, default is all categories
        "field": "am:categoryID",
        "operator": "in",
        "value": [1234, 5678]
    }]
}

As you can see, the date range in this call is not limited to a single date parameter.

GET /categories/statistics

Scope

api_ro or console_ro

Accept

application/sellside.category.statistics-v1+json, application/json

This URL returns a list of category statistics elements with statistics per category for the provided day. It is also possible to request only statistics for certain categories by using the parameter categoryIds.

If the parameter categoryIds contains invalid data, i.e. not a positive integer, the server returns 400 Bad Request.

If the parameter date contains an invalid date, the server returns 400 Bad Request. The date parameter is mandatory, the categoryIds parameter is not. By default all data for all categories (having data) is returned. Categories which have no data for the specified day will not have a statistics object in this result.

This method only allows 1 date parameter and not a date range is to make sure the individual calls are still manageable in both time and amount of data to process internally.

Parameters

Name

Type

Description

categoryIds

string

Comma-separated-list of integer id’s of the categories to get statistics for. Optional, default is for all categories.

date

string

Mandatory date for the statistics. Must be a valid date in format ‘yyyy-MM-dd’

_include

string

Comma-separated-list of fields to include. Optional, default is all fields.

_exclude

string

Comma-separated-list of fields to omit. Optional, default empty.

Errors

Field

Code

Error message

Description

date

2000

missing argument

The date parameter needs to be present

date

2001

invalid argument

The date parameter is not a correct date

categoryIds

2001

invalid argument

The comma-separated-list contains one or more non-integer values

categoryIds

2004

too short

The value needs to be non-empty

Example

GET /api/sellside/categories/statistics?categoryIds=2412,525,4216&date=2017-11-09
Accept: application/sellside.category.statistics-v1+json; application/json

200 OK
Content-Type: application/sellside.category.statistics-v1+json; charset=utf-8

[
    {
        "categoryId": 525,
        "numAds": 3,
        "impressions": 60,
        "clicks": 42,
        "urlClicks": 21,
        "emails": 6,
        "spent": 126
    },
    {
        "categoryId": 2412,
        "numAds": 21,
        "impressions": 630,
        "clicks": 72,
        "urlClicks": 21,
        "emails": 0,
        "spent": 1262
    }
]