Get how every fund is allocated across sectors, as decimals, the largest weights of the first fund first. This shows whether a fund that looks broad is in fact concentrated in a few sectors, such as technology in many large-cap indices.

Tickers that are not an ETF or fund return no data. They are not removed from the Toolkit instance.

Also known as: sector allocation, sector exposure, sector breakdown.

Sector Weightings in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_sector_weightings as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["QQQ", "VTI"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.etf.get_sector_weightings()

Or, after setting up the Finance Toolkit MCP, ask:

How are the Invesco QQQ Trust and the Vanguard Total Stock Market ETF (VTI) spread over the sectors?

Which returns:

Sector QQQ VTI
Technology 0.603104 0.365041
Communication Services 0.117791 0.086689
Consumer Cyclical 0.098732 0.089865
Consumer Defensive 0.057355 0.042514
Industrials 0.055378 0.088185
Healthcare 0.036579 0.099808
Utilities 0.010639 0.019731
Basic Materials 0.009198 0.022242
Cash & Others 0.004737 0.001929
Energy 0.004538 0.037377
Financial Services 0.001949 0.123878
Real Estate 0 0.022741

Parameters

get_sector_weightings accepts the following parameters.

ParameterTypeDescriptionExample
overwriteboolWhether to retrieve the weightings again. Defaults to False.True
Share