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

# Cohort retention for a builder

> For each cohort day in the requested window, returns the cohort size and the share of traders that came back on day +1, +7, and +30.



## OpenAPI

````yaml https://api.struct.to/openapi.json get /polymarket/builders/{builder_code}/retention
openapi: 3.1.0
info:
  title: Polymarket API
  description: >-
    RESTful API for querying Polymarket prediction markets data including
    events, markets, traders, holders, and real-time metrics
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.struct.to/v1
security: []
paths:
  /polymarket/builders/{builder_code}/retention:
    get:
      tags:
        - Builders
      summary: Cohort retention for a builder
      description: >-
        For each cohort day in the requested window, returns the cohort size and
        the share of traders that came back on day +1, +7, and +30.
      operationId: get_builder_retention
      parameters:
        - name: builder_code
          in: path
          description: Builder code.
          required: true
          schema:
            type: string
        - name: from
          in: query
          description: >-
            Inclusive start of cohort window (Unix seconds). Default: now - 30
            days.
          required: false
          schema:
            type: integer
            format: int64
        - name: to
          in: query
          description: >-
            Inclusive end of cohort window (Unix seconds). Default: now - 1 day.
            Cohorts within this range have at least one full day for D1
            retention; older cohorts are required for D7/D30.
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Per-cohort-day retention metrics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CohortRetentionRow'
components:
  schemas:
    CohortRetentionRow:
      type: object
      description: One row of cohort retention output.
      required:
        - cohort_day
        - cohort_size
        - retained
        - retention
      properties:
        cohort_day:
          type: integer
          format: int64
          description: Cohort day as Unix-second timestamp at 00:00 UTC.
        cohort_size:
          type: integer
          format: int64
          description: |-
            Number of distinct traders whose first-ever trade with this builder
            landed on `cohort_day`.
        retained:
          $ref: '#/components/schemas/RetainedCounts'
          description: Retained trader counts.
        retention:
          $ref: '#/components/schemas/RetentionFractions'
          description: Retention fractions.
    RetainedCounts:
      type: object
      description: Counts of cohort traders active on day +1 / +7 / +30.
      required:
        - d1
        - d7
        - d30
      properties:
        d1:
          type: integer
          format: int64
          description: Day-1 retention.
        d7:
          type: integer
          format: int64
          description: Day-7 retention.
        d30:
          type: integer
          format: int64
          description: Day-30 retention.
    RetentionFractions:
      type: object
      description: Retained counts as fractions of `cohort_size` (0 when cohort is empty).
      required:
        - d1
        - d7
        - d30
      properties:
        d1:
          type: number
          format: double
          description: Day-1 retention.
        d7:
          type: number
          format: double
          description: Day-7 retention.
        d30:
          type: number
          format: double
          description: Day-30 retention.

````