> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJjNzg0YzY1OC0zZjM2LTQ3YmYtOWVjYS00YmY4YTU2ODExZGUiLCJleHAiOjE3NzgzNDIzODAsImlhdCI6MTc3ODM0MjA4MH0.2LHvf0a8DFXEL6fGnJ54ZehKZF9YHeHjYi-EnSm4URo
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Get Recent Queries

GET https://fai.buildwithfern.com/queries/{domain}

Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/query/get-recent-queries

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: fai
  version: 1.0.0
paths:
  /queries/{domain}:
    get:
      operationId: get-recent-queries
      summary: Get Recent Queries
      tags:
        - subpackage_query
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: The page number for pagination
          required: false
          schema:
            type:
              - integer
              - 'null'
        - name: limit
          in: query
          description: The number of queries per page
          required: false
          schema:
            type:
              - integer
              - 'null'
        - name: cutoff_time
          in: query
          description: Only return queries after this time
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: include_assistant
          in: query
          description: Whether to include assistant responses in the results
          required: false
          schema:
            type:
              - boolean
              - 'null'
        - name: start_date
          in: query
          description: The start date of the period to retrieve analytics for
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: end_date
          in: query
          description: The end date of the period to retrieve analytics for
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetQueriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://fai.buildwithfern.com
  - url: https://fai-dev.buildwithfern.com
  - url: http://localhost:8080
components:
  schemas:
    Query:
      type: object
      properties:
        query_id:
          type: string
        conversation_id:
          type: string
        domain:
          type: string
        text:
          type: string
        role:
          type: string
        source:
          type: string
        created_at:
          type: string
          format: date-time
        time_to_first_token:
          type:
            - number
            - 'null'
          format: double
        subqueries:
          type:
            - array
            - 'null'
          items:
            type: string
      required:
        - query_id
        - conversation_id
        - domain
        - text
        - role
        - source
        - created_at
      title: Query
    PaginationResponse:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
      required:
        - total
        - page
        - limit
      title: PaginationResponse
    GetQueriesResponse:
      type: object
      properties:
        queries:
          type: array
          items:
            $ref: '#/components/schemas/Query'
          description: List of queries matching the request criteria
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
          description: Pagination information
      required:
        - queries
        - pagination
      title: GetQueriesResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```