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

# 历史财务指标

> 获取历史财务指标



## OpenAPI

````yaml openapi/zh/openapi-financial.json GET /financial-metrics
openapi: 3.0.1
info:
  title: Financial Datasets API
  description: 股票市场 API，提供超过 30 年、涵盖 30,000 多个股票代码的实时和历史金融数据，包括财务报表、股票价格、内部人士交易、SEC 申报文件等。
  version: 1.0.0
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    name: API Support
    url: https://financialdatasets.ai/support
    email: support@financialdatasets.ai
  termsOfService: https://financialdatasets.ai/terms
servers:
  - url: https://api.aisa.one/apis/v1/financial
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Financial Statements
    description: Access to income statements, balance sheets, and cash flow statements
  - name: Market Data
    description: Real-time and historical price data
  - name: Company Information
    description: Company facts like ticker, name, and description
  - name: Earnings
    description: Earnings press releases and related data
  - name: Crypto
    description: Cryptocurrency price data and market information
  - name: News
    description: Real-time and historical news articles
  - name: SEC Filings
    description: SEC filings and regulatory documents
  - name: Insider Trades
    description: Insider trading activity and transactions
  - name: Institutional Ownership
    description: Equity holdings of investment managers
  - name: Financial Metrics
    description: Financial ratios, metrics, and key performance indicators
paths:
  /financial-metrics:
    get:
      tags:
        - Financial Metrics
      summary: 获取财务指标
      description: 获取某个股票代码的财务指标，包括估值、盈利能力、效率、流动性、杠杆、增长和每股指标。
      operationId: getFinancialMetrics
      parameters:
        - name: ticker
          in: query
          description: 公司的股票代码。如果未提供 cik，则此项为必填。
          required: false
          schema:
            type: string
        - name: cik
          in: query
          description: 公司的中央索引键（CIK）。可代替 ticker 使用。
          required: false
          schema:
            type: string
        - name: period
          in: query
          description: 财务数据的时间段。
          required: true
          schema:
            type: string
            enum:
              - annual
              - quarterly
              - ttm
        - name: limit
          in: query
          description: 要返回的最大结果数量。
          required: false
          schema:
            type: integer
        - $ref: '#/components/parameters/ReportPeriod'
        - $ref: '#/components/parameters/ReportPeriodGte'
        - $ref: '#/components/parameters/ReportPeriodLte'
        - $ref: '#/components/parameters/ReportPeriodGt'
        - $ref: '#/components/parameters/ReportPeriodLt'
      responses:
        '200':
          description: 某个 ticker 的历史财务指标和比率
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinancialMetricsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/PaymentRequiredError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    ReportPeriod:
      name: report_period
      in: query
      description: 按 YYYY-MM-DD 格式的确切报告期日期筛选。
      required: false
      schema:
        type: string
        format: date
    ReportPeriodGte:
      name: report_period_gte
      in: query
      description: 筛选报告期大于或等于 YYYY-MM-DD 格式指定日期的数据。
      required: false
      schema:
        type: string
        format: date
    ReportPeriodLte:
      name: report_period_lte
      in: query
      description: 筛选报告期小于或等于 YYYY-MM-DD 格式指定日期的数据。
      required: false
      schema:
        type: string
        format: date
    ReportPeriodGt:
      name: report_period_gt
      in: query
      description: 按报告周期筛选，报告周期须晚于 YYYY-MM-DD 格式的日期。
      required: false
      schema:
        type: string
        format: date
    ReportPeriodLt:
      name: report_period_lt
      in: query
      description: 筛选报告周期早于指定日期的报告，日期格式为 YYYY-MM-DD。
      required: false
      schema:
        type: string
        format: date
  schemas:
    FinancialMetricsResponse:
      type: object
      properties:
        financial_metrics:
          type: array
          items:
            $ref: '#/components/schemas/FinancialMetric'
          description: 所请求股票代码的历史财务指标和比率。
    FinancialMetric:
      type: object
      properties:
        ticker:
          type: string
          description: 公司的股票代码。
        market_cap:
          type: number
          description: 公司的市值。
        enterprise_value:
          type: number
          description: 公司的总价值（市值 + 债务 - 现金）。
        price_to_earnings_ratio:
          type: number
          description: 市盈率。
        price_to_book_ratio:
          type: number
          description: 市净率。
        price_to_sales_ratio:
          type: number
          description: 市销率。
        enterprise_value_to_ebitda_ratio:
          type: number
          description: 企业价值与 EBITDA 的比率。
        enterprise_value_to_revenue_ratio:
          type: number
          description: 企业价值与营收之比。
        free_cash_flow_yield:
          type: number
          description: 自由现金流收益率。
        peg_ratio:
          type: number
          description: 市盈增长比率。
        gross_margin:
          type: number
          description: 毛利润占营收的百分比。
        operating_margin:
          type: number
          description: 营业收入占营收的百分比。
        net_margin:
          type: number
          description: 净利润占收入的百分比。
        return_on_equity:
          type: number
          description: 净利润占股东权益的百分比。
        return_on_assets:
          type: number
          description: 净利润占总资产的百分比。
        return_on_invested_capital:
          type: number
          description: 税后净营业利润占投入资本的百分比。
        asset_turnover:
          type: number
          description: 营收除以平均总资产。
        inventory_turnover:
          type: number
          description: 销售成本除以平均存货。
        receivables_turnover:
          type: number
          description: 收入除以平均应收账款。
        days_sales_outstanding:
          type: number
          description: 该期间的平均应收账款除以收入。
        operating_cycle:
          type: number
          description: 存货周转率 + 应收账款周转率。
        working_capital_turnover:
          type: number
          description: 收入除以平均营运资本。
        current_ratio:
          type: number
          description: 流动资产除以流动负债。
        quick_ratio:
          type: number
          description: 速动资产除以流动负债。
        cash_ratio:
          type: number
          description: 现金及现金等价物除以流动负债。
        operating_cash_flow_ratio:
          type: number
          description: 经营现金流除以流动负债。
        debt_to_equity:
          type: number
          description: 总债务除以股东权益。
        debt_to_assets:
          type: number
          description: 总债务除以总资产。
        interest_coverage:
          type: number
          description: EBIT 除以利息支出。
        revenue_growth:
          type: number
          description: 营收同比增长率。
        earnings_growth:
          type: number
          description: 盈利同比增长率。
        book_value_growth:
          type: number
          description: 账面价值同比增长率。
        earnings_per_share_growth:
          type: number
          description: 该期间内每股收益的增长。
        free_cash_flow_growth:
          type: number
          description: 该期间内自由现金流的增长。
        operating_income_growth:
          type: number
          description: 该期间的营业利润增长额。
        ebitda_growth:
          type: number
          description: 期内 EBITDA 增长。
        payout_ratio:
          type: number
          description: 已支付股息占净利润的百分比。
        earnings_per_share:
          type: number
          description: 净利润除以加权平均流通股数。
        book_value_per_share:
          type: number
          description: 股东权益除以流通股数。
        free_cash_flow_per_share:
          type: number
          description: 自由现金流除以流通股数。
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: 简短的错误消息。
        message:
          type: string
          description: 更详细的错误消息。
  responses:
    BadRequestError:
      description: 错误请求
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Bad Request
            message: Invalid request parameters
    UnauthorizedError:
      description: 未授权
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized
            message: Invalid API key provided
    PaymentRequiredError:
      description: 该请求需要付费订阅
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Payment Required
            message: >-
              This endpoint requires a paid subscription. Please upgrade your
              plan.
    NotFoundError:
      description: 未找到指定的资源
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Not Found
            message: Ticker XXXX not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````