> ## Documentation Index
> Fetch the complete documentation index at: https://surf-dcinside-api.kr.ask.surf/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Weights

> The publish-score weights in force, and the version before them.

<div style={{ maxWidth: 760 }}>
  <h2 style={{ fontSize: "22px", marginBottom: 8 }}>Overview</h2>

  <Warning>
    **Not in MVP scope.** Until it is available, the weights stay at the first-trial setting: `views = 1` and every other weight `0`. Every cycle response already names the `weights_version` in use.
  </Warning>

  The **Get Weights** API returns the weights that scored the latest cycle and the version before them. Use it to check that a [`PUT /v1/weights`](/set-weights) took effect, and to see which weights a `weights_version` in a cycle response stands for.

  <Note>
    Weights set with `PUT /v1/weights` show as `current` from the cycle named in `first_cycle_time`. Before that cycle, the previous version is still the one scoring.
  </Note>

  ***

  <h2 style={{ fontSize: "22px", marginBottom: 8 }}>Response Attributes</h2>

  <ResponseField name="current" type="object" required>
    <Expandable title="properties">
      <ResponseField name="version" type="string" required>
        Weights version.
      </ResponseField>

      <ResponseField name="weights" type="object" required>
        Publish-score weights. At least one of `views`, `comments` and `up` must be above 0.

        <Expandable title="properties">
          <ResponseField name="views" type="number" required>
            Weight on `p_views`.
          </ResponseField>

          <ResponseField name="comments" type="number" required>
            Weight on `p_comments`.
          </ResponseField>

          <ResponseField name="up" type="number" required>
            Weight on `p_up`.
          </ResponseField>

          <ResponseField name="downvote_share" type="number" required>
            Weight on the predicted down-vote share. It is subtracted, so send it as a positive number.
          </ResponseField>

          <ResponseField name="hide" type="integer">
            Reserved for the later hide head. Must be 0 or left out.
          </ResponseField>

          <ResponseField name="deletion" type="integer">
            Reserved for the later deletion head. Must be 0 or left out.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="note" type="string | null">
        The note sent with the weights, or `null`.
      </ResponseField>

      <ResponseField name="set_at" type="string" required>
        When the weights were accepted.
      </ResponseField>

      <ResponseField name="first_cycle_time" type="string" required>
        The first cycle the weights applied to.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="previous" type="object | null" required>
    The version before the current one, or `null` if there is none.

    <Expandable title="properties">
      <ResponseField name="version" type="string" required>
        Weights version.
      </ResponseField>

      <ResponseField name="weights" type="object" required>
        Publish-score weights. At least one of `views`, `comments` and `up` must be above 0.

        <Expandable title="properties">
          <ResponseField name="views" type="number" required>
            Weight on `p_views`.
          </ResponseField>

          <ResponseField name="comments" type="number" required>
            Weight on `p_comments`.
          </ResponseField>

          <ResponseField name="up" type="number" required>
            Weight on `p_up`.
          </ResponseField>

          <ResponseField name="downvote_share" type="number" required>
            Weight on the predicted down-vote share. It is subtracted, so send it as a positive number.
          </ResponseField>

          <ResponseField name="hide" type="integer">
            Reserved for the later hide head. Must be 0 or left out.
          </ResponseField>

          <ResponseField name="deletion" type="integer">
            Reserved for the later deletion head. Must be 0 or left out.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="note" type="string | null">
        The note sent with the weights, or `null`.
      </ResponseField>

      <ResponseField name="set_at" type="string" required>
        When the weights were accepted.
      </ResponseField>

      <ResponseField name="first_cycle_time" type="string" required>
        The first cycle the weights applied to.
      </ResponseField>
    </Expandable>
  </ResponseField>

  ***
</div>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://rtb.example.com/v1/weights" \
    --header "Authorization: <api-key>"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://rtb.example.com/v1/weights",
      headers={"Authorization": "<api-key>"},
  )
  weights = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://rtb.example.com/v1/weights", {
    headers: { Authorization: "<api-key>" },
  });
  const weights = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 — current and previous theme={null}
  {
    "current": {
      "version": "w-2",
      "weights": {
        "views": 1,
        "comments": 0.5,
        "up": 0.25,
        "downvote_share": 0.5
      },
      "note": "add comments and up-votes",
      "set_at": "2026-09-30T03:00:00+09:00",
      "first_cycle_time": "2026-09-30T03:05:00+09:00"
    },
    "previous": {
      "version": "w-1",
      "weights": {
        "views": 1,
        "comments": 0,
        "up": 0,
        "downvote_share": 0
      },
      "note": "first trial: views only",
      "set_at": "2026-09-29T02:02:11+09:00",
      "first_cycle_time": "2026-09-29T02:05:00+09:00"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json GET /v1/weights
openapi: 3.0.3
info:
  title: DCinside RTB API
  description: >-
    Publish scores for DCinside's Real-Time Best candidate pool. DCinside makes
    one call per five-minute cycle and reads the scores in the response. Version
    1 is a proposal for the technical exchange with DCinside: calls, field names
    and limits can change until both sides agree.
  version: 1.0.0
servers:
  - url: https://{host}
    description: Issued by Surf together with the API key.
    variables:
      host:
        default: rtb.example.com
        description: >-
          Host name issued by Surf for the environment (rehearsal or
          production). The default is a placeholder.
security:
  - ApiKey: []
tags:
  - name: Scoring
    description: One call per five-minute cycle, and re-reading a stored cycle.
  - name: Images
    description: Post images, uploaded once per post, separately from scoring.
  - name: Outcomes
    description: Not in MVP scope. How placed posts performed. Used for learning.
  - name: Weights
    description: Not in MVP scope. The weights of the publish score.
  - name: Health
    description: Service state.
paths:
  /v1/weights:
    get:
      tags:
        - Weights
      summary: Get Weights
      description: Not in MVP scope. The weights in force and the version before them.
      operationId: getWeights
      responses:
        '200':
          description: Current and previous weights.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeightsState'
              example:
                current:
                  version: w-2
                  weights:
                    views: 1
                    comments: 0.5
                    up: 0.25
                    downvote_share: 0.5
                  note: add comments and up-votes
                  set_at: '2026-09-30T03:00:00+09:00'
                  first_cycle_time: '2026-09-30T03:05:00+09:00'
                previous:
                  version: w-1
                  weights:
                    views: 1
                    comments: 0
                    up: 0
                    downvote_share: 0
                  note: 'first trial: views only'
                  set_at: '2026-09-29T02:02:11+09:00'
                  first_cycle_time: '2026-09-29T02:05:00+09:00'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    WeightsState:
      type: object
      properties:
        current:
          $ref: '#/components/schemas/WeightsRecord'
        previous:
          allOf:
            - $ref: '#/components/schemas/WeightsRecord'
          nullable: true
          description: The version before the current one, or `null` if there is none.
      required:
        - current
        - previous
    WeightsRecord:
      type: object
      properties:
        version:
          type: string
          example: w-1
          description: Weights version.
        weights:
          $ref: '#/components/schemas/WeightSet'
        note:
          type: string
          nullable: true
          example: 'first trial: views only'
          description: The note sent with the weights, or `null`.
        set_at:
          type: string
          format: date-time
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+09:00$
          description: When the weights were accepted.
          example: '2026-09-29T02:02:11+09:00'
        first_cycle_time:
          type: string
          format: date-time
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:[0-5][05]:00\+09:00$
          description: The first cycle the weights applied to.
          example: '2026-09-29T02:05:00+09:00'
      required:
        - version
        - weights
        - set_at
        - first_cycle_time
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
        - error
    WeightSet:
      type: object
      properties:
        views:
          type: number
          minimum: 0
          maximum: 10
          example: 1
          description: Weight on `p_views`.
        comments:
          type: number
          minimum: 0
          maximum: 10
          example: 0
          description: Weight on `p_comments`.
        up:
          type: number
          minimum: 0
          maximum: 10
          example: 0
          description: Weight on `p_up`.
        downvote_share:
          type: number
          minimum: 0
          maximum: 10
          example: 0
          description: >-
            Weight on the predicted down-vote share. It is subtracted, so send
            it as a positive number.
        hide:
          type: integer
          enum:
            - 0
          example: 0
          description: Reserved for the later hide head. Must be 0 or left out.
        deletion:
          type: integer
          enum:
            - 0
          example: 0
          description: Reserved for the later deletion head. Must be 0 or left out.
      required:
        - views
        - comments
        - up
        - downvote_share
      description: >-
        Publish-score weights. At least one of `views`, `comments` and `up` must
        be above 0.
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: bad_request
          description: Machine-readable code. See Errors.
        message:
          type: string
          example: 2 fields failed validation
          description: Human-readable summary.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ErrorField'
          description: Every failing field, when the error is about the body.
      required:
        - code
        - message
    ErrorField:
      type: object
      properties:
        path:
          type: string
          example: candidates[0].created_at
          description: Path of the failing field.
        problem:
          type: string
          example: missing +09:00 offset
          description: What is wrong with it.
      required:
        - path
        - problem
  responses:
    Unauthorized:
      description: The API key is missing or unknown.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: API key missing or unknown
    Forbidden:
      description: The key has no scope for this call.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: this key cannot call PUT /v1/weights
    RateLimited:
      description: >-
        Too many calls. Wait for `Retry-After` seconds, then repeat the same
        call.
      headers:
        Retry-After:
          description: Seconds to wait.
          schema:
            type: integer
            example: 10
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: too many calls, retry in 10 s
    ServerError:
      description: Our failure. No scores. DCinside skips the cycle and our alert fires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: server_error
              message: internal error
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        The API key issued for the environment, sent as the whole header value.
        Two keys are valid during a rotation.

````