<!-- https://developers.silktide.com/v1/analytics -->

# Analytics

Analytics measures real visits to your websites with the Silktide Script, without cookies. Through the API you can read what it measured into your own dashboards and reports: how many people visited, where they came from, what they read, and what they did.

Every Analytics operation is a [results query](https://developers.silktide.com/v1/concepts/results.md), and they all take the same arguments for what to read and over which dates. They are described once here.

## Which analytics to read

Send one of these:

| Argument | What it reads |
| --- | --- |
| `view` | An analytics view. Its id is the number after `/analytics/` in the view's address in Silktide. `view=all` reads all of the account's analytics. |
| `websiteId` | The analytics of a website, which must have Analytics set up. Add `sectionId` for one of its [sections](https://developers.silktide.com/v1/concepts/websites-and-sections.md). |

Leave both out and the query answers with an error.

## Over which dates

| Argument | What it does |
| --- | --- |
| `period` | The date range: `today`, `last-7-days`, `last-30-days`, `last-90-days`, `month-to-date`, `last-month`, `year-to-date`, `last-12-months`, `all`, or `custom`. Defaults to `all`. |
| `from`, `to` | With `period=custom`, the first and last day, such as `2026-10-01`. |
| `timezone` | The IANA time zone days are read in, such as `America/New_York`. Defaults to `UTC`. |

Queries that answer over time, one entry per hour, day, week or month, need a period with a start: send any `period` but `all`. With the default, they currently answer with an error.

## Which visits

`filters` keeps only the visits that match every filter you send. Each is keyed by what it filters, and its value is an operator and a value:

```text
filters[url]=contains:/blog&filters[deviceType]=is:mobile
```

| Operator | Matches |
| --- | --- |
| `is` | Exactly the value. |
| `not` | Anything but the value. |
| `contains` | Anything containing the value, ignoring case. |
| `starts` | Anything starting with the value, matching case. |
| `gt`, `lt` | More than, or less than, the value, such as `filters[viewWidth]=gt:1200`. |

Keys include `url`, `hostName`, `entryUrl`, `exitUrl`, `event`, `outgoingUrl`, `referrer`, `source`, `medium`, `campaign`, `content`, `term`, `countryCode`, `regionCode`, `language`, `viewWidth`, `deviceType` (`desktop`, `tablet` or `mobile`), `operatingSystem` and `browser`. An unknown key or operator answers with an error.

## Three kinds of answer

- **A table**, such as pages or sources, with one row each. It takes `columns`, `sort`, `search` and pagination. See [Tables](https://developers.silktide.com/v1/concepts/tables.md).
- **A series**, such as visitors over time, with one entry per step. Each step's time is written `YYYY-MM-DD HH:MM:SS` in your `timezone`.
- **A list**, such as the top sources, with a `limit` on how many entries come back.

## An example

The ten most viewed pages in the last 30 days, across all of the account's analytics:

```bash
curl "https://api.eu.silktide.com/v1/results/analytics/pages?view=all&period=last-30-days&columns=url,pageViews&sort=pageViews:d&rowsPerPage=10" \
  -H "Authorization: silktide token=YOUR_API_KEY"
```

In Silktide itself: [Analytics](https://docs.silktide.com/analytics), in Help.
## Audience

- [Get how many people visited, step by step over a period](https://developers.silktide.com/v1/analytics/audience/get-visitors-over-time.md): GET
- [Get how many pages were viewed, step by step over a period](https://developers.silktide.com/v1/analytics/audience/get-page-views-over-time.md): GET
- [Get the share of visits that bounced, step by step over a period](https://developers.silktide.com/v1/analytics/audience/get-bounce-rate-over-time.md): GET
- [Get how long visits lasted, step by step over a period](https://developers.silktide.com/v1/analytics/audience/get-duration-over-time.md): GET
- [List the countries visitors came from](https://developers.silktide.com/v1/analytics/audience/get-countries.md): GET
- [List the regions within countries that visitors came from](https://developers.silktide.com/v1/analytics/audience/get-regions.md): GET
- [List the browsers visitors used](https://developers.silktide.com/v1/analytics/audience/get-browsers.md): GET
- [List the operating systems visitors used](https://developers.silktide.com/v1/analytics/audience/get-operating-systems.md): GET
- [List the sizes of browser window visitors used](https://developers.silktide.com/v1/analytics/audience/get-browser-sizes.md): GET
- [Get visitors at each browser size, step by step over a period](https://developers.silktide.com/v1/analytics/audience/get-browser-sizes-over-time.md): GET

## Acquisition

- [List where visitors came from, one row per source and medium](https://developers.silktide.com/v1/analytics/acquisition/get-sources.md): GET
- [Get visitors from the busiest sources, step by step](https://developers.silktide.com/v1/analytics/acquisition/get-sources-over-time.md): GET
- [List the campaigns visitors arrived through](https://developers.silktide.com/v1/analytics/acquisition/get-campaigns.md): GET
- [Get visitors from the busiest campaigns, step by step](https://developers.silktide.com/v1/analytics/acquisition/get-campaigns-over-time.md): GET

## Content

- [List the pages people viewed](https://developers.silktide.com/v1/analytics/content/get-pages.md): GET
- [List the landing pages visits began on](https://developers.silktide.com/v1/analytics/content/get-entry-pages.md): GET
- [List the pages visits ended on](https://developers.silktide.com/v1/analytics/content/get-exit-pages.md): GET
- [List the files people downloaded](https://developers.silktide.com/v1/analytics/content/get-downloads.md): GET
- [List the links people left your website through](https://developers.silktide.com/v1/analytics/content/get-outgoing-links.md): GET
- [List the pages where people met dead clicks](https://developers.silktide.com/v1/analytics/content/get-frustration-pages.md): GET

## Engagement

- [List the events visitors sent, with how often and by how many](https://developers.silktide.com/v1/analytics/engagement/get-events.md): GET
- [Get how often each event was sent, step by step](https://developers.silktide.com/v1/analytics/engagement/get-events-over-time.md): GET
- [List the properties an event was sent with](https://developers.silktide.com/v1/analytics/engagement/get-event-properties.md): GET
- [Rank the values one property of an event was sent with](https://developers.silktide.com/v1/analytics/engagement/get-event-property-values.md): GET
- [List every time an event was sent, newest first](https://developers.silktide.com/v1/analytics/engagement/get-event-occurrences.md): GET
- [List goals and how often each was completed](https://developers.silktide.com/v1/analytics/engagement/get-goals.md): GET
- [List what people searched your site for](https://developers.silktide.com/v1/analytics/engagement/get-site-search-terms.md): GET
- [Count searches of your site, step by step](https://developers.silktide.com/v1/analytics/engagement/get-site-searches-over-time.md): GET
