Hide menu Last updated: Dec 27 2017
Area: Episerver Profile Store Applies to versions: 1.3.0 and higher

Filtering, paging and sorting

This topic describes how to search for profiles and tracked events using filters, paging and sorting using the API in Episerver Profile Store.


Note: Replace each {x} placeholder in the following endpoints with an appropriate value.


GET /api/v1.0/trackevents/?$filter={1}&$skip={2}&$top={3}&$orderBy={4}


GET /api/v1.0/profiles/?$filter={1}&$skip={2}&$top={3}&$orderBy={4}


The querystring parameters are named according to the Microsoft Rest API Guidelines.

  1. $filter. Filters the results to be returned.

    Note: It is important to note that boolean operators like AND, OR, NOT must be all uppercase.

  2. $skip. Returns results from the specified offset.
  3. $top. Returns the specified number of results.
    • Together the $skip and $top parameters are used for client-driven paging.
    • Optional parameters.
    • If not specified, default values are: $skip=0 $top=100.
    • See Client-driven paging.
  4. $orderBy. Sorts the results according to the specified property.

Data structures and search

Note: Wildcard searching with * is not supported.

Note: The Payload object in TrackEvent is a dynamic object and is defined by a specific tracking implementation.


   "Value":"Visited the start page.",


   "Name":"John Doe",

Anything can be searched by specifying the JSON property name as the field in the filter.


EventType eq home


Visits gt 1

To search within nested objects, use the dot notation to build up the field name in the filter.

For TrackEvent for example, see the following Payload object example from the tracking as implemented in the Episerver Commerce Quicksilver sample site.

      "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
         "name":"John Doe",


When filtering based on email in a user object in Payload, use the following field name:

Payload.user.email eq admin@example.com


When filtering based on Email in the Info  object, use the following field name:

Info.Email eq admin@example.com


Responses are in JSON format. Two types of responses can be expected:

  • Successful response
    • Contains the following properties:
      • total. Total number of results on the server regardless of paging.
      • count. Number of results returned for the current request. Affected by the $top parameter.
      • items. Collection of results.
  • Error response
    • See ErrorResponse in the Microsoft Rest API Guidelines.
    • Returns the following property:
      • error which contains:
        • code. HTTP response code.
        • message. Error message or description.

Date and time format

The following standard for date and time is supported: ISO 8601 (UTC)


  • Date: 2017-10-09
  • Combined date and time in UTC: 2017-10-09T06:22:28+00:002017-10-09T06:22:28Z


Profiles filtered by device id

GET /api/v1.0/profiles/?$filter=DeviceIds eq xxxxx

Profiles filtered by email

GET /api/v1.0/profiles/?$filter=Info.Email eq user@example.com

Sorting of profiles on Name

GET /api/v1.0/profiles/?$filter=LastSeen gt 2017-09-01&$orderBy=Name ASC
GET /api/v1.0/profiles/?$filter=FirstSeen lt 2017-09-01&$orderBy=Name DESC

Sorting of events on CountryCode

GET /api/v1.0/trackevents/?$filter=PageUri eq http://www.host.com&$orderBy=CountryCode ASC

Profiles within a time range

GET /api/v1.0/profiles/?$filter=FirstSeen gt 2017-09-01T00:00:00Z AND FirstSeen lt 2017-09-30T00:00:00Z

Events within a date range belonging to a specific profile

GET /api/v1.0/trackevents/?$filter=EventTime gt 2017-09-01 AND EventTime lt 2017-09-30 AND ProfileId eq yyyyy

Events within a time range belonging to a specific device

GET /api/v1.0/trackevents/?$filter=EventTime gt 2017-09-18T08:15:35Z AND EventTime lt 2017-09-20T08:15:35Z AND DeviceId eq xxxx

Paging of events that occurred before a specific date (returns page 3 with a page size of 10 results)

GET /api/v1.0/trackevents/?$filter=EventTime le 2017-09-30&$skip=20&$top=10

Specify precedence using parentheses

If not supplied, logical operators are evaluated left to right.

GET /api/v1.0/trackevents/?$filter=Payload.value1 gt 2 OR (Payload.value2 le 3 AND Payload.value3 eq 3)

Total number of events for URL

GET /api/v1.0/trackevents/?$filter=PageUri eq http://www.url1.com

JSON response with count and total

total: 10,
count: 10,
items: {
Date: 2017-10-09
Combined date and time in UTC: 2017-10-09T06:22:28+00:00


Related topics