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

# Sessions counted per group, with filter conditions

> Sessions of the window counted per group, with distinct companies, bounce (at most one page) and averages; the grouped view of /sessions with the same filters. Without group_by: one row with the window's totals. Sectors are SIC major groups of the visiting companies.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/trackers/{tracker_code}/sessions/counts
openapi: 3.1.0
info:
  title: Leadinfo Data API
  version: 0.1.0
  x-logo:
    url: https://asset.leadinfo.com/assets/email_logo.png
servers:
  - url: https://data.leadinfo.com
    description: Production
security: []
paths:
  /v1/trackers/{tracker_code}/sessions/counts:
    post:
      tags:
        - traffic
      summary: Sessions counted per group, with filter conditions
      description: >-
        Sessions of the window counted per group, with distinct companies,
        bounce (at most one page) and averages; the grouped view of /sessions
        with the same filters. Without group_by: one row with the window's
        totals. Sectors are SIC major groups of the visiting companies.
      operationId: search_session_counts_v1_trackers__tracker_code__sessions_counts_post
      parameters:
        - name: tracker_code
          in: path
          required: true
          schema:
            type: string
            title: Tracker Code
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionCountsBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionCountsResponse'
        '401':
          description: Invalid credentials.
        '403':
          description: Tracker not owned by this client.
        '422':
          description: Invalid query parameters.
      security:
        - HTTPBearer: []
components:
  schemas:
    SessionCountsBody:
      properties:
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
          description: >-
            Inclusive start of the window. Defaults to end_date, so omitting
            both dates returns today. Widen explicitly for multi-day analytics
            and expect higher latency on long ranges with high-traffic trackers.
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
          description: Inclusive end of the window. Defaults to today.
        offset:
          type: integer
          maximum: 100000
          minimum: 0
          title: Offset
          description: Rows to skip; use meta.next_offset for the next page.
          default: 0
        group_by:
          anyOf:
            - type: string
              enum:
                - channel
                - source
                - medium
                - campaign
                - term
                - content
                - referrer_host
                - click_provider
                - landing_page
                - sector
                - country
                - city
                - company
                - day
                - week
                - month
                - hour
                - weekday
            - type: 'null'
          title: Group By
          description: >-
            Count per channel, a traffic column, landing page, sector (SIC major
            group), country, city, company or a time unit (hour 0-23, weekday 0
            = Sunday). Without it: one row with the totals of the window.
        domain_filter:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain Filter
        limit:
          type: integer
          maximum: 500
          minimum: 1
          title: Limit
          default: 50
        filters:
          items:
            $ref: '#/components/schemas/SessionFilterRule'
          type: array
          title: Filters
      type: object
      title: SessionCountsBody
    SessionCountsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SessionCount'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/SessionCountsMeta'
      type: object
      required:
        - data
        - meta
      title: SessionCountsResponse
    SessionFilterRule:
      properties:
        field:
          type: string
          enum:
            - source
            - medium
            - campaign
            - term
            - content
            - referrer_host
            - click_provider
            - duration
            - pages
          title: Field
        operator:
          type: string
          enum:
            - equals
            - not_equals
            - contains
            - in
            - greater_than
            - less_than
            - is_known
            - is_unknown
          title: Operator
        value:
          anyOf:
            - {}
            - type: 'null'
          title: Value
      type: object
      required:
        - field
        - operator
      title: SessionFilterRule
    SessionCount:
      properties:
        group:
          type: string
          title: Group
          description: The value counted; '(none)' when it is empty.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: 'sector: the SIC major group; company: its name.'
        company_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Company Id
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: 'city: its country.'
        sessions:
          type: integer
          title: Sessions
        companies:
          type: integer
          title: Companies
          description: Distinct companies behind the sessions.
        bounce_sessions:
          type: integer
          title: Bounce Sessions
          description: Sessions with at most one page.
        bounce_rate:
          type: number
          title: Bounce Rate
        avg_pages:
          type: number
          title: Avg Pages
        avg_active_seconds:
          type: number
          title: Avg Active Seconds
      type: object
      required:
        - group
        - sessions
        - companies
        - bounce_sessions
        - bounce_rate
        - avg_pages
        - avg_active_seconds
      title: SessionCount
    SessionCountsMeta:
      properties:
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
        has_more:
          type: boolean
          title: Has More
        returned:
          type: integer
          title: Returned
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
        offset:
          type: integer
          title: Offset
          default: 0
        next_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Offset
          description: The offset of the next page; null on the last page.
        group_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Group By
      type: object
      required:
        - has_more
        - returned
      title: SessionCountsMeta
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.