Search visitors
search_visitorsVisitors in the period with source, location, pageviews and payments. Filters are visitor-level (any visit in the period); visit_* arguments instead require one single visit to match both the came-from and the reached condition (e.g. visit_source google.com and visit_page /pricing), and rows then carry matchedVisitAt (pass it to get_visitor as visit_at). Requires the visitors scope.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_visitors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Name, email, visitor ID or user ID. | |
| os | No | ||
| to | No | Last day, YYYY-MM-DD (inclusive). | |
| from | No | First day, YYYY-MM-DD (inclusive). Use with to. | |
| sort | No | latest (last pageview), earliest (first pageview), pageviews, visitor (name or email), source, country, device or paid. | |
| limit | No | Rows to return (1–100). | |
| order | No | Default: desc for latest, pageviews and paid; asc for the others. | |
| trait | No | Identify trait key → value (comma-separated: any of them), e.g. {"role": "founder"}. Keys come from get_visitor_traits. | |
| device | No | ||
| fields | No | Optional: only these parts of the answer, as comma-separated dot paths (e.g. overview.current,series.date,series.visitors). Through a list a path applies to every item; period is always kept. An unknown top-level name fails with the list of valid ones. Leave out for the full answer. | |
| offset | No | ||
| period | No | Preset period, default 30d. today/yesterday/wtd/mtd follow the timezone. Ignored when from and to are set. | |
| browser | No | ||
| channel | No | First-visit channel, e.g. Organic Search, Direct, Social. | |
| compare | No | What change figures compare against: previous (default, the equal-length window right before), weekdays (the same length, starting whole weeks earlier on the same weekday, so Mondays compare with Mondays), year (same period last year), or a YYYY-MM-DD start (window keeps the period's length). Ignored for period all. | |
| country | No | Two-letter country code, e.g. US (comma-separated: any of them). | |
| filters | No | Up to six visitor filters, all of which must match. op: is, is_not (exact); contains, not_contains, starts_with, ends_with (literal text, letter case ignored); regex, not_regex (case-insensitive regular expressions up to 200 characters, without lookarounds, backreferences or repeated groups like (a+)+); is_empty, is_not_empty (no values: send []; e.g. utmCampaign is_empty = visitors who never had a campaign); gt, lt and is for visits. dim urlParam also needs key, the URL parameter name (one of the site's kept parameters): {"dim":"urlParam","key":"plan","op":"is","values":["pro"]}. dim prop (event property) needs key, the property name, and optionally goal to look only at that goal's events; values match as text (numbers and true/false too), and a visitor matches with at least one such event: {"dim":"prop","key":"plan","goal":"signup","op":"is","values":["growth"]} (list_event_properties lists names and values). dim trait needs key, a person's identify trait (get_visitor_traits lists them): {"dim":"trait","key":"role","op":"is","values":["founder"]}. Other dimensions take no key or goal. A 400 filter_too_slow means the regex was too slow: simplify it. | |
| payment | No | ||
| referrer | No | Referrer domain contains this text, e.g. google. | |
| timezone | No | IANA time zone for day boundaries and grouping, e.g. Europe/Madrid. Default UTC. | |
| visits_gt | No | More than this many visits in the period (a visit ends after 30 minutes without a pageview). | |
| visits_lt | No | Fewer than this many visits in the period. | |
| utm_medium | No | ||
| utm_source | No | ||
| visit_goal | No | Same-visit condition, reached: this goal in the same visit, e.g. signup. | |
| visit_page | No | Same-visit condition, reached: this exact path in the same visit, e.g. /pricing. Use at most one visit_page/visit_page_contains/visit_goal. | |
| website_id | No | Website ID from list_websites (the data-site-id value in the tracking script). | |
| utm_campaign | No | ||
| visit_source | No | Same-visit condition, came from: the visit's source, e.g. google.com (comma-separated: any of them). Use at most one visit_source/visit_channel/visit_campaign/visit_referrer/visit_entry_page. | |
| visited_page | No | Visited this exact path, e.g. /pricing (comma-separated: any of them). | |
| visit_channel | No | Same-visit condition, came from: the visit's channel, e.g. Organic Search. | |
| completed_goal | No | Completed this goal in the period, e.g. signup. | |
| visit_campaign | No | Same-visit condition, came from: the visit's utm_campaign. | |
| visit_referrer | No | Same-visit condition, came from: the visit's referrer contains this text, e.g. google. | |
| visit_entry_page | No | Same-visit condition, came from: the visit's first page, e.g. /blog/launch. | |
| visit_page_contains | No | Same-visit condition, reached: a path containing this text in the same visit, e.g. /docs. | |
| visited_page_contains | No | Visited a path containing this text, e.g. /docs. |