post https://query.kissmetrics.io/v3/queries
People Search queries help find people who share something in common - an event they all do or a trait they all share. People Searches can return both groups of people and individual people. This section of the reference docs outlines the former (see People Search (Identity) Query for the latter).
To run an ad-hoc People Search query against the Kissmetrics REST API, you will need to generate query params that contain the query filter and result columns. In general, a People Search (Group Search) query is of the form:
- Find people who did "all of these":
- Has done event "Visited site" at least 1 time today
- Add columns to results:
- Latest "KM Browser" property value today
Here's how we break the above query down into filter and calculation properties:
"query_params": {
// Find people who
"type": "group",
// did "all of these"
"filter": {
"type": "and",
"operands": [{
"negate": false,
"type": "event",
"event": 2,
"frequency_occurence": "at_least",
"frequency_value": 1,
"date_range": {
"type": "preset",
"preset": "today"
}
}]
},
// and add these columns to the result
"calculations": [{
"type": "last_value_in_range",
"subject": {
"negate": false,
"type": "property",
"comparison_mode": "any_value",
"property": 755,
"date_range": {
"type": "preset",
"preset": "today"
}
}
}]
}