> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getedulead.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getedulead.com/_mcp/server.

# SearchVisits

GET https://api.getedulead.com/v4/visits/search

SearchVisits pages through one of the team's sites' visits, newest first unless order_by
 says otherwise, 25 a page by default. conditions must name exactly one site with a siteId
 condition.

Reference: https://docs.getedulead.com/api-reference/visits/search

## Authentication

- `Authorization` header (bearer token, required) — A team API key, sent as `Authorization: Bearer <key>`.
- `Authorization` header (bearer token, required) — The Cognito access token of a signed-in Edulead user (`edulead auth login`), sent as `Authorization: Bearer <token>`.

## Request

### Query parameters

- `conditions` (string, optional) — A JSON array of up to 30 conditions, all of which must hold: \[\{"field": "siteId", "operator": "equals", "value": "\<site id>"}, ...]. Fields: siteId (equals; required, one site), ingestedAt (equals, gt, gte, lt, lte, between, between\_string; an ISO 8601 date or date-time, or epoch milliseconds), and geo.subdivisions.isoCode (equals; "TX,CA" matches either). The grammar, every field with its operators and value: [https://docs.getedulead.com/search-conditions](https://docs.getedulead.com/search-conditions)
- `order_by` (enum, optional) — Sort order: a sortable field name, optionally followed by " desc". The allowed values are listed.
  - Allowed values: ``, `create_time desc`, `create_time`
- `page_size` (integer, optional) — Number of items per page, at most the maximum shown. Omitted or 0 means the RPC's default page size.
- `page_token` (string, optional) — Opaque token from a previous response; empty for the first page.

## Response

### 200

Success

- `items` (list of edulead.v4.Visit, optional) — The page of results, in the requested order.
- `next_page_token` (string, optional) — Token for the next page; empty when this is the last page.
- `total_size` (string, optional) — How many visits match the conditions, over every page.

## Types

### edulead.v4.Visit

Visit is one page view on a tracked site.

- `id` (string, optional) — Identifier of the resource, assigned by Edulead and opaque to callers.
- `site_id` (string, optional) — The site the page view was on: a Site id of `sites`.
- `create_time` (datetime, optional) — When Edulead created the resource.
- `browser_time` (datetime, optional) — The visitor's browser clock when the page loaded; unset when it reported none.
- `domain` (string, optional) — Host of the page.
- `path` (string, optional) — Path of the page.
- `title` (string, optional) — Title of the page.
- `referrer` (string, optional) — The page the visitor came from.
- `ip` (string, optional) — The visitor's IP address.
- `user_agent` (string, optional) — The visitor's user agent.
- `browser` (edulead.v4.VisitSoftware, optional) — VisitSoftware names a browser or an operating system.
- `os` (edulead.v4.VisitSoftware, optional) — The operating system.
- `device` (edulead.v4.VisitDevice, optional) — VisitDevice describes the visitor's device, as far as the user agent tells.
- `geo` (edulead.v4.VisitGeo, optional) — Where the visitor's IP address places them.
- `institutions` (list of edulead.v4.VisitInstitution, optional) — School districts within 30 km of the visitor, nearest first, at most 5; empty when the location was too coarse.

### edulead.v4.VisitSoftware

VisitSoftware names a browser or an operating system.

- `name` (string, optional)
- `version` (string, optional)

### edulead.v4.VisitDevice

VisitDevice describes the visitor's device, as far as the user agent tells.

- `type` (string, optional) — mobile, tablet, and so on; empty for a desktop.
- `vendor` (string, optional)
- `model` (string, optional)

### edulead.v4.VisitGeo

VisitGeo is where a visitor's IP address places them.

- `city` (string, optional)
- `region` (string, optional) — The state or province.
- `region_code` (string, optional) — The state or province code, such as TX.
- `country` (string, optional)
- `postal_code` (string, optional)
- `latitude` (double, optional)
- `longitude` (double, optional)
- `accuracy_radius_km` (integer, optional) — How far from latitude and longitude the visitor may be, in kilometers.
- `time_zone` (string, optional) — IANA time zone, such as America/Chicago.

### edulead.v4.VisitInstitution

VisitInstitution is a school district near a visitor.

- `institution_id` (string, optional) — The district: an institution id.
- `nces_id` (string, optional)
- `name` (string, optional)
- `type` (string, optional) — The institution type, such as DISTRICT.
- `distance_km` (double, optional) — How far the district is from the visitor, in kilometers.

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "string",
      "site_id": "string",
      "create_time": "2023-01-15T01:30:15.01Z",
      "browser_time": "2023-01-15T01:30:15.01Z",
      "domain": "string",
      "path": "string",
      "title": "string",
      "referrer": "string",
      "ip": "string",
      "user_agent": "string",
      "browser": {
        "name": "string",
        "version": "string"
      },
      "os": {
        "name": "string",
        "version": "string"
      },
      "device": {
        "type": "string",
        "vendor": "string",
        "model": "string"
      },
      "geo": {
        "city": "string",
        "region": "string",
        "region_code": "string",
        "country": "string",
        "postal_code": "string",
        "latitude": 1.1,
        "longitude": 1.1,
        "accuracy_radius_km": 1,
        "time_zone": "string"
      },
      "institutions": [
        {
          "institution_id": "string",
          "nces_id": "string",
          "name": "string",
          "type": "string",
          "distance_km": 1.1
        }
      ]
    }
  ],
  "next_page_token": "string",
  "total_size": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.getedulead.com/v4/visits/search"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getedulead.com/v4/visits/search';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getedulead.com/v4/visits/search"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getedulead.com/v4/visits/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getedulead.com/v4/visits/search")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getedulead.com/v4/visits/search', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getedulead.com/v4/visits/search");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getedulead.com/v4/visits/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```