Yahoo Finance
Yahoo Finance price history, quotes and symbol search
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available Β· $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/yfinance/index.md to help me query Yahoo Finance with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Try it in your browser
Run a live query with no installation or account. Your browser connects to the public Yahoo Finance demo hosted by Query Farm: live quotes for three tickers, newest trade first.
Example output Β· captured
- Connector release
- v0.7.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
ATTACH 'yfinance' AS yfinance (TYPE vgi, LOCATION 'https://yfinance.vgi.query.farm');
SELECT symbol, regular_market_price AS price, regular_market_time AS as_of
FROM yfinance.main.quote('aapl,msft,goog')
ORDER BY as_of DESC;
| symbol | price | as_of |
|---|---|---|
| AAPL | 354 | 2026-11-30T21:00:01+00:00 |
| MSFT | 487.2 | 2026-11-30T21:00:01+00:00 |
| GOOG | 291.78 | 2026-11-30T21:00:01+00:00 |
Runs in your browser and attaches the public demo Query.Farm hosts on Cloudflare (yfinance.vgi.query.farm). The first run downloads the engine; the SQL shell keeps the worker attached so you can write your own queries.
Quick start
Choose where to run Yahoo Finance, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'yfinance' AS yfinance (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-yfinance'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'yfinance' AS yfinance (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-yfinance:0.7.0'
);
3. Run a query
SELECT symbol, regular_market_price AS price, regular_market_time AS as_of
FROM yfinance.main.quote('aapl,msft,goog')
ORDER BY as_of DESC
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connectorβs deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'yfinance' AS yfinance
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT symbol, regular_market_price AS price, regular_market_time AS as_of
FROM yfinance.main.quote('aapl,msft,goog')
ORDER BY as_of DESC
Query Farm operates Yahoo Finance for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use yfinance as the catalog alias for the query below.
4. Run a query
SELECT symbol, regular_market_price AS price, regular_market_time AS as_of
FROM yfinance.main.quote('aapl,msft,goog')
ORDER BY as_of DESC
Technical details
- Verified connector release
- v0.7.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until youβre ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the release directly
Uses the verified release each time you attach the connector.
ATTACH 'yfinance' AS yfinance (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'yfinance' AS yfinance (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-yfinance:0.7.0'
);
Overview
Yahoo Finance market data as DuckDB tables: history (OHLCV), quote (snapshot), search (symbol lookup) β vgi-yfinance
Yahoo Finance
Market data from Yahoo Finance's public, keyless endpoints as DuckDB table functions: OHLCV price history over a named or explicit date range, current-price snapshots (price, change, day & 52-week range, volume) for a list of tickers, and name-to-ticker resolution.
No secret or API key is required. Prices are delayed and provided for informational use only; review Yahoo's terms before redistribution. Intraday candles are only available for recent ranges.
Sources and references
- Yahoo Finance, whose unofficial, undocumented chart and search endpoints this worker reads.
- Exchanges and data providers on Yahoo Finance: per-exchange delays and data sources.
- Yahoo terms of service.
Catalog
Everything yfinance exposes once attached β read straight from the worker's
released build.
main 1 view Β· 3 functions
Yahoo Finance market data: price history, current quotes, and symbol search.
Schema examples (9)
Last month of daily candles for Apple, oldest first
SELECT timestamp, open, high, low, close, volume
FROM yfinance.main.history('AAPL')
ORDER BY timestamp;
Current price for several megacaps at once
SELECT symbol, regular_market_price
FROM yfinance.main.quote('AAPL,MSFT,GOOG')
ORDER BY symbol;
Find a ticker by company name, best matches first
SELECT symbol, long_name
FROM yfinance.main.search('vanguard')
ORDER BY score DESC, symbol;
Rank companies by three-month total return starting from their names: search resolves each name to its top-scoring EQUITY ticker, then history supplies dividend-adjusted closes (adjclose) to compute the return
WITH pick AS (SELECT c.name, s.symbol FROM (VALUES ('apple'), ('costco'), ('walmart')) c(name), LATERAL yfinance.main.search(c.name, count := 5) s WHERE s.quote_type = 'EQUITY' QUALIFY row_number() OVER (PARTITION BY c.name ORDER BY s.score DESC) = 1) SELECT p.name, p.symbol, round(100 * (arg_max(h.adjclose, h.timestamp) / arg_min(h.adjclose, h.timestamp) - 1), 2) AS total_return_3mo_pct
FROM pick p,
LATERAL yfinance.main.history(p.symbol, range := '3mo') h
GROUP BY p.name, p.symbol
ORDER BY total_return_3mo_pct DESC, p.name;
5 more examples
Look up the live price of companies you only know by name: search resolves each name to its top-scoring EQUITY ticker, then quote returns that listing's exchange, currency, price and change versus the previous close
WITH pick AS (SELECT c.name, s.symbol FROM (VALUES ('netflix'), ('tesla'), ('toyota')) c(name), LATERAL yfinance.main.search(c.name, count := 5) s WHERE s.quote_type = 'EQUITY' QUALIFY row_number() OVER (PARTITION BY c.name ORDER BY s.score DESC) = 1) SELECT p.name, q.symbol, q.long_name, q.exchange, q.currency, q.regular_market_price, round(q.regular_market_change_percent, 2) AS change_pct
FROM pick p,
LATERAL yfinance.main.quote(p.symbol) q
ORDER BY p.name;
Watchlist momentum check: compare each ticker's live quote price with the average of its daily closes over the past month from history, to see which names trade above or below their recent level
WITH q AS (SELECT symbol, regular_market_price FROM yfinance.main.quote('AAPL,MSFT,GOOG')), m AS (SELECT q.symbol, avg(h.close) AS avg_close_1mo FROM q, LATERAL yfinance.main.history(q.symbol, range := '1mo') h GROUP BY q.symbol) SELECT q.symbol, q.regular_market_price, round(m.avg_close_1mo, 2) AS avg_close_1mo, round(100 * (q.regular_market_price / m.avg_close_1mo - 1), 2) AS pct_vs_1mo_avg
FROM q
JOIN m USING (symbol)
ORDER BY pct_vs_1mo_avg DESC, q.symbol;
Price foreign listings in US dollars: quote each listing, then quote the FX pair named by its own currency column (EUR=X is euros per dollar; JPY=X, which Yahoo echoes back as USDJPY=X, is yen per dollar) and divide. London listings quote in pence (currency GBp) and would also need dividing by 100, so none is included
SELECT l.symbol, l.currency, l.regular_market_price AS local_price,
fx.symbol AS fx_pair, fx.regular_market_price AS units_per_usd,
round(l.regular_market_price / fx.regular_market_price, 2) AS price_usd
FROM yfinance.main.quote('ASML.AS,MC.PA,7203.T,NESN.SW') l,
LATERAL yfinance.main.quote(l.currency || '=X') fx
ORDER BY price_usd DESC, l.symbol;
Where does each asset class sit in its 52-week range? Quote every symbol_reference ticker (equity, ETF, index, crypto, FX) and show its position in the range (0 = at the low, 100 = at the high) and its percent distance from the 52-week high
SELECT r.asset_type, r.symbol, q.regular_market_price,
round(100 * (q.regular_market_price - q.fifty_two_week_low) / nullif(q.fifty_two_week_high - q.fifty_two_week_low, 0), 1) AS pct_of_52w_range,
round(100 * (q.regular_market_price / q.fifty_two_week_high - 1), 1) AS pct_from_52w_high
FROM yfinance.main.symbol_reference r,
LATERAL yfinance.main.quote(r.symbol) q
ORDER BY r.asset_type, pct_of_52w_range DESC, r.symbol;
How closely does each registry equity and ETF track the S&P 500? Pull six months of daily history for the symbol_reference equities, ETFs and the ^GSPC index, turn dividend-adjusted closes into daily returns, and correlate each ticker's returns with the index's on matching trading days
WITH px AS (SELECT r.symbol, h.timestamp, h.adjclose / lag(h.adjclose) OVER (PARTITION BY r.symbol ORDER BY h.timestamp) - 1 AS ret FROM yfinance.main.symbol_reference r, LATERAL yfinance.main.history(r.symbol, range := '6mo') h WHERE r.asset_type IN ('EQUITY', 'ETF', 'INDEX')) SELECT a.symbol, round(corr(a.ret, b.ret), 3) AS corr_with_sp500
FROM px a
JOIN px b ON a.timestamp = b.timestamp AND b.symbol = '^GSPC'
WHERE a.symbol <> '^GSPC'
GROUP BY a.symbol
ORDER BY corr_with_sp500 DESC, a.symbol;
symbol_reference
A curated, credential-free registry of well-known tickers that demonstrates each Yahoo symbol convention accepted by history, quote, and search. Browsable without any network call.
List the reference tickers for a given asset type
SELECT symbol, name, exchange
FROM yfinance.main.symbol_reference
WHERE asset_type = 'ETF'
ORDER BY symbol;
Count the reference symbols grouped by asset type
SELECT asset_type, count(*) AS n
FROM yfinance.main.symbol_reference
GROUP BY asset_type
ORDER BY n DESC, asset_type;
Where does each asset class sit in its 52-week range? Quote every symbol_reference ticker (equity, ETF, index, crypto, FX) and show its position in the range (0 = at the low, 100 = at the high) and its percent distance from the 52-week high
SELECT r.asset_type, r.symbol, q.regular_market_price,
round(100 * (q.regular_market_price - q.fifty_two_week_low) / nullif(q.fifty_two_week_high - q.fifty_two_week_low, 0), 1) AS pct_of_52w_range,
round(100 * (q.regular_market_price / q.fifty_two_week_high - 1), 1) AS pct_from_52w_high
FROM yfinance.main.symbol_reference r,
LATERAL yfinance.main.quote(r.symbol) q
ORDER BY r.asset_type, pct_of_52w_range DESC, r.symbol;
1 more example
How closely does each registry equity and ETF track the S&P 500? Pull six months of daily history for the symbol_reference equities, ETFs and the ^GSPC index, turn dividend-adjusted closes into daily returns, and correlate each ticker's returns with the index's on matching trading days
WITH px AS (SELECT r.symbol, h.timestamp, h.adjclose / lag(h.adjclose) OVER (PARTITION BY r.symbol ORDER BY h.timestamp) - 1 AS ret FROM yfinance.main.symbol_reference r, LATERAL yfinance.main.history(r.symbol, range := '6mo') h WHERE r.asset_type IN ('EQUITY', 'ETF', 'INDEX')) SELECT a.symbol, round(corr(a.ret, b.ret), 3) AS corr_with_sp500
FROM px a
JOIN px b ON a.timestamp = b.timestamp AND b.symbol = '^GSPC'
WHERE a.symbol <> '^GSPC'
GROUP BY a.symbol
ORDER BY corr_with_sp500 DESC, a.symbol;
history (symbol VARCHAR, bar := VARCHAR, end_date := VARCHAR, prepost := BOOLEAN, range := VARCHAR, start_date := VARCHAR)
Historical OHLCV candles for one symbol from Yahoo Finance (v8 chart API). Pick a named window (range := '1y') plus a candle width (bar := '1wk'), or an explicit start_date/end_date range. The symbol may be a column, so LATERAL history(t.sym) fetches candles for every row. Returns columns symbol, timestamp (UTC), open, high, low, close, adjclose, and volume.
The five most recent daily closes and volumes for Apple
SELECT timestamp, close, volume
FROM yfinance.main.history('AAPL', range := '1mo')
ORDER BY timestamp DESC
LIMIT 5;
One year of weekly closes for Microsoft
SELECT timestamp, close, volume
FROM yfinance.main.history('MSFT', range := '1y', bar := '1wk')
ORDER BY timestamp;
The 52-week high and low for SPY, aggregated from daily candles
SELECT max(high) AS high_52w, min(low) AS low_52w
FROM yfinance.main.history('SPY', range := '1y');
1 more example
Highest close over the last month for every ticker in a table, via LATERAL
SELECT w.sym, max(h.close) AS high_close
FROM (VALUES ('AAPL'), ('MSFT')) w(sym),
LATERAL yfinance.main.history(w.sym, range := '1mo') h
GROUP BY w.sym
ORDER BY w.sym;
quote (symbols VARCHAR)
Current market snapshot for one or more symbols (keyless, from the chart meta plane): price, change vs previous close, day range, 52-week range, volume. Pass a comma-separated symbol list, or a column (LATERAL quote(t.sym)) for one quote per row.
Snapshot quote for Apple
SELECT symbol, regular_market_price, regular_market_change_percent
FROM yfinance.main.quote('AAPL');
Latest price for several symbols at once
SELECT symbol, regular_market_price
FROM yfinance.main.quote('AAPL,MSFT,GOOG')
ORDER BY symbol;
Latest price for every ticker in a table, via LATERAL
SELECT w.sym, q.regular_market_price
FROM (VALUES ('AAPL'), ('MSFT')) w(sym),
LATERAL yfinance.main.quote(w.sym) q
ORDER BY w.sym;
2 more examples
Watchlist momentum check: compare each ticker's live quote price with the average of its daily closes over the past month from history, to see which names trade above or below their recent level
WITH q AS (SELECT symbol, regular_market_price FROM yfinance.main.quote('AAPL,MSFT,GOOG')), m AS (SELECT q.symbol, avg(h.close) AS avg_close_1mo FROM q, LATERAL yfinance.main.history(q.symbol, range := '1mo') h GROUP BY q.symbol) SELECT q.symbol, q.regular_market_price, round(m.avg_close_1mo, 2) AS avg_close_1mo, round(100 * (q.regular_market_price / m.avg_close_1mo - 1), 2) AS pct_vs_1mo_avg
FROM q
JOIN m USING (symbol)
ORDER BY pct_vs_1mo_avg DESC, q.symbol;
Price foreign listings in US dollars: quote each listing, then quote the FX pair named by its own currency column (EUR=X is euros per dollar; JPY=X, which Yahoo echoes back as USDJPY=X, is yen per dollar) and divide. London listings quote in pence (currency GBp) and would also need dividing by 100, so none is included
SELECT l.symbol, l.currency, l.regular_market_price AS local_price,
fx.symbol AS fx_pair, fx.regular_market_price AS units_per_usd,
round(l.regular_market_price / fx.regular_market_price, 2) AS price_usd
FROM yfinance.main.quote('ASML.AS,MC.PA,7203.T,NESN.SW') l,
LATERAL yfinance.main.quote(l.currency || '=X') fx
ORDER BY price_usd DESC, l.symbol;
search (query VARCHAR, count := BIGINT)
Look up ticker symbols by name or partial symbol (v1 search API). Returns candidate symbols with exchange and instrument type, best matches first. The query may be a column, so LATERAL search(t.name) resolves every row.
Find symbols matching 'apple'
SELECT symbol, short_name, exchange
FROM yfinance.main.search('apple')
ORDER BY score DESC, symbol;
Up to 20 candidate symbols for a query
SELECT symbol, long_name, exchange
FROM yfinance.main.search('vanguard', count := 20)
ORDER BY score DESC, symbol;
Best-matching ticker for every company name in a table, via LATERAL
SELECT c.name, s.symbol
FROM (VALUES ('apple'), ('microsoft')) c(name),
LATERAL yfinance.main.search(c.name, count := 1) s
ORDER BY c.name;
2 more examples
Rank companies by three-month total return starting from their names: search resolves each name to its top-scoring EQUITY ticker, then history supplies dividend-adjusted closes (adjclose) to compute the return
WITH pick AS (SELECT c.name, s.symbol FROM (VALUES ('apple'), ('costco'), ('walmart')) c(name), LATERAL yfinance.main.search(c.name, count := 5) s WHERE s.quote_type = 'EQUITY' QUALIFY row_number() OVER (PARTITION BY c.name ORDER BY s.score DESC) = 1) SELECT p.name, p.symbol, round(100 * (arg_max(h.adjclose, h.timestamp) / arg_min(h.adjclose, h.timestamp) - 1), 2) AS total_return_3mo_pct
FROM pick p,
LATERAL yfinance.main.history(p.symbol, range := '3mo') h
GROUP BY p.name, p.symbol
ORDER BY total_return_3mo_pct DESC, p.name;
Look up the live price of companies you only know by name: search resolves each name to its top-scoring EQUITY ticker, then quote returns that listing's exchange, currency, price and change versus the previous close
WITH pick AS (SELECT c.name, s.symbol FROM (VALUES ('netflix'), ('tesla'), ('toyota')) c(name), LATERAL yfinance.main.search(c.name, count := 5) s WHERE s.quote_type = 'EQUITY' QUALIFY row_number() OVER (PARTITION BY c.name ORDER BY s.score DESC) = 1) SELECT p.name, q.symbol, q.long_name, q.exchange, q.currency, q.regular_market_price, round(q.regular_market_change_percent, 2) AS change_pct
FROM pick p,
LATERAL yfinance.main.quote(p.symbol) q
ORDER BY p.name;
Try these queries
search_symbol β Resolve a company name to candidate tickers
SELECT symbol, short_name
FROM yfinance.main.search('apple')
ORDER BY score DESC, symbol
LIMIT 3;
Uses search
recent_history β Fetch the last few daily candles for a ticker
SELECT timestamp, close
FROM yfinance.main.history('AAPL', range := '5d')
ORDER BY timestamp;
Uses history
Last month of daily candles for Apple, oldest first
SELECT timestamp, open, high, low, close, volume
FROM yfinance.main.history('AAPL')
ORDER BY timestamp
Uses history
Current price for several megacaps at once
SELECT symbol, regular_market_price
FROM yfinance.main.quote('AAPL,MSFT,GOOG')
ORDER BY symbol
Uses quote
Find a ticker by company name, best matches first
SELECT symbol, long_name
FROM yfinance.main.search('vanguard')
ORDER BY score DESC, symbol
Uses search
Where does each asset class sit in its 52-week range? Quote every symbol_reference ticker (equity, ETF, index, crypto, FX) and show its position in the range (0 = at the low, 100 = at the high) and its percent distance from the 52-week high
SELECT r.asset_type, r.symbol, q.regular_market_price,
round(100 * (q.regular_market_price - q.fifty_two_week_low) / nullif(q.fifty_two_week_high - q.fifty_two_week_low, 0), 1) AS pct_of_52w_range,
round(100 * (q.regular_market_price / q.fifty_two_week_high - 1), 1) AS pct_from_52w_high
FROM yfinance.main.symbol_reference r,
LATERAL yfinance.main.quote(r.symbol) q
ORDER BY r.asset_type, pct_of_52w_range DESC, r.symbol
16 more examples in the Catalog, each listed under the table or function it uses.
Yahoo Finance is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Tastytrade
Markets & finance
Query your tastytrade brokerage accounts and market data from SQL, read-only
CCXT
Markets & finance
Candles, quotes, order books, trades and perpetual funding from 100+ crypto exchanges
First Trust ETFs
Markets & finance
Screen First Trust US ETFs and see each fund's facts and current holdings