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

# Trailing Twelve Month Financials

> Rolling TTM financials, computed from the 4 most recent discrete quarters.

This endpoint returns trailing-twelve-month (TTM) financials, computed by summing the 4 most recent discrete quarters on file. It's shaped a little differently from the other financials endpoints: by default it returns a single rolling snapshot, not a list of filed reporting periods, since TTM means "the last four quarters as of right now," not a specific period a company filed.

The income statement and cash flow sections are genuine sums across the 4 quarters. The balance sheet section is **not** summed, it's just the latest quarter's snapshot, since assets and liabilities don't add across periods the way revenue or cash flow does. Ratios are computed from the summed flow figures against that latest balance sheet.

Pass `limit` to get a rolling window of TTM snapshots instead of just the latest one. This is useful for charting a smoothed trend, TTM revenue at each of the last 8 quarter-ends, for example, without the seasonal noise you'd get from raw quarterly figures. Each snapshot includes `quarters_included`, listing exactly which 4 quarters were summed, so if a company has a gap in its reporting history you'll see it rather than get a silently wrong number.

This endpoint needs 4 consecutive discrete quarters on file (`Q1`–`Q4`, not cumulative 9M or H1 figures) to compute anything. Companies without that history return a `404` rather than a fallback built from annual figures, which wouldn't actually be trailing twelve months.

For example, to fetch the latest TTM snapshot for Nestlé Nigeria:

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm" \
    -H "Authorization: Bearer ngm_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm', {
    headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' },
  });
  const { data } = await res.json();
  const latest = data.data[0];
  // latest.income_statement_ttm.revenue — trailing 12 month revenue
  // latest.quarters_included           — which 4 quarters were summed
  ```

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

  res = requests.get(
      'https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm',
      headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
  )
  data = res.json()['data']
  ```
</CodeGroup>

To chart a rolling TTM revenue trend over the last two years of quarter-ends:

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm?limit=8" \
    -H "Authorization: Bearer ngm_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  const url = new URL('https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm');
  url.searchParams.set('limit', '8');

  const res = await fetch(url, {
    headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' },
  });
  const { data } = await res.json();
  // data.data — 8 rolling TTM snapshots, most recent first
  ```

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

  res = requests.get(
      'https://api.ngnmarket.com/v1/companies/NESTLE/financials/ttm',
      params={'limit': 8},
      headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
  )
  data = res.json()['data']
  ```
</CodeGroup>

This endpoint requires a Business plan or higher.


## OpenAPI

````yaml GET /companies/{symbol}/financials/ttm
openapi: 3.1.0
info:
  title: NGN Market API
  version: '1.0'
  description: >
    The NGN Market API provides programmatic access to Nigerian Exchange Group
    (NGX) market data, including equities, forex rates, company profiles,
    indices, bonds, and financial news.


    ## Base URL


    All endpoints are served from:


    ```

    https://api.ngnmarket.com/v1

    ```


    ## Authentication


    Every request requires a Bearer token in the `Authorization` header:


    ```

    Authorization: Bearer ngm_live_YOUR_KEY

    ```


    Generate and manage your API keys from the [developer
    dashboard](https://ngnmarket.com/developer).


    ## Plans & Quotas


    | Plan | Monthly Calls | Requests/min | Price |

    | :--- | ---: | ---: | :--- |

    | Free | 3,000 | 30 | Free |

    | Hobby | 10,000 | 60 | ₦15,000/mo |

    | Starter | 100,000 | 120 | ₦50,000/mo |

    | Pro | 250,000 | 120 | ₦100,000/mo |

    | Business | 2,000,000 | 300 | ₦300,000/mo |

    | Enterprise | Unlimited | Unlimited | Custom |


    Every response includes a `meta` object showing your current usage and
    remaining quota. Exceeding the per-minute rate limit returns `429
    RATE_LIMITED`. Exceeding the monthly quota returns `429 QUOTA_EXCEEDED`.


    ## Response Envelope


    All responses use a consistent JSON envelope:


    ```json

    {
      "success": true,
      "data": { ... },
      "meta": {
        "plan": "starter",
        "calls_used": 4821,
        "calls_remaining": 95179,
        "reset_at": "2026-05-15T23:57:00.000Z"
      }
    }

    ```
  contact:
    name: NGN Market Support
    email: support@ngnmarket.com
    url: https://ngnmarket.com
  license:
    name: Proprietary
servers:
  - url: https://api.ngnmarket.com/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Market
    description: >-
      Daily market snapshots, top trades, movers, market breadth, sectors, and
      YTD performers.
  - name: Companies
    description: >-
      Browse, search, and retrieve profiles, price charts, and financial
      statements for NGX-listed companies.
  - name: Forex
    description: Current and historical NGN exchange rates against major currencies.
  - name: Indices
    description: >-
      All NGX market indices, including list, detail with constituents, and
      historical chart data.
  - name: ETFs
    description: >-
      NGX-listed Exchange Traded Funds and ETPs — list, full fund detail, and
      historical daily price data.
  - name: Bonds
    description: >-
      NGX-listed bond instruments with issuer details, coupon rates, and
      maturity dates.
  - name: Disclosures
    description: >-
      Official corporate filings from NGX-listed companies (financial
      statements, AGM notices, board meetings, director dealings, earnings
      forecasts). Sourced from NGX Group and updated twice daily.
  - name: Blog
    description: >-
      Published NGN Market blog posts. List, search, and filter by category or
      company.
  - name: Dividends
    description: >-
      Market-wide NGX dividend calendar. Browse upcoming and recently paid
      dividends across all listed companies with optional search and pagination.
  - name: Account
    description: >-
      Quota status, 30-day request analytics, and paginated request logs for the
      authenticated user.
paths:
  /companies/{symbol}/financials/ttm:
    get:
      tags:
        - Companies
      summary: Trailing twelve month financials
      description: >
        Returns trailing-twelve-month (TTM) financials, computed by summing the
        4 most recent discrete quarters on file. Unlike the other financials
        endpoints, this one returns a single rolling snapshot by default, not a
        list of filed reporting periods, since TTM represents "the last four
        quarters as of now," not a specific filed period.


        The income statement and cash flow sections are genuine sums across the
        4 quarters. The balance sheet section is **not** summed, it's the latest
        quarter's snapshot, since assets and liabilities don't add across
        periods. Ratios are computed from the summed flow figures against that
        latest balance sheet.


        Pass `limit` to get a rolling window of TTM snapshots instead of just
        the latest one, useful for charting a smoothed trend (e.g. TTM revenue
        at each of the last 8 quarter-ends) without seasonal noise. Each
        snapshot lists exactly which 4 quarters were summed in
        `quarters_included`, so gaps in reporting are visible rather than
        hidden.


        Requires 4 consecutive discrete quarters on file (`Q1`–`Q4`, not
        cumulative 9M/H1 figures). Companies without that history return `404`.


        **Plan required:** Business
      operationId: getCompanyTTMFinancials
      parameters:
        - name: symbol
          in: path
          description: NGX ticker symbol (e.g. `GTCO`). Case-insensitive.
          required: true
          schema:
            type: string
            example: NESTLE
        - name: limit
          in: query
          description: Number of rolling TTM snapshots to return, most recent first (1–40).
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 40
            default: 1
      responses:
        '200':
          description: TTM financials retrieved successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          data:
                            type: array
                            items:
                              $ref: '#/components/schemas/TTMFinancialSnapshot'
                          count:
                            type: integer
                            example: 1
              examples:
                ttm:
                  summary: Latest TTM snapshot for NESTLE
                  value:
                    success: true
                    data:
                      data:
                        - as_of: Q4 2025
                          quarters_included:
                            - Q4 2025
                            - Q3 2025
                            - Q2 2025
                            - Q1 2025
                          currency: NGN
                          income_statement_ttm:
                            revenue: 1207773081000
                            net_income: 104966001000
                            eps_basic: 132.42
                            eps_diluted: 132.42
                          cash_flow_ttm:
                            net_cash_operating: 362778896000
                            free_cash_flow: 265796451000
                            dividends_paid: -1491065000
                          balance_sheet:
                            total_assets: 680000000000
                            shareholders_equity: 1420000000000
                          ratios_ttm:
                            gross_margin: 0.3609
                            return_on_equity: 0.0739
                      count: 1
                    meta:
                      plan: business
                      calls_used: 1208
                      calls_remaining: 498792
                      reset_at: '2026-05-15T23:57:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PlanRequired'
        '404':
          description: Not enough consecutive discrete quarters on file for this symbol.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: >-
                    No trailing-twelve-month data found for 'UNKNOWN' (needs 4
                    consecutive discrete quarters on file).
        '429':
          $ref: '#/components/responses/QuotaExceeded'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          const: true
        meta:
          $ref: '#/components/schemas/Meta'
    TTMFinancialSnapshot:
      type: object
      description: >-
        One rolling trailing-twelve-month snapshot. Income statement and cash
        flow are summed across 4 quarters; the balance sheet is a point-in-time
        snapshot of the latest quarter, not summed.
      properties:
        as_of:
          type: string
          description: The most recent quarter in this window (e.g. Q4 2025).
        quarters_included:
          type: array
          description: >-
            The 4 discrete quarters summed into this snapshot, most recent
            first. Check this if you suspect a gap in reporting.
          items:
            type: string
          example:
            - Q4 2025
            - Q3 2025
            - Q2 2025
            - Q1 2025
        currency:
          type: string
          description: ISO 4217 currency code (typically NGN).
        income_statement_ttm:
          type: object
          description: Sum of the 4 quarters in quarters_included.
          properties:
            revenue:
              type: number
            cost_of_sales:
              type: number
            gross_profit:
              type: number
            operating_expenses:
              type: number
            operating_income:
              type: number
            interest_income:
              type: number
            interest_expense:
              type: number
            pretax_income:
              type: number
            income_tax_expense:
              type: number
            net_income:
              type: number
            eps_basic:
              type: number
            eps_diluted:
              type: number
        cash_flow_ttm:
          type: object
          description: Sum of the 4 quarters in quarters_included.
          properties:
            net_cash_operating:
              type: number
            net_cash_investing:
              type: number
            net_cash_financing:
              type: number
            capital_expenditure:
              type: number
            free_cash_flow:
              type: number
            dividends_paid:
              type: number
        balance_sheet:
          type: object
          description: Not summed — the latest quarter's balance sheet only.
          properties:
            cash_and_equivalents:
              type: number
            current_assets:
              type: number
            total_assets:
              type: number
            current_liabilities:
              type: number
            total_liabilities:
              type: number
            shareholders_equity:
              type: number
        ratios_ttm:
          type: object
          description: >-
            Computed from the TTM income/cash-flow figures against the latest
            balance sheet. Values are null when inputs are unavailable.
          properties:
            gross_margin:
              type: number
              nullable: true
            operating_margin:
              type: number
              nullable: true
            net_profit_margin:
              type: number
              nullable: true
            return_on_equity:
              type: number
              nullable: true
            return_on_assets:
              type: number
              nullable: true
            current_ratio:
              type: number
              nullable: true
            debt_to_equity:
              type: number
              nullable: true
            interest_coverage:
              type: number
              nullable: true
            free_cash_flow_margin:
              type: number
              nullable: true
            bvps:
              type: number
              nullable: true
            fcfps:
              type: number
              nullable: true
            revenue_per_share:
              type: number
              nullable: true
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error identifier.
              example: NOT_FOUND
            message:
              type: string
              description: Human-readable error description.
              example: Resource not found.
            required_plan:
              type: string
              description: _(PLAN_REQUIRED only)_ Minimum plan needed.
            current_plan:
              type: string
              description: _(PLAN_REQUIRED only)_ Your current plan.
    Meta:
      type: object
      description: Quota and plan metadata included on every authenticated response.
      properties:
        plan:
          type: string
          description: Current plan name.
          enum:
            - free
            - hobby
            - starter
            - pro
            - business
            - enterprise
          example: starter
        calls_used:
          type: integer
          description: Total calls made this calendar month across all your keys.
          example: 4821
        calls_remaining:
          type: integer
          description: Calls remaining before your quota is exhausted.
          example: 95179
        reset_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 UTC timestamp of your next quota reset (your account's
            billing renewal date, not the calendar month start).
          example: '2026-06-15T23:57:00.000Z'
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missingKey:
              summary: Missing Authorization header
              value:
                success: false
                error:
                  code: MISSING_API_KEY
                  message: 'Provide your API key via: Authorization: Bearer <key>'
            invalidKey:
              summary: Invalid or revoked key
              value:
                success: false
                error:
                  code: INVALID_API_KEY
                  message: API key not found or revoked.
    PlanRequired:
      description: Endpoint requires a higher plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              code: PLAN_REQUIRED
              message: This endpoint requires a starter plan or higher.
              required_plan: starter
              current_plan: free
    QuotaExceeded:
      description: Monthly call limit reached.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - type: object
                properties:
                  meta:
                    $ref: '#/components/schemas/Meta'
          example:
            success: false
            error:
              code: QUOTA_EXCEEDED
              message: >-
                Monthly call limit of 100,000 reached. Resets on
                2026-05-01T00:00:00.000Z.
            meta:
              plan: starter
              calls_used: 100000
              calls_remaining: 0
              reset_at: '2026-05-15T23:57:00.000Z'
    ServerError:
      description: Unexpected server-side failure. Safe to retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              code: SERVER_ERROR
              message: Something went wrong on our end. Please try again.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ngm_live_*
      description: >
        Pass your API key as a Bearer token: `Authorization: Bearer
        ngm_live_YOUR_KEY`.

        Generate keys at
        [ngnmarket.com/dashboard/developer](https://ngnmarket.com/developer).

````