Filters

Document created by pubmatic-archivist on Mar 27, 2017Last modified by catherine.racette on Jun 5, 2017
Version 2Show Document
  • View in full screen mode

The filters query string parameter restricts the data returned from your request. To use the filters parameter, supply a dimension or metric on which to filter, followed by the filter expression.

 

Example:

The following query requests paidImpressions greater than 10000 served by a category equal to 123.

&filters=paidImpressions gt 10000&filters=categoryId eq 123

Note: You must include URL encoding in URL parameters. For example, Filter  with a trailing space should be encoded as Filter%20.

Filter Syntax

A single filter uses the following syntax:

  • <name> _ă” Indicates the name of the dimension or metric on which to filter, such as campaignId filters on the paidImpressions metric.
  • <operator> _ă” Indicates the type of filter match to use; specific to either dimensions or metrics.
  • <value> _ă” Indicates the values to be included in or excluded from the results.

 

Note:
* There should be a space between <name>,<operator> and <value>.
* Single filters should contain either a dimension or metric.
* <Operator> syntax is not case sensitive. For example, noteq and NOTEQ are treated the same.
* For null value filters only, NOTEQ and EQ operators are applicable. For example: &filters=adNetworkVariantId notEq null

Filter Types                                

  • AND filtering:  To include required multiple values in a request, prefix the conditions with an ampersand (_ă–and_ăť).

Example:

&filters=siteId EQ 36321&filters=countryId EQ 232 is interpreted as siteId = 36321 and countryId = 232
  • OR filtering: To indicate optional multiple values in a request, separate the conditions with commas (_ă–or_ăť).

 

Example: 

&filters=siteId EQ 36321,siteId EQ 36435 is interpreted as (siteId = 36321 OR siteId = 36435)

Limitations:

  • You may include 'OR' within dimensions or within metrics but not within dimensions and metrics together. For example, for dimensions D1 and D2 and metrics M1 and M2:
            Valid:      (D1 = 1 or D2 = 2) and (M1 > 100 or M2 > 1000)
            Invalid:   (D1 = 2 or M1 > 100)
  • You may use 'OR' between 'AND' but not 'AND' between 'OR.' For example:
            Valid:      (D1 = 1 or D2 = 2) and (M1 > 100 or M2 > 1000)
            Invalid:   (D1 = 1 and D2 = 2) or (M1 > 100 and M2 > 1000)

Attachments

    Outcomes