Searching users
You can use the REST API to search for visitors in your project using the POST call.
Searching for users
To search for users in your project using the REST API, you need to create a filters array.
Filters format
Objects in the filters array must contain a name, operator and value parameter:
POST https://api.eu.smartlook.cloud/api/v2/visitors/search
{
"filters": [
{
"name": "recording_date",
"operator": "is",
"value": "2023-05-18"
}
]
}
The following table contains all possible combinations of operators and values for each possible filter.
| Filter name | Description | Allowed operator | Allowed value | Notes |
|---|---|---|---|---|
uid | Unique user ID | is, is_not, contains, not_contains | <string>, [<string>,<string>,...] | value can be an array |
visitor_id | Visitor ID of the user | is, is_not | <string>, [<string>,<string>,...] | value can be an array |
recording_date | Date of the session recording | before, after, is,in_range | <string>,[<string>,<string>,...][<string>,<string>] | Must be a date. When using in_range, must be an array with ["from date", "to date"] |
user_first_seen | Date when the user was first seen | before, after, is,in_range | <string>,[<string>,<string>,...][<string>,<string>] | Must be a date. When using in_range, must be an array with ["from date", "to date"] |
Logical OR condition
OR conditionYou can enter an array as value to include an OR statement:
{
"name": "<name of the object>",
"operator": "is"|"is_not"|"contains"|"not_contains",
"value": [<string>,<string>...]
}
Response sorting
You can also add an optional sort object. If you do not add sort, the default sort is asc:
{timeCreate: `asc`|`desc`}
Query limit
You can add a limit parameter to your query. The default limit is 100 and the maximum is 100.
POST https://api.eu.smartlook.cloud/api/v2/visitors/search?limit=10
For more information, see the Search visitors in the API reference.
Updated over 2 years ago
