{"id":150246,"date":"2022-07-28T11:01:59","date_gmt":"2022-07-28T15:01:59","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=150246"},"modified":"2022-11-21T09:56:47","modified_gmt":"2022-11-21T14:56:47","slug":"download-futures-data-with-yahoo-finance-library-in-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/","title":{"rendered":"Download Futures Data with Yahoo Finance Library in Python"},"content":{"rendered":"\n<p>The first thing you must do to code a futures strategy is to learn to download futures data in Python! This blog explains the complete process and helps you gain an understanding of the various steps required.<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.quantinsti.com\/futures-trading\/\">Futures trading<\/a>&nbsp;is inherently leveraged. One has to be cautious while using leverage in a portfolio. A good way to manage leverage is to trade algorithmically, and that is where this blog will be of importance.<\/p>\n\n\n\n<p>It covers:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Yahoo! Finance Library Installation<\/li><li>Import Libraries<\/li><li>Download Futures Data<\/li><li>Plot the Close Prices<\/li><li>Download Data for Multiple Futures<\/li><li>Plot Multiples Futures Data<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-yahoo-finance-library-installation\">Yahoo! Finance Library Installation<\/h2>\n\n\n\n<p>Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker. It is also quite easy to&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/set-up-python-system\/\">set up your own Python trading system<\/a>.<\/p>\n\n\n\n<p>We are going to use a&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/jupyter-notebook-tutorial-installation-components-magic-commands\/\">Jupyter notebook<\/a>. Let\u2019s code! In case you haven\u2019t already installed this famous library in your machine, here you have the code:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-import-libraries\">Import Libraries<\/h2>\n\n\n\n<p>So now, we want to import a library for data visualisation. We can use \u201cmatplotlib\u201d. This library is the most used library in Python for this purpose.<\/p>\n\n\n\n<p>In case you are new to this library, do you think we are going to leave you alone on this? No way! Please have a look at&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/python-matplotlib-tutorial\/\">matplotlib<\/a>&nbsp;before you dive into our next code.<\/p>\n\n\n\n<p>We now want to import the two libraries. Here\u2019s the code:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-download-futures-data\">Download Futures Data<\/h2>\n\n\n\n<p>Before you dig into the many&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/possibilities-futures-trading-22-april-2021\/\">possibilities that futures trading<\/a>&nbsp;has to offer, do note that, in the yahoo finance library, you will find continuous futures data. Futures are offered in the market for specific dates and due dates.<\/p>\n\n\n\n<p>However, you can join all the futures in a single data line and this is called Futures continuation. You should also be aware of&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/continuous-futures-contract\/\">continuous futures contract<\/a>.<\/p>\n\n\n\n<p>For now, you just need to call the download method, and inside the parenthesis pass the ticker_symbol (of the futures contract) as \u201cticker_symbol = F\u201d, the start date, and the end date to specify the span of the dataset. The list provided in this&nbsp;<a href=\"https:\/\/quotes.ino.com\/exchanges\/contracts\/\" target=\"_blank\" rel=\"noreferrer noopener\">article<\/a>&nbsp;will help you to find the correct symbol for the futures asset you want to download.<\/p>\n\n\n\n<p>For illustration, let us fetch the continuous platinum futures with the symbol \u201cPL=F\u201d. We select the 2017-2021 span. We change the index column to datetime type keeping in mind that this will later be used for graphical visualisation and manipulation. Lastly, we present the last five rows of the dataframe.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Date<\/td><td>Open<\/td><td>High<\/td><td>Low<\/td><td>Close<\/td><td>Adj Close<\/td><td>Volume<\/td><\/tr><tr><td>2021-12-27<\/td><td>968.90<\/td><td>968.90<\/td><td>968.90<\/td><td>968.90<\/td><td>968.90<\/td><td>120<\/td><\/tr><tr><td>2021-12-28<\/td><td>979.10<\/td><td>979.10<\/td><td>979.10<\/td><td>979.10<\/td><td>979.10<\/td><td>120<\/td><\/tr><tr><td>2021-12-29<\/td><td>968.20<\/td><td>968.20<\/td><td>968.20<\/td><td>968.20<\/td><td>968.20<\/td><td>3280<\/td><\/tr><tr><td>2021-12-30<\/td><td>967.30<\/td><td>971.00<\/td><td>955.80<\/td><td>963.60<\/td><td>963.60<\/td><td>1356<\/td><\/tr><tr><td>2021-12-31<\/td><td>962.50<\/td><td>965.30<\/td><td>949.60<\/td><td>964.40<\/td><td>964.40<\/td><td>109<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This is a futures contract for which the underlying asset is a commodity. There are futures for currencies, stocks, interest rate futures,&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/index-futures\/\">index futures<\/a>, etc.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-plot-the-close-prices\">Plot the Close Prices<\/h2>\n\n\n\n<p>Now let\u2019s plot the Gold Futures close prices so we can have a better idea of its price trends:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"720\" height=\"336\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/07\/pl-futures-close-prices-quantinsti.png\" alt=\"\" class=\"wp-image-150264 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/07\/pl-futures-close-prices-quantinsti.png 720w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/07\/pl-futures-close-prices-quantinsti-700x327.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/07\/pl-futures-close-prices-quantinsti-300x140.png 300w\" data-sizes=\"(max-width: 720px) 100vw, 720px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 720px; aspect-ratio: 720\/336;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-download-data-for-multiple-futures\">Download Data for Multiple Futures<\/h2>\n\n\n\n<p>Let\u2019s do something else. Let\u2019s download the Gold (GC) and Copper (HG) Futures data for the period 2020-2021. To fetch more than one asset, you just need to put the futures tickers inside brackets. We use brackets since to download two or more assets you need to pass the ticker names together as a list.<\/p>\n\n\n\n<p>Data columns will be presented by asset and then by type of price. For this, we just grouped the data first by \u2018tickers\u2019 with the group_by method. Let\u2019s code:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>GC=F<\/td><\/tr><tr><td>Date<\/td><td>Open<\/td><td>High<\/td><td>Low<\/td><td>Close<\/td><td>Adj Close<\/td><td>Volume<\/td><\/tr><tr><td>2021-12-27<\/td><td>1810.00<\/td><td>1812.10<\/td><td>1807.00<\/td><td>1808.10<\/td><td>1808.10<\/td><td>150<\/td><\/tr><tr><td>2021-12-28<\/td><td>1812.00<\/td><td>1818.00<\/td><td>1805.50<\/td><td>1810.20<\/td><td>1810.20<\/td><td>146<\/td><\/tr><tr><td>2021-12-29<\/td><td>1803.20<\/td><td>1805.10<\/td><td>1791.40<\/td><td>1805.10<\/td><td>1805.10<\/td><td>623<\/td><\/tr><tr><td>2021-12-30<\/td><td>1801.70<\/td><td>1816.00<\/td><td>1796.00<\/td><td>1812.70<\/td><td>1812.70<\/td><td>306<\/td><\/tr><tr><td>2021-12-31<\/td><td>1825.10<\/td><td>1827.80<\/td><td>1821.40<\/td><td>1827.50<\/td><td>1827.50<\/td><td>80<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>HG=F<\/td><\/tr><tr><td>Date<\/td><td>Open<\/td><td>High<\/td><td>Low<\/td><td>Close<\/td><td>Adj Close<\/td><td>Volume<\/td><\/tr><tr><td>2021-12-27<\/td><td>4.38<\/td><td>4.47<\/td><td>4.37<\/td><td>4.47<\/td><td>4.47<\/td><td>421<\/td><\/tr><tr><td>2021-12-28<\/td><td>4.46<\/td><td>4.47<\/td><td>4.42<\/td><td>4.42<\/td><td>4.42<\/td><td>543<\/td><\/tr><tr><td>2021-12-29<\/td><td>4.41<\/td><td>4.41<\/td><td>4.40<\/td><td>4.40<\/td><td>4.40<\/td><td>695<\/td><\/tr><tr><td>2021-12-30<\/td><td>4.41<\/td><td>4.42<\/td><td>4.38<\/td><td>4.38<\/td><td>4.38<\/td><td>832<\/td><\/tr><tr><td>2021-12-31<\/td><td>4.39<\/td><td>4.46<\/td><td>4.38<\/td><td>4.46<\/td><td>4.46<\/td><td>373<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><em>Visit QuantInsti to read the full article: <a href=\"https:\/\/blog.quantinsti.com\/download-futures-data-yahoo-finance-library-python\/\">https:\/\/blog.quantinsti.com\/download-futures-data-yahoo-finance-library-python\/<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.<\/p>\n","protected":false},"author":825,"featured_media":37173,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,350,341,344],"tags":[851,8485,806,5479,6614,12383,595,12384],"contributors-categories":[13654],"class_list":{"0":"post-150246","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-asia-pacific","12":"category-quant-development","13":"category-quant-regions","14":"tag-algo-trading","15":"tag-data-mining","16":"tag-data-science","17":"tag-data-visualisation","18":"tag-jupyter-notebook","19":"tag-matplotlib-before","20":"tag-python","21":"tag-yahoo-finance-library","22":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Download Futures Data with Yahoo Finance Library in Python<\/title>\n<meta name=\"description\" content=\"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/150246\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Download Futures Data with Yahoo Finance Library in Python | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-28T15:01:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:56:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jos\u00e9 Carlos Gonz\u00e1les Tanaka\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jos\u00e9 Carlos Gonz\u00e1les Tanaka\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Jos\u00e9 Carlos Gonz\u00e1les Tanaka\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/f56024231fae4f14b0df92817cf8c884\"\n\t            },\n\t            \"headline\": \"Download Futures Data with Yahoo Finance Library in Python\",\n\t            \"datePublished\": \"2022-07-28T15:01:59+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:56:47+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/\"\n\t            },\n\t            \"wordCount\": 656,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/gold-stack-markets.jpg\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Data Mining\",\n\t                \"Data Science\",\n\t                \"Data Visualisation\",\n\t                \"Jupyter Notebook\",\n\t                \"matplotlib before\",\n\t                \"Python\",\n\t                \"Yahoo finance library\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/\",\n\t            \"name\": \"Download Futures Data with Yahoo Finance Library in Python | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/gold-stack-markets.jpg\",\n\t            \"datePublished\": \"2022-07-28T15:01:59+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:56:47+00:00\",\n\t            \"description\": \"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/download-futures-data-with-yahoo-finance-library-in-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/gold-stack-markets.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/03\\\/gold-stack-markets.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 540,\n\t            \"caption\": \"Gold\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/f56024231fae4f14b0df92817cf8c884\",\n\t            \"name\": \"Jos\u00e9 Carlos Gonz\u00e1les Tanaka\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/jose-carlos-gonzales-tanaka\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Download Futures Data with Yahoo Finance Library in Python","description":"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/150246\/","og_locale":"en_US","og_type":"article","og_title":"Download Futures Data with Yahoo Finance Library in Python | IBKR Quant Blog","og_description":"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/","og_site_name":"IBKR Campus US","article_published_time":"2022-07-28T15:01:59+00:00","article_modified_time":"2022-11-21T14:56:47+00:00","og_image":[{"width":900,"height":540,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","type":"image\/jpeg"}],"author":"Jos\u00e9 Carlos Gonz\u00e1les Tanaka","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jos\u00e9 Carlos Gonz\u00e1les Tanaka","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/"},"author":{"name":"Jos\u00e9 Carlos Gonz\u00e1les Tanaka","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/f56024231fae4f14b0df92817cf8c884"},"headline":"Download Futures Data with Yahoo Finance Library in Python","datePublished":"2022-07-28T15:01:59+00:00","dateModified":"2022-11-21T14:56:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/"},"wordCount":656,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","keywords":["Algo Trading","Data Mining","Data Science","Data Visualisation","Jupyter Notebook","matplotlib before","Python","Yahoo finance library"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Asia Pacific","Quant Development","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/","name":"Download Futures Data with Yahoo Finance Library in Python | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","datePublished":"2022-07-28T15:01:59+00:00","dateModified":"2022-11-21T14:56:47+00:00","description":"Python is one of the easiest programming languages in the world. Python makes it easy for new learners to acquire programming skills quicker.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/download-futures-data-with-yahoo-finance-library-in-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","width":900,"height":540,"caption":"Gold"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/f56024231fae4f14b0df92817cf8c884","name":"Jos\u00e9 Carlos Gonz\u00e1les Tanaka","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/jose-carlos-gonzales-tanaka\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/03\/gold-stack-markets.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/150246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/825"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=150246"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/150246\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/37173"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=150246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=150246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=150246"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=150246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}