---
title: "Reads the store's views, visitors, sign-ins and sign-ups over a period, by channel, country and product, with visits by referrer, campaign and device."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › transaction

`GET /v1/stores/{store}/traffic/stats`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `transaction:read`

## Path parameters

- `store` (`trafficStats.path.store`; string, required) — The store's id.

## Query parameters

- `from` (`trafficStats.query.from`; string, optional)
  - format `date`
- `to` (`trafficStats.query.to`; string, optional)
  - format `date`
- `bucket` (`trafficStats.query.bucket`; string, optional)
  - one of `"day"`, `"week"`, `"month"`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/traffic/stats' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/traffic/stats';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/traffic/stats"

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

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

print(response.text)
```

## Responses

### 200

Reads the store's views, visitors, sign-ins and sign-ups over a period, by channel, country and product, with visits by referrer, campaign and device.

#### Example

```json
{
  "time_zone": "string",
  "from": "string",
  "to": "string",
  "previous_range": {
    "from": "string",
    "to": "string"
  },
  "bucket": "string",
  "rolled_through": "string",
  "covered_from": "string",
  "views": {
    "current": 0,
    "previous": 0
  },
  "visitors": {
    "current": 0,
    "previous": 0
  },
  "estimated": true,
  "sign_ins": {
    "current": 0,
    "previous": 0
  },
  "sign_ups": {
    "current": 0,
    "previous": 0
  },
  "by_event": [
    {
      "views": {
        "current": 0,
        "previous": 0
      },
      "visitors": {
        "current": 0,
        "previous": 0
      },
      "estimated": true,
      "event": "string"
    }
  ],
  "by_channel": [
    {
      "views": {
        "current": 0,
        "previous": 0
      },
      "visitors": {
        "current": 0,
        "previous": 0
      },
      "estimated": true,
      "channel": "string"
    }
  ],
  "by_country": [
    {
      "views": {
        "current": 0,
        "previous": 0
      },
      "visitors": {
        "current": 0,
        "previous": 0
      },
      "estimated": true,
      "country": "string"
    }
  ],
  "top_products": {
    "total": 0,
    "covered_from": "string",
    "products": [
      {
        "views": {
          "current": 0,
          "previous": 0
        },
        "visitors": {
          "current": 0,
          "previous": 0
        },
        "estimated": true,
        "product": {
          "id": "string",
          "title": "string"
        }
      }
    ]
  },
  "series": [
    {
      "start": "string",
      "end": "string",
      "views": 0,
      "visitors": 0,
      "previous_views": 0,
      "previous_visitors": 0,
      "estimated": true
    }
  ],
  "sources": {
    "visits": {
      "current": 0,
      "previous": 0
    },
    "estimated": true,
    "covered_from": "string",
    "top_referrers": {
      "total": 0,
      "referrers": [
        {
          "visits": {
            "current": 0,
            "previous": 0
          },
          "estimated": true,
          "referrer": "string"
        }
      ],
      "other": {
        "visits": {
          "current": 0,
          "previous": 0
        },
        "estimated": true
      }
    },
    "top_campaigns": {
      "total": 0,
      "campaigns": [
        {
          "visits": {
            "current": 0,
            "previous": 0
          },
          "estimated": true,
          "campaign": {
            "utm_source": "string",
            "utm_medium": "string",
            "utm_campaign": "string",
            "ref": "string"
          }
        }
      ],
      "untagged": {
        "visits": {
          "current": 0,
          "previous": 0
        },
        "estimated": true
      },
      "other": {
        "visits": {
          "current": 0,
          "previous": 0
        },
        "estimated": true
      }
    },
    "by_device": [
      {
        "visits": {
          "current": 0,
          "previous": 0
        },
        "estimated": true,
        "device": "string"
      }
    ]
  }
}
```

- `time_zone` (`trafficStats.response.200.time_zone`; string, required)
- `from` (`trafficStats.response.200.from`; string, required)
- `to` (`trafficStats.response.200.to`; string, required)
- `previous_range` (`trafficStats.response.200.previous_range`; object, required)
  - `from` (`trafficStats.response.200.previous_range.from`; string, required)
  - `to` (`trafficStats.response.200.previous_range.to`; string, required)
- `bucket` (`trafficStats.response.200.bucket`; string, required)
- `rolled_through` (`trafficStats.response.200.rolled_through`; any of, required) — The latest store-local day the totals are rolled up through, null before the first; later days count nothing yet.
  - any of: `string`, `null`
- `covered_from` (`trafficStats.response.200.covered_from`; any of, required) — The earliest store-local day the totals hold, null before the first; earlier days count nothing.
  - any of: `string`, `null`
- `views` (`trafficStats.response.200.views`; object, required) — Pages, products and entries shown, scaled back from sampling.
  - `current` (`trafficStats.response.200.views.current`; number, required)
  - `previous` (`trafficStats.response.200.views.previous`; any of, required)
    - any of: `number`, `null`
- `visitors` (`trafficStats.response.200.visitors`; object, required) — Unique visitors of each day, summed over the days: no visitor is followed from one day to the next, so one person on three days counts three times.
  - `current` (`trafficStats.response.200.visitors.current`; number, required)
  - `previous` (`trafficStats.response.200.visitors.previous`; any of, required)
    - any of: `number`, `null`
- `estimated` (`trafficStats.response.200.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
- `sign_ins` (`trafficStats.response.200.sign_ins`; object, required) — Customers signing in, a new sign-up included.
  - `current` (`trafficStats.response.200.sign_ins.current`; number, required)
  - `previous` (`trafficStats.response.200.sign_ins.previous`; any of, required)
    - any of: `number`, `null`
- `sign_ups` (`trafficStats.response.200.sign_ups`; object, required) — Customers signing in for the first time.
  - `current` (`trafficStats.response.200.sign_ups.current`; number, required)
  - `previous` (`trafficStats.response.200.sign_ups.previous`; any of, required)
    - any of: `number`, `null`
- `by_event` (`trafficStats.response.200.by_event`; array<object>, required)
  - `views` (`trafficStats.response.200.by_event.views`; object, required) — Pages, products and entries shown, scaled back from sampling.
    - `current` (`trafficStats.response.200.by_event.views.current`; number, required)
    - `previous` (`trafficStats.response.200.by_event.views.previous`; any of, required)
      - any of: `number`, `null`
  - `visitors` (`trafficStats.response.200.by_event.visitors`; object, required) — Unique visitors of each day, summed over the days: no visitor is followed from one day to the next, so one person on three days counts three times.
    - `current` (`trafficStats.response.200.by_event.visitors.current`; number, required)
    - `previous` (`trafficStats.response.200.by_event.visitors.previous`; any of, required)
      - any of: `number`, `null`
  - `estimated` (`trafficStats.response.200.by_event.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `event` (`trafficStats.response.200.by_event.event`; string, required)
- `by_channel` (`trafficStats.response.200.by_channel`; array<object>, required) — By the channel each view came through: `web`, `api`, `mcp` or `feed`.
  - `views` (`trafficStats.response.200.by_channel.views`; object, required) — Pages, products and entries shown, scaled back from sampling.
    - `current` (`trafficStats.response.200.by_channel.views.current`; number, required)
    - `previous` (`trafficStats.response.200.by_channel.views.previous`; any of, required)
      - any of: `number`, `null`
  - `visitors` (`trafficStats.response.200.by_channel.visitors`; object, required) — Unique visitors of each day, summed over the days: no visitor is followed from one day to the next, so one person on three days counts three times.
    - `current` (`trafficStats.response.200.by_channel.visitors.current`; number, required)
    - `previous` (`trafficStats.response.200.by_channel.visitors.previous`; any of, required)
      - any of: `number`, `null`
  - `estimated` (`trafficStats.response.200.by_channel.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `channel` (`trafficStats.response.200.by_channel.channel`; string, required)
- `by_country` (`trafficStats.response.200.by_country`; array<object>, required) — By the visitor's country, null where it is unknown.
  - `views` (`trafficStats.response.200.by_country.views`; object, required) — Pages, products and entries shown, scaled back from sampling.
    - `current` (`trafficStats.response.200.by_country.views.current`; number, required)
    - `previous` (`trafficStats.response.200.by_country.views.previous`; any of, required)
      - any of: `number`, `null`
  - `visitors` (`trafficStats.response.200.by_country.visitors`; object, required) — Unique visitors of each day, summed over the days: no visitor is followed from one day to the next, so one person on three days counts three times.
    - `current` (`trafficStats.response.200.by_country.visitors.current`; number, required)
    - `previous` (`trafficStats.response.200.by_country.visitors.previous`; any of, required)
      - any of: `number`, `null`
  - `estimated` (`trafficStats.response.200.by_country.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `country` (`trafficStats.response.200.by_country.country`; any of, required)
    - any of: `string`, `null`
- `top_products` (`trafficStats.response.200.top_products`; object, required) — The most viewed products in the range, and how many were viewed at all.
  - `total` (`trafficStats.response.200.top_products.total`; number, required)
  - `covered_from` (`trafficStats.response.200.top_products.covered_from`; any of, required) — The first day the product figures hold, which may come after `covered_from`.
    - any of: `string`, `null`
  - `products` (`trafficStats.response.200.top_products.products`; array<object>, required)
    - `views` (`trafficStats.response.200.top_products.products.views`; object, required) — Pages, products and entries shown, scaled back from sampling.
      - `current` (`trafficStats.response.200.top_products.products.views.current`; number, required)
      - `previous` (`trafficStats.response.200.top_products.products.views.previous`; any of, required)
        - any of: `number`, `null`
    - `visitors` (`trafficStats.response.200.top_products.products.visitors`; object, required) — Unique visitors of each day, summed over the days: no visitor is followed from one day to the next, so one person on three days counts three times.
      - `current` (`trafficStats.response.200.top_products.products.visitors.current`; number, required)
      - `previous` (`trafficStats.response.200.top_products.products.visitors.previous`; any of, required)
        - any of: `number`, `null`
    - `estimated` (`trafficStats.response.200.top_products.products.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
    - `product` (`trafficStats.response.200.top_products.products.product`; object, required)
      - `id` (`trafficStats.response.200.top_products.products.product.id`; string, required)
      - `title` (`trafficStats.response.200.top_products.products.product.title`; any of, required)
        - any of: `string`, `null`
- `series` (`trafficStats.response.200.series`; array<object>, required)
  - `start` (`trafficStats.response.200.series.start`; string, required)
  - `end` (`trafficStats.response.200.series.end`; string, required)
  - `views` (`trafficStats.response.200.series.views`; number, required)
  - `visitors` (`trafficStats.response.200.series.visitors`; number, required)
  - `previous_views` (`trafficStats.response.200.series.previous_views`; any of, required)
    - any of: `number`, `null`
  - `previous_visitors` (`trafficStats.response.200.series.previous_visitors`; any of, required)
    - any of: `number`, `null`
  - `estimated` (`trafficStats.response.200.series.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
- `sources` (`trafficStats.response.200.sources`; object, required)
  - `visits` (`trafficStats.response.200.sources.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
    - `current` (`trafficStats.response.200.sources.visits.current`; number, required)
    - `previous` (`trafficStats.response.200.sources.visits.previous`; any of, required)
      - any of: `number`, `null`
  - `estimated` (`trafficStats.response.200.sources.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `covered_from` (`trafficStats.response.200.sources.covered_from`; any of, required) — The first day the visit figures hold, which may come after the answer's `covered_from`; null until one holds a visit.
    - any of: `string`, `null`
  - `top_referrers` (`trafficStats.response.200.sources.top_referrers`; object, required) — The referring hosts with the most visits, direct visits as null, and how many the days' top values name, direct included.
    - `total` (`trafficStats.response.200.sources.top_referrers.total`; number, required)
    - `referrers` (`trafficStats.response.200.sources.top_referrers.referrers`; array<object>, required)
      - `visits` (`trafficStats.response.200.sources.top_referrers.referrers.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
        - `current` (`trafficStats.response.200.sources.top_referrers.referrers.visits.current`; number, required)
        - `previous` (`trafficStats.response.200.sources.top_referrers.referrers.visits.previous`; any of, required)
          - any of: `number`, `null`
      - `estimated` (`trafficStats.response.200.sources.top_referrers.referrers.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
      - `referrer` (`trafficStats.response.200.sources.top_referrers.referrers.referrer`; any of, required)
        - any of: `string`, `null`
    - `other` (`trafficStats.response.200.sources.top_referrers.other`; object, required) — Visits from every referring host not listed.
      - `visits` (`trafficStats.response.200.sources.top_referrers.other.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
        - `current` (`trafficStats.response.200.sources.top_referrers.other.visits.current`; number, required)
        - `previous` (`trafficStats.response.200.sources.top_referrers.other.visits.previous`; any of, required)
          - any of: `number`, `null`
      - `estimated` (`trafficStats.response.200.sources.top_referrers.other.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `top_campaigns` (`trafficStats.response.200.sources.top_campaigns`; object, required) — The campaigns with the most visits, and how many the days' top values name.
    - `total` (`trafficStats.response.200.sources.top_campaigns.total`; number, required)
    - `campaigns` (`trafficStats.response.200.sources.top_campaigns.campaigns`; array<object>, required)
      - `visits` (`trafficStats.response.200.sources.top_campaigns.campaigns.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
        - `current` (`trafficStats.response.200.sources.top_campaigns.campaigns.visits.current`; number, required)
        - `previous` (`trafficStats.response.200.sources.top_campaigns.campaigns.visits.previous`; any of, required)
          - any of: `number`, `null`
      - `estimated` (`trafficStats.response.200.sources.top_campaigns.campaigns.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
      - `campaign` (`trafficStats.response.200.sources.top_campaigns.campaigns.campaign`; object, required)
        - `utm_source` (`trafficStats.response.200.sources.top_campaigns.campaigns.campaign.utm_source`; any of, required)
          - any of: `string`, `null`
        - `utm_medium` (`trafficStats.response.200.sources.top_campaigns.campaigns.campaign.utm_medium`; any of, required)
          - any of: `string`, `null`
        - `utm_campaign` (`trafficStats.response.200.sources.top_campaigns.campaigns.campaign.utm_campaign`; any of, required)
          - any of: `string`, `null`
        - `ref` (`trafficStats.response.200.sources.top_campaigns.campaigns.campaign.ref`; any of, required)
          - any of: `string`, `null`
    - `untagged` (`trafficStats.response.200.sources.top_campaigns.untagged`; object, required) — Visits whose landing named no campaign.
      - `visits` (`trafficStats.response.200.sources.top_campaigns.untagged.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
        - `current` (`trafficStats.response.200.sources.top_campaigns.untagged.visits.current`; number, required)
        - `previous` (`trafficStats.response.200.sources.top_campaigns.untagged.visits.previous`; any of, required)
          - any of: `number`, `null`
      - `estimated` (`trafficStats.response.200.sources.top_campaigns.untagged.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
    - `other` (`trafficStats.response.200.sources.top_campaigns.other`; object, required) — Visits from every campaign not listed.
      - `visits` (`trafficStats.response.200.sources.top_campaigns.other.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
        - `current` (`trafficStats.response.200.sources.top_campaigns.other.visits.current`; number, required)
        - `previous` (`trafficStats.response.200.sources.top_campaigns.other.visits.previous`; any of, required)
          - any of: `number`, `null`
      - `estimated` (`trafficStats.response.200.sources.top_campaigns.other.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
  - `by_device` (`trafficStats.response.200.sources.by_device`; array<object>, required) — By the visitor's device, every one with visits: `mobile`, or `desktop` for a desktop or a tablet, null where it is unknown.
    - `visits` (`trafficStats.response.200.sources.by_device.visits`; object, required) — Visits (a visit's first page), scaled back from sampling.
      - `current` (`trafficStats.response.200.sources.by_device.visits.current`; number, required)
      - `previous` (`trafficStats.response.200.sources.by_device.visits.previous`; any of, required)
        - any of: `number`, `null`
    - `estimated` (`trafficStats.response.200.sources.by_device.estimated`; boolean, required) — Counted from sampled data, so the figures are estimates.
    - `device` (`trafficStats.response.200.sources.by_device.device`; any of, required)
      - any of: `string`, `null`

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`trafficStats.response.default.type`; string, required)
  - format `uri`
- `title` (`trafficStats.response.default.title`; string, required)
- `status` (`trafficStats.response.default.status`; integer, required)
- `detail` (`trafficStats.response.default.detail`; string, required)
- `code` (`trafficStats.response.default.code`; string, optional)
- `context` (`trafficStats.response.default.context`; object, optional)
- `reached_core` (`trafficStats.response.default.reached_core`; boolean, optional)
- `core_answer` (`trafficStats.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/traffic-stats/index.md
