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 nameDescriptionAllowed operatorAllowed valueNotes
uidUnique user IDis, is_not, contains, not_contains<string>, [<string>,<string>,...]value can be an array
visitor_idVisitor ID of the useris, is_not<string>, [<string>,<string>,...]value can be an array
recording_dateDate of the session recordingbefore, 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_seenDate when the user was first seenbefore, 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

You 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.