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

# Historical Revenue Breakdown

> Show historical revenue amounts and percentages by business or region.

## Plan Access

| Plan | Available |
| - | :-: |
| Free | ❌ |
| Starter | ❌ |
| Professional | ✅ |
| Full-Market Plans (A-Shares, HK Stocks, US Stocks) | ✅ |
| Enterprise | ✅ |

## Notes

* Available historical reporting periods vary by company. A structured `404` may be returned when no records match.

## Supported Markets

| Market | Examples |
| - | - |
| US Stocks | AAPL.US |
| HK Stocks | 700.HK |
| A-Shares | 600519.SH |

## Request Parameters

| Parameter | Required | Description |
| - | :-: | - |
| `symbol` | Yes | Stock symbol |
| `type` | No | Product type; currently supports `stock` |
| `category` | No | Breakdown dimension: `business` for business segments or `regional` for geographic segments. Omit to return all available dimensions. |
| `report` | No | Reporting period: `qf` quarterly, `saf` semiannual, or `af` annual |
| `limit` | No | Number of records; default 200, range `1–1000` |

## Request Example

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/fundamentals/segments/history?symbol=AAPL&type=stock&category=business&limit=200"
```

## Response Fields

The table below lists fields in `data`; an outer `code=0` indicates success.

| Field | Description |
| - | - |
| symbol | Stock symbol. |
| report | Requested reporting period: `qf` quarterly, `saf` semiannual, or `af` annual; may be `null` when not specified. |
| segments | Revenue breakdowns for historical reporting periods. |
| └─ segment\_name | Business segment or region name. |
| └─ category | Breakdown dimension: `business` by business or `regional` by region. |
| └─ value | Revenue amount for the business segment or region. |
| └─ total\_revenue | Total revenue for the reporting period. |
| └─ percent | Percentage of total period revenue, for example `79.74` means 79.74%. |
| └─ currency | Amount currency. |
| └─ report | Row reporting period: `qf` quarterly, `saf` semiannual, or `af` annual. |
| └─ period\_start | Period start date in `YYYY-MM-DD` format. |
| └─ period\_end | Period end date in `YYYY-MM-DD` format. |

Each row represents a business segment or region in one reporting period. A structured `404` may be returned when no data matches the filters.


## OpenAPI

````yaml openapi.en.yaml GET /v1/fundamentals/segments/history
openapi: 3.1.0
info:
  title: TickDB API
  description: TickDB unified real-time market data API via REST and WebSocket.
  version: 1.0.3
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/fundamentals/segments/history:
    get:
      tags:
        - fundamentals-financials
      summary: Historical Revenue Breakdown
      description: Show historical revenue amounts and percentages by business or region.
      operationId: getFundamentalsSegmentsHistory
      parameters:
        - $ref: '#/components/parameters/SymbolQuery'
        - $ref: '#/components/parameters/TypeQuery'
        - $ref: '#/components/parameters/SegmentCategoryQuery'
        - $ref: '#/components/parameters/ReportQuery'
        - $ref: '#/components/parameters/SegmentLimitQuery'
      responses:
        '200':
          $ref: '#/components/responses/SegmentsResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    SymbolQuery:
      name: symbol
      in: query
      required: true
      schema:
        type: string
        examples:
          - AAPL
          - '700'
          - '600519'
          - AAPL.US
          - 700.HK
          - 600519.SH
      description: Stock symbol
    TypeQuery:
      name: type
      in: query
      required: false
      schema:
        type: string
        enum:
          - stock
      description: Product type; currently supports `stock`
    SegmentCategoryQuery:
      name: category
      in: query
      required: false
      schema:
        type: string
        enum:
          - business
          - regional
      description: >-
        Breakdown dimension: `business` for business segments or `regional` for
        geographic segments. Omit to return all available dimensions.
    ReportQuery:
      name: report
      in: query
      required: false
      schema:
        type: string
        examples:
          - qf
          - saf
          - af
      description: 'Reporting period: `qf` quarterly, `saf` semiannual, or `af` annual'
    SegmentLimitQuery:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 200
      description: Number of records; default 200, range `1–1000`
  responses:
    SegmentsResponse:
      description: Historical Revenue Breakdown response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SegmentsEnvelope'
    ErrorResponse:
      description: >-
        Error response. Common HTTP statuses include 400 (invalid parameters),
        401 (authentication failed), 403 (permission or quota restriction), 404
        (no matching data), 429 (rate limit), and 503 (service temporarily
        unavailable).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missingAPIKey:
              summary: Missing API key
              value:
                code: '1002'
                message: API key is required. Provide via X-API-Key header
                error: '1002'
            missingKind:
              summary: Missing required parameter
              value:
                code: 40001
                message: kind is required
                data: null
            endpointForbidden:
              summary: API key cannot access this endpoint
              value:
                code: 3009
                message: This endpoint is not allowed for your API key
                data: null
            marketForbidden:
              summary: API key cannot access this market
              value:
                code: 3010
                message: Fundamentals market not allowed for your API key
                data:
                  market: US
            noAvailableSource:
              summary: Data temporarily unavailable
              value:
                code: 5003
                message: Data is temporarily unavailable
                data: null
            notFound:
              summary: No matching data
              value:
                code: 40404
                message: shareholder detail not found
                data: null
            businessNoData:
              summary: No business data matches the query
              value:
                code: 40405
                message: valuation time series not found
                data: null
  schemas:
    SegmentsEnvelope:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/SegmentsData'
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: >-
            TickDB API business error code; may be an integer or string. Convert
            it to a string before comparing.
          oneOf:
            - type: integer
            - type: string
        message:
          type: string
          description: Error description.
        error:
          type: string
          description: >-
            Compatibility error identifier; present only in some error
            responses.
        data:
          description: Optional error context; may be null, an object, or an array.
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: true
            - type: array
              items: {}
    SuccessEnvelope:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          const: 0
          description: Business status code; `0` means success.
    SegmentsData:
      type: object
      required:
        - symbol
        - segments
      properties:
        symbol:
          type: string
          description: Stock symbol.
        report:
          type:
            - string
            - 'null'
          description: >-
            Requested reporting period: `qf` quarterly, `saf` semiannual, or
            `af` annual; may be `null` when not specified.
        segments:
          type: array
          description: Revenue breakdowns for historical reporting periods.
          items:
            $ref: '#/components/schemas/SegmentItem'
      additionalProperties: true
    SegmentItem:
      type: object
      required:
        - report
        - category
        - segment_name
        - period_start
        - period_end
        - value
      properties:
        report:
          type: string
          description: 'Reporting period: `qf` quarterly, `saf` semiannual, or `af` annual.'
        category:
          type: string
          description: 'Breakdown dimension: `business` by business or `regional` by region.'
        segment_name:
          type: string
          description: Business segment or region name.
        period_start:
          type: string
          format: date
          description: Period start date in `YYYY-MM-DD` format.
        period_end:
          type: string
          format: date
          description: Period end date in `YYYY-MM-DD` format.
        total_revenue:
          type:
            - string
            - number
            - 'null'
          description: Total revenue for the reporting period.
        currency:
          type:
            - string
            - 'null'
          description: Amount currency.
        percent:
          type:
            - string
            - number
            - 'null'
          description: >-
            Percentage of total period revenue, for example `79.74` means
            79.74%.
        value:
          type:
            - string
            - number
            - 'null'
          description: Revenue amount for the business segment or region.
      additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.