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

# Campaign Stats

> Stats for one CPC campaign.



## OpenAPI

````yaml GET /cpc/campaigns/{public_id}/stats
openapi: 3.0.3
info:
  title: OnlyTraffic Studio API
  version: 1.0.0
  description: >-
    External API for OnlyTraffic Studio. Manage and retrieve data about your
    subscribers, CPL orders, and CPC orders.
servers:
  - url: https://studio-api.onlytraffic.com/api/external/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    description: API key holder's wallet, profile, and aggregate state.
  - name: Accounts
    description: OnlyFans accounts attached to the API key holder.
  - name: Agencies
    description: Agency CRUD and image management. All edits stage in moderation.
  - name: CPL
    description: >-
      Cost-per-lead orders: place, list, cancel, manage settings, browse partner
      offers.
  - name: CPC
    description: Cost-per-click campaigns, orders and creative management.
  - name: RevShare
    description: Revenue-share campaigns and invoices.
  - name: Swaps
    description: Two-sided traffic swap orders and offers.
  - name: Subscribers
    description: Per-fan delivery feed (cursor-paginated).
  - name: Transactions
    description: Per-transaction OF revenue feed (cursor-paginated).
paths:
  /cpc/campaigns/{public_id}/stats:
    get:
      tags:
        - CPC
      summary: Campaign Stats
      description: Stats for one CPC campaign.
      operationId: getCpcCampaignStats
      parameters:
        - name: public_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z0-9_]+$
          description: >-
            Campaign public id (`cpcp_xxxxxxxx`), from `campaign_id` on `GET
            /cpc/campaigns`.
          example: cpcp_a1b2c3d4
        - name: date_from
          in: query
          schema:
            type: string
            format: date
          description: >-
            Lower bound for the `daily` and `fans_daily` series (`YYYY-MM-DD`,
            UTC, inclusive). `totals` are always lifetime.
          example: '2026-05-01'
        - name: date_to
          in: query
          schema:
            type: string
            format: date
          description: >-
            Upper bound for the `daily` and `fans_daily` series (`YYYY-MM-DD`,
            UTC, inclusive). At most 400 days after `date_from`.
          example: '2026-05-31'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/CpcCampaignStats'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Campaign not found, or not owned by your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Validation error. `range_too_wide` when `date_to` is more than 400
            days after `date_from`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Server error. Body always reads `{success:false,
            error:"server_error", message:"Server error"}` (no internal details
            leak).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CpcCampaignStats:
      type: object
      properties:
        campaign_id:
          type: string
          example: cpcp_a1b2c3d4
        totals:
          type: object
          description: >-
            Lifetime totals. Not narrowed by `date_from` / `date_to` — those
            only bound the `daily` and `fans_daily` series.
          properties:
            served:
              type: integer
              description: >-
                Ad slots the campaign was selected for, before viewability
                filtering.
              example: 520100
            impressions:
              type: integer
              example: 412330
            clicks:
              type: integer
              example: 5120
            unique_clicks:
              type: integer
              example: 4380
            suspicious_clicks:
              type: integer
              description: >-
                Clicks rejected by traffic review, counted up to yesterday. The
                current UTC day is still under review and is excluded.
              example: 61
            spend_cents:
              type: integer
              example: 24090
            budget_total_cents:
              type: integer
              example: 100000
            budget_used_pct:
              type: number
              format: float
              description: >-
                `spend_cents` as a percentage of `budget_total_cents`, capped at
                100. `0` when no total budget is set.
              example: 24.1
            fans:
              type: integer
              nullable: true
              description: >-
                Fans attributed to the campaign's tracking links. `null` when
                `has_access` is false.
              example: 214
            revenue_cents:
              type: integer
              nullable: true
              description: >-
                Revenue from those fans, in cents. `null` when `has_access` is
                false.
              example: 138750
        has_access:
          type: boolean
          description: >-
            Whether the campaign runs on a tracking link. When false, every fan
            / revenue field on this response is `null` — the data does not exist
            rather than being zero.
          example: true
        daily:
          type: array
          description: >-
            Daily series, gap-filled with zero rows so there are no holes
            between the first and last recorded day.
          items:
            type: object
            properties:
              date:
                type: string
                format: date
                example: '2026-05-04'
              impressions:
                type: integer
                example: 18240
              clicks:
                type: integer
                example: 221
              unique_clicks:
                type: integer
                example: 194
              suspicious_clicks:
                type: integer
                nullable: true
                description: >-
                  `null` on the current UTC day, which is still under traffic
                  review.
                example: 3
              spend_cents:
                type: integer
                example: 1067
        fans_daily:
          type: array
          nullable: true
          description: >-
            Fans gained per day across every tracking link of the campaign.
            `null` when `has_access` is false.
          items:
            type: object
            properties:
              date:
                type: string
                format: date
                example: '2026-05-04'
              fans:
                type: integer
                example: 11
        placements:
          type: array
          description: Per-placement split, highest spend first, up to 200 entries.
          items:
            type: object
            properties:
              key:
                type: string
                description: >-
                  Stable anonymous placement key. `direct` covers traffic with
                  no resolvable placement. Pass a key into a campaign's blocked
                  placements in Studio to exclude it.
                example: site-1f4c9ab2
              impressions:
                type: integer
                example: 90210
              clicks:
                type: integer
                example: 1180
              unique_clicks:
                type: integer
                example: 1004
              spend_cents:
                type: integer
                example: 5522
              tracked:
                type: boolean
                description: >-
                  Whether this placement has its own tracking link, which is
                  what makes `fans` / `revenue_cents` attributable to it.
                example: true
              fans:
                type: integer
                nullable: true
                description: >-
                  `null` when `tracked` is false. A tracked placement with no
                  fans yet reports `0`.
                example: 48
              revenue_cents:
                type: integer
                nullable: true
                description: '`null` when `tracked` is false.'
                example: 31200
        links:
          type: array
          description: >-
            Tracking links of the campaign, keyed the same way as `placements`
            so the two lists join on `key`.
          items:
            type: object
            properties:
              key:
                type: string
                description: >-
                  `main` for the campaign link, `site-xxxxxxxx` for a
                  per-placement link.
                example: main
              url:
                type: string
                format: uri
                example: https://onlyfans.com/action/trial/xxxxxxxx
    ErrorResponse:
      type: object
      description: Standard error envelope for all 4xx/5xx responses.
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false on error responses.
        error:
          type: string
          description: Stable snake_case machine-readable error code. Branch on this.
          example: validation_failed
        message:
          type: string
          description: >-
            Human-friendly text. For 5xx this is always the literal `Server
            error`. For 4xx an actionable validation/auth message is returned.
        details:
          type: object
          nullable: true
          description: >-
            Optional per-field diagnostic information. On 422 carries `{<field>:
            ["error_code", ...]}`. On 402 (`insufficient_balance`) carries
            `{required, current}`. On 426 (`unpaid_invoices`) carries `{count,
            total, oldest_date_ts}`. Absent on most other errors.
          additionalProperties: true
        retry_after:
          type: integer
          nullable: true
          description: >-
            Seconds until the next request will succeed. Present only on 429
            responses (rate limit). Mirrors the `Retry-After` HTTP header.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````