Skip to content

To set which market is in scope. #2601

@davidghope-dev

Description

@davidghope-dev

Describe bug

It would be useful to be able to set which market is in scope.

For example, this code snippet,

sector = yf.Sector(sector_key)
top_companies_df = sector.top_companies

only works or assumes the yf.Market variable is US.

It would be better to be able to scope yf statements to any of the Yahoo Markets,
US
GB
ASIA
EUROPE

RATES
COMMODITIES
CURRENCIES
CRYPTOCURRENCIES

Simple code that reproduces your problem

For example, this code snippet,

sector = yf.Sector(sector_key)
top_companies_df = sector.top_companies

only works or assumes the yf.Market variable is US.

Debug log from yf.enable_debug_mode()

N/A

Bad data proof

No response

yfinance version

0.2.65

Python version

3.12.11

Operating system

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions