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

# ETF holdings

> Get a list of holdings in an ETF. Also provides history of changes for known dates.

<Danger>Currently returns data for top 10 holdings only</Danger>


## OpenAPI

````yaml reference/securities/securities.yaml GET /securities/etf/holdings
openapi: 3.1.0
info:
  title: Securities master reference
  description: >-
    Query general information about US stocks, including company name, sector,
    industry, market cap, financials, key trading statistics
  version: 1.0.0
servers:
  - url: https://openapi.ainvest.com/open
    description: Production environment
security:
  - bearerAuth: []
tags:
  - name: Securities
    description: Provides reference information about US stocks
    externalDocs:
      url: https://docs.ainvest.com/reference/securities
paths:
  /securities/etf/holdings:
    get:
      tags:
        - Securities
      summary: Get a list of holdings in an ETF
      description: >-
        Get a list of holdings in an ETF. Also provides history of changes for
        known dates.
      operationId: getEtfHoldings
      parameters:
        - name: ticker
          in: query
          required: true
          description: US stock market ticker symbol of the ETF, e.g. SPY, QQQ, etc.
          schema:
            type: string
        - name: from
          in: query
          required: false
          description: >-
            Start of the requested period, format YYYY-MM-DD. By default equals
            to a year ago from current date.
          schema:
            type: string
        - name: to
          in: query
          required: false
          description: >-
            End of the requested period, format YYYY-MM-DD. By default equals to
            current date.
          schema:
            type: string
      responses:
        '200':
          description: Successful response in standard envelope.
          content:
            application/json:
              schema:
                $schema: http://json-schema.org/draft-04/schema#
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            date:
                              type: string
                              description: Date of the holdings update, format YYYY-MM-DD
                            total_weight:
                              type: number
                              description: >-
                                Total weight of securities listed here, as a
                                ratio (0-1). If the value is less than 1, it
                                means that there are other securities in the ETF
                                not listed here.
                            holdings:
                              type: array
                              description: List of holdings in the ETF
                              items:
                                type: object
                                properties:
                                  ticker:
                                    type: string
                                    description: >-
                                      US stock market security. In most cases
                                      this would be a ticker symbol, e.g. AAPL,
                                      TSLA, etc. In some cases it can be an
                                      option, or arbitrary human-readable name,
                                      depending on the asset
                                  constituent_weight:
                                    type: number
                                    description: >-
                                      Weight of the security in the ETF, as a
                                      ratio (0-1). In some cases this can be a
                                      negative value, which means that the ETF
                                      is shorting this security
                  status_code:
                    type: number
                    description: Status code, `0` for success
                  status_msg:
                    type: string
                    description: Status message, `success` for success
        '400':
          description: Validation error, i.e. no stocks found or parameter is not specified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status_code: 4012
                status_msg: Invalid param
components:
  schemas:
    Error:
      type: object
      properties:
        status_code:
          type: integer
          description: Business status code
        status_msg:
          type: string
          description: Error message
      required:
        - status_code
        - status_msg
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your key. [Get the key
        here](https://www.ainvest.com/business/developer-manage/)

````