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

# Statistics

Returns normalized performance data for a given adnetwork and Adgreg website.

* **`website_id`** — the Adgreg website ID from [Get user sites](/api-reference/endpoint/user-sites), not an adnetwork site ID.
* **Date range** — defaults to the beginning of the current month through yesterday. Maximum range is 30 days.
* **`dimensions`** — controls how results are grouped. Omit it to receive a single row of fully accumulated totals. Pass a comma-separated list of any combination of `date`, `spot`, `spot_type`, `site` to break results down by those fields. Order does not matter.

  <Note>
    `spot` and `site` dimensions refer to the adnetwork's own spot and site IDs — not your Adgreg-configured spots or websites.
  </Note>

```
dimensions=date,spot_type
```


## OpenAPI

````yaml GET /statistics
openapi: 3.1.0
info:
  title: AdGreg API
  version: 0.1.0
servers:
  - url: https://api.adgreg.com
security: []
paths:
  /statistics:
    get:
      tags:
        - Dashboard configuration
      summary: Statistics
      operationId: statistics_statistics_get
      parameters:
        - name: ad_network
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/AdNetwork'
        - name: website_id
          in: query
          required: true
          schema:
            type: integer
            title: Website Id
        - name: spot_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Spot Type
        - name: date_from
          in: query
          required: false
          schema:
            type: string
            format: date
            description: >-
              *Default:* Beginning of month. *Format*: YYYY-MM-DD. *Max range:*
              30 days.
            title: Date From
          description: >-
            *Default:* Beginning of month. *Format*: YYYY-MM-DD. *Max range:* 30
            days.
        - name: date_to
          in: query
          required: false
          schema:
            type: string
            format: date
            description: '*Default:* Yesterday. *Format*: YYYY-MM-DD.'
            title: Date To
          description: '*Default:* Yesterday. *Format*: YYYY-MM-DD.'
        - name: dimensions
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              *Available values:* date, spot, spot_type, site. *Example:*
              `date,spot_type`
            title: Dimensions
          description: >-
            *Available values:* date, spot, spot_type, site. *Example:*
            `date,spot_type`
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdgregStatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AdNetwork:
      type: string
      enum:
        - exoclick
        - trafficstars
        - kadam
        - clickadilla
        - onclicka
        - twinred
        - trafficshop
        - hilltop
      title: AdNetwork
    AdgregStatsResponse:
      properties:
        response:
          items:
            $ref: '#/components/schemas/AdgregStatSpot'
          type: array
          title: Response
      type: object
      required:
        - response
      title: AdgregStatsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AdgregStatSpot:
      properties:
        impressions:
          type: integer
          title: Impressions
        clicks:
          type: integer
          title: Clicks
        revenue:
          type: number
          title: Revenue
        adnetwork:
          $ref: '#/components/schemas/AdNetwork'
        user_website_id:
          type: integer
          title: User Website Id
        stat_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Stat Date
        api_spot_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Spot Id
        api_website_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Website Id
        user_spot_type:
          anyOf:
            - type: string
            - type: 'null'
          title: User Spot Type
      type: object
      required:
        - impressions
        - clicks
        - revenue
        - adnetwork
        - user_website_id
      title: AdgregStatSpot
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````