---
title: "Fetch analytics data for a website"
method: POST
path: "/v1/analytics/website"
tags: ["Public API"]
---

# Fetch analytics data for a website

`POST /v1/analytics/website`

## Request

- Base URL: `https://api.foudroyer.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.foudroyer.com/v1/analytics/website`
- Auth: HTTP bearer

Returns Search Console analytics including clicks, impressions, position and CTR, broken down by date, country, device, query and page.

## Request body

- GetStatsDto
  - `websiteId` string, required: The ID of the website to fetch analytics for
  - `filter` FilterEntity, required
    - `source` string: Filter by source
    - `query` string: Filter by search query
    - `country` string: Filter by country code
    - `device` 'desktop' | 'mobile' | 'tablet': Filter by device type
    - `page` string: Filter by page URL
    - `from` string, date-time, required: Start date for the analytics period
    - `to` string, date-time, required: End date for the analytics period
  - `orderBy` 'clicks' | 'click_through_rate' | 'impressions' | 'position' | 'date': Order by field for sorting results

## Response `200`

---

[API](https://skmtc.dev/foudroyer/apis/foudroyer-api.md) - [All operations](https://skmtc.dev/foudroyer/apis/foudroyer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/foudroyer/apis/foudroyer-api/revisions/5b917c67e013?raw)
