Skip to content

Instantly share code, notes, and snippets.

@mehd-io
Created April 5, 2023 12:04
Show Gist options
  • Save mehd-io/40dc079941fc36d1ed418c7a77b4e9d0 to your computer and use it in GitHub Desktop.
Save mehd-io/40dc079941fc36d1ed418c7a77b4e9d0 to your computer and use it in GitHub Desktop.
Query Yahoo Finance Data w/ DuckDB
-- Install httpfs extension
INSTALL httpfs;
LOAD httpfs;
-- Install Scrooge extension https://github.com/pdet/Scrooge-McDuck
-- NOTE : You need to start DuckDB with `-unsigned` flag to authorized to install & load 3rd party extension
SET custom_extension_repository='scrooge-duckdb.s3.us-west-2.amazonaws.com/scrooge/s3_deploy';
INSTALL scrooge;
LOAD scrooge;
-- Example of query
FROM yahoo_finance("^GSPC", "2023-02-01", "2023-02-04", "1d");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment