Jaime López

Data Science Systems Developer

Yahoo Finance in the Terminal

Feb. 04, 2026

Every day, I make it a habit to check Bitcoin prices and other financial indices. Until recently, my routine involved opening a browser tab, navigating to a financial data website, reviewing prices and their movements, and then closing the tab. I've always wanted a simpler way to access this information, especially from the terminal—which is where I spend most of my time when working.

Through my work, which involves implementing trading strategies and building financial data connectors, I'm familiar with several APIs that provide market data. So I've long had the idea of creating a command-line tool that would let me access one of these APIs, fetch the data I'm interested in, and display it in the terminal.

One of those APIs, widely known and used in the industry, is Yahoo Finance (YF). In addition to its paid services, YF offers a free endpoint for accessing historical data, daily quotes, and certain technical indicators. Moreover, from conversations with some of my clients, I know that YF is recognized as a reliable source of financial data. All of this makes it an attractive choice for my command-line tool.

With these ideas in mind, I've taken the time to write a command-line tool called yf, which allows me to interact with the Yahoo Finance API directly from the terminal. So now, instead of opening a browser, I can simply type commands in the terminal to get the information I need. Here are some examples of how to use the tool:

$ yf history -s btc-USD
Date              Open        High         Low       Close           Volume
----------  ----------  ----------  ----------  ----------  ---------------
2026-01-27   $89104.05   $90439.29   $88721.46   $89184.57   39,807,419,296
2026-01-28   $89169.85   $89200.78   $83250.60   $84561.59   64,653,083,162
2026-01-29   $84562.73   $84602.16   $81071.48   $84128.66   72,083,816,087
2026-01-30   $84126.50   $84136.92   $75815.88   $78621.12   70,479,259,159
2026-01-31   $78626.12   $79322.61   $75698.90   $76974.45   53,372,509,744
2026-02-01   $76968.88   $79258.61   $74551.34   $78688.77   75,140,589,684
2026-02-02   $78693.51   $79118.85   $72897.14   $75633.55   68,249,110,822
2026-02-04   $75657.26   $76745.57   $72174.25   $72324.92   72,766,021,632

$ yf quote ^GSPC ^DJI ^IXIC
Symbol         Price      Change     Change%           Volume       Market Cap
--------  ----------  ----------  ----------  ---------------  ---------------
^GSPC       $6848.90      -68.91      -1.00%    2,450,149,000               0
^DJI       $49260.05      +19.06      +0.04%      357,843,045               0
^IXIC      $22728.40     -526.79      -2.27%    5,385,825,000               0

$ yf indicators -s=AAPL --rsi=14 --macd
Momentum:
  RSI(14):         66.59   [NEUTRAL]

MACD:
  MACD Line:          0.0605
  Signal Line:       -2.7542
  Histogram:          2.8147
  Signal:         BULLISH


$ yf history -s 'GC=F' --format json > data.json

The tool is also a library, which makes it possible to integrate it into other projects. In my case, I'm using it in a framework for evaluating algorithmic trading strategies. Overall, with this tool I've aimed to follow Unix philosophy in terms of simplicity, a preference for plain text format, and the ability to compose it with other programs.

If you're interested in learning more about this tool or trying it out, here's the link to the documentation:

https://jailop.codeberg.page/yfnim/docs

Spanish