# List Agent Analytics Countries

Returns a site's visits from coding agents and AI assistants per country in the date range, most visits first.

## OpenAPI

````yaml
/openapi.json
get
/v2/agent-analytics/sites/{site_id}/countries
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
tags:
  - name: Agent Analytics
    description: >-
      See which coding agents, AI bots, and people visit your tracked sites,
      which pages they read, which pages return errors, and where the visits
      come from.
paths:
  /v2/agent-analytics/sites/{site_id}/countries:
    get:
      tags:
        - Agent Analytics
      summary: List Agent Analytics Countries
      description: >-
        Returns a site's visits from coding agents and AI assistants per country
        in the date range, most visits first.
      operationId: v2_agent_analytics_countries_list
      parameters:
        - name: site_id
          in: path
          required: true
          schema:
            type: string
            title: Site Id
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
            title: Start Date
          description: >-
            Inclusive range start; defaults to 6 days before the end date. The
            range may span at most 90 days.
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
            title: End Date
          description: Inclusive range end in UTC; defaults to today.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentAnalyticsCountryListResponse'
    security:
      - LightsageApiKeyAuth: []
components:
  schemas:
    PublicAgentAnalyticsCountryListResponse:
      properties:
        site_id:
          type: string
          title: Site Id
        start_date:
          type: string
          format: date
          title: Start Date
        end_date:
          type: string
          format: date
          title: End Date
        countries:
          items:
            $ref: '#/components/schemas/PublicAgentCountry'
          type: array
          title: Countries
          description: >-
            Visits from coding agents and AI assistants per country, most visits
            first. The country is located from the IP address the request came
            from. For hosted assistants such as ChatGPT that is usually the
            provider's servers, not the person who asked; for coding agents it
            is usually the developer's machine.
      type: object
      required:
        - site_id
        - start_date
        - end_date
      title: PublicAgentAnalyticsCountryListResponse
    PublicAgentCountry:
      properties:
        country:
          type: string
          title: Country
          description: Two-letter ISO country code of the request, or `unknown`.
        visits:
          type: integer
          title: Visits
      type: object
      required:
        - country
        - visits
      title: PublicAgentCountry
````
