{"id":186080,"date":"2023-03-06T10:09:21","date_gmt":"2023-03-06T15:09:21","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=186080"},"modified":"2023-03-06T10:09:17","modified_gmt":"2023-03-06T15:09:17","slug":"yfinance-library-a-complete-guide","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/","title":{"rendered":"yfinance Library \u2013 A Complete Guide"},"content":{"rendered":"\n<p><em>The article &#8220;yfinance Library \u2013 A Complete Guide&#8221; first appeared on <a href=\"https:\/\/algotrading101.com\/learn\/yfinance-guide\/\">AlgoTrading101 Blog<\/a>.<\/em><\/p>\n\n\n\n<p><em>Excerpt<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"What-is-yfinance\">What is yfinance?<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/pypi.org\/project\/yfinance\/\" target=\"_blank\">yfinance&nbsp;<\/a>is a popular open source library developed by&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/aroussi.com\/\" target=\"_blank\">Ran Aroussi<\/a>&nbsp;as a means to access the financial data available on Yahoo Finance.<\/p>\n\n\n\n<p><a href=\"https:\/\/uk.finance.yahoo.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Yahoo Finance<\/a>&nbsp;offers an excellent range of market data on stocks, bonds, currencies and cryptocurrencies. It also offers market news, reports and analysis and additionally options and fundamentals data- setting it apart from some of it\u2019s competitors.<\/p>\n\n\n\n<p>Yahoo Finance used to have their own official API, but this was decommissioned on May 15th 2017, following wide-spread misuse of data.<\/p>\n\n\n\n<p>These days a range of unofficial APIs and libraries exist to access the same data, including of course yfinance.<\/p>\n\n\n\n<p>Note you might know of yfinance under it\u2019s old name-&nbsp;<em>fix-yahoo-finance<\/em>, since it was re-named on May 26th 2019 at the same time that it went over a large overhaul to fix some usability issues.<\/p>\n\n\n\n<p>To ensure backwards compatibility, fix-yahoo-finance now imports and uses yfinance anyway, but Ran Aroussi still recommends to install and use yfinance directly.<\/p>\n\n\n\n<p>In this article we will focus mainly on the yfinance library, but we discuss the overall range of options and other alternative providers in more depth in our parent article,&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/algotrading101.com\/learn\/yahoo-finance-api\/\" target=\"_blank\">Yahoo Finance API \u2013 A Complete Guide<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Is-the-yfinance-library-free\">Is the yfinance library free?<\/h2>\n\n\n\n<p>Yes, yfinance is completely open source and free. You can find the documentation&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/pypi.org\/project\/yfinance\/\" target=\"_blank\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Why-should-I-use-the-yfinance-library\">Why should I use the yfinance library?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Free<\/li>\n\n\n\n<li>Quick and easy to set yourself up<\/li>\n\n\n\n<li>Simple<\/li>\n\n\n\n<li>High granularity of data (1min\/2min\/5min data)<\/li>\n\n\n\n<li>Returns data directly in pandas dataframes\/series<\/li>\n<\/ul>\n\n\n\n<p>As we have just mentioned yfinance is completely&nbsp;<strong>open source and<\/strong>&nbsp;<strong>free.<\/strong>&nbsp;There are other ways to access the Yahoo Finance data, some free and some paid, and there are certain benefits to some of the options that require paying, like being ensured a degree of maintenance to the solution, but everybody loves free!<\/p>\n\n\n\n<p><strong>Installation couldn\u2019t be quicker or easier<\/strong>. yfinance has just 4 dependencies, all of which come with Anaconda anyway, and installs fully in a single line of code. No account creation required, or signing up for and using API keys!<\/p>\n\n\n\n<p><strong>Its simple<\/strong>. yfinance is highly Pythonic in it\u2019s design and incredibly streamlined. It\u2019s as easy as creating a ticker object for a particular ticker\/list of tickers and then just calling all the methods on this object. Like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import yfinance as yf\n\napple= yf.Ticker(\"aapl\")\n\n# show actions (dividends, splits)\napple.actions\n\n# show dividends\napple.dividends\n\n# show splits\napple.splits\n\n# + other methods etc.<\/pre>\n\n\n\n<p>Don\u2019t worry, we\u2019ll break down that code further in a bit!<\/p>\n\n\n\n<p>Furthermore, the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/pypi.org\/project\/yfinance\/\" target=\"_blank\">documentation&nbsp;<\/a>is concise- fitting on a single page, and the method names are very self explanatory.<\/p>\n\n\n\n<p><strong>High granularity of data<\/strong>. One cool feature of yfinance is that you can get highly refined data, all the way down to 5 minute, 3 minute and even 1 minute data! The full range of intervals available are:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo<\/pre>\n\n\n\n<p>However it is important to note that the 1m data is only retrievable for the last 7 days, and anything intraday (interval &lt;1d) only for the last 60 days.<\/p>\n\n\n\n<p><strong>yfinance also handily returns data directly in padas dataframes or series<\/strong>.<strong>&nbsp;<\/strong>This is on contrast to some other options to access Yahoo Finance\u2019s data where you will get lengthy JSONs you need parse for the specific information you want, and will have to manually convert to data-frames yourself.<\/p>\n\n\n\n<p>\u00bb Here are some alternative (mostly) free data sources and guides:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/algotrading101.com\/learn\/quandl-guide\/\">Quandl: A Step-by-Step Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/algotrading101.com\/learn\/google-finance-api-guide\/\">Google Finance API and 9 Alternatives<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Why-shouldnt-I-use-the-yfinance-library\">Why shouldn\u2019t I use the yfinance library?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lacks specialised features<\/li>\n\n\n\n<li>Some methods are fragile<\/li>\n\n\n\n<li>Unofficial \/ not necessarily maintained<\/li>\n\n\n\n<li>Can get yourself rate limited\/blacklisted<\/li>\n<\/ul>\n\n\n\n<p><strong>Lacks specialised features<\/strong>. Despite the fact you can use it to get a good range of core data, including options and fundamentals data, yfinance doesn\u2019t provide a method to scrape any of the news reports\/analysis that are available on Yahoo Finance.<\/p>\n\n\n\n<p>This obviously isn\u2019t ideal if you want to build model that relies in part on sentiment analysis, so if you want that sort of data, you might want to check out&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/rapidapi.com\/apidojo\/api\/yahoo-finance1\" target=\"_blank\">RapidAPI&nbsp;<\/a>(which will talk about more shortly) that does offer such data.<\/p>\n\n\n\n<p>Also, other market data alternatives often include interesting extras. For example&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.alphavantage.co\/\" target=\"_blank\">Alpha Vantage<\/a>&nbsp;provides modules that calculate various technical analysis indicators for you- obviously an enormous effort save if you want to build an algorithm utilising any of them! yfinance just provides the basics.<\/p>\n\n\n\n<p><strong>Some methods are fragile<\/strong>. yfinance mainly makes API calls to Yahoo Finance to gather it\u2019s data, but it does occasionally employ HTML scraping and pandas tables scraping to unofficially gather the information off the Yahoo Finance website for some of it\u2019s methods. As such, the functionality of some of it\u2019s methods is at the mercy of Yahoo not changing the layout or design of some of their pages. In fact, yfinance is widely known to already have a few issues.<\/p>\n\n\n\n<p>As a quick aside, data scraping works by simply downloading the HTML code of a web page, and searching through all the HTML tags to find the specific elements of a page you want.<\/p>\n\n\n\n<p>For instance below is the Yahoo Finance Apple (\u2018AAPL\u2019) historical data page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"730\" height=\"373\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/data_scraping_example-algotrading101.jpg\" alt=\"\" class=\"wp-image-186088 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/data_scraping_example-algotrading101.jpg 730w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/data_scraping_example-algotrading101-700x358.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/data_scraping_example-algotrading101-300x153.jpg 300w\" data-sizes=\"(max-width: 730px) 100vw, 730px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 730px; aspect-ratio: 730\/373;\" \/><\/figure>\n\n\n\n<p>If the method to get the historical data HTML scraped, it would be searching the various&nbsp;<strong>div<\/strong>,&nbsp;<strong>class&nbsp;<\/strong>and&nbsp;<strong>tr&nbsp;<\/strong>tags etc. for various IDs to pick out the data that should be returned.<\/p>\n\n\n\n<p>For instance the class ID \u201cPy(10px) Pstart(10px)\u201d refers to the historical prices populating the table. If in this case Yahoo Finance was to change the class ID pointing to this value, the method might return completely incorrect data, or even nothing at all. Again, this sort of vulnerability doesn\u2019t apply to all of yfinance\u2019s methods- most of them do in fact make direct API calls- but it does affect a few.<\/p>\n\n\n\n<p><strong>It\u2019s an unofficial solution<\/strong>. Again, because yfinance is simply the result of one man\u2019s hard work and not in any way affiliated with Yahoo Finance, there\u2019s no guarantee if it breaks it will be maintained.<\/p>\n\n\n\n<p>As we already mentioned it did have a big update to fix issues on May 26th 2019 on the same day it was renamed, but that\u2019s no guarantee problems will be fixed in the future. Are you sure you want to build a trading algorithm on-top of data that might one day suddenly and without warning be wrong? There are already a few known issues with yfinance, which we will highlight later on in this article.<\/p>\n\n\n\n<p><strong>You can get yourself rate limited\/blacklisted.<\/strong>&nbsp;Again because yfinance scrapes data for a few of it\u2019s functions, you sometimes run the risk of getting rate limited or blacklisted for too many scraping attempts.<\/p>\n\n\n\n<p>This is a risk that\u2019s always present when trying to scrape websites, but when you\u2019re building applications trading real money on-top of infrastructure that might be making a lot of data requests, the risk:reward changes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Conclusion<\/h4>\n\n\n\n<p>Overall yfinance an incredibly beginner friendly option. You\u2019ll be able to dive right in and test out ideas without wasting time puzzling over complex documentation whilst still having access to a good range of data!<\/p>\n\n\n\n<p>That said, the risk of getting faulty data or being blocked from getting any data at all when employing algorithms trading real money is absolutely unacceptable.<\/p>\n\n\n\n<p>We think yfinance is great for prototyping, or if you are beginner, or just want to download a bunch of historic data.<\/p>\n\n\n\n<p>But if you want complete confidence that a serious trading system is going to function with total reliability, we\u2019d absolutely recommend going with a official and alternative market data provider- preferably one claiming to provide low latency data directly from exchanges.<\/p>\n\n\n\n<p><a href=\"https:\/\/polygon.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Polygon&nbsp;<\/a>and&nbsp;<a href=\"https:\/\/algotrading101.com\/learn\/iex-api-guide\/\">IEX<\/a>&nbsp;might make good bets.<\/p>\n\n\n\n<p><em>Visit <a href=\"https:\/\/algotrading101.com\/learn\/yfinance-guide\/\">AlgoTrading101<\/a> to read the full article.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.<\/p>\n","protected":false},"author":1120,"featured_media":186094,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338],"tags":[6922,806,595,14857],"contributors-categories":[13746],"class_list":{"0":"post-186080","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":"tag-anaconda","12":"tag-data-science","13":"tag-python","14":"tag-yfinance-library","15":"contributors-categories-algotrading101"},"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>yfinance Library \u2013 A Complete Guide | IBKR Quant<\/title>\n<meta name=\"description\" content=\"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.\" \/>\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\/186080\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"yfinance Library \u2013 A Complete Guide | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-06T15:09:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Greg Bland\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greg Bland\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 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\\\/yfinance-library-a-complete-guide\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/yfinance-library-a-complete-guide\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Greg Bland\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/61200ed458846d146b20de782ae1c103\"\n\t            },\n\t            \"headline\": \"yfinance Library \u2013 A Complete Guide\",\n\t            \"datePublished\": \"2023-03-06T15:09:21+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/yfinance-library-a-complete-guide\\\/\"\n\t            },\n\t            \"wordCount\": 1309,\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\\\/yfinance-library-a-complete-guide\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/python-quant-laptop-coding.jpg\",\n\t            \"keywords\": [\n\t                \"Anaconda\",\n\t                \"Data Science\",\n\t                \"Python\",\n\t                \"yfinance Library\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\"\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\\\/yfinance-library-a-complete-guide\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/yfinance-library-a-complete-guide\\\/\",\n\t            \"name\": \"yfinance Library \u2013 A Complete Guide | IBKR Campus US\",\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\\\/yfinance-library-a-complete-guide\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/yfinance-library-a-complete-guide\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/python-quant-laptop-coding.jpg\",\n\t            \"datePublished\": \"2023-03-06T15:09:21+00:00\",\n\t            \"description\": \"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.\",\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\\\/yfinance-library-a-complete-guide\\\/\"\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\\\/yfinance-library-a-complete-guide\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/python-quant-laptop-coding.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/03\\\/python-quant-laptop-coding.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Python Quant\"\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\\\/61200ed458846d146b20de782ae1c103\",\n\t            \"name\": \"Greg Bland\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/greg-bland\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"yfinance Library \u2013 A Complete Guide | IBKR Quant","description":"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.","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\/186080\/","og_locale":"en_US","og_type":"article","og_title":"yfinance Library \u2013 A Complete Guide | IBKR Campus US","og_description":"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/","og_site_name":"IBKR Campus US","article_published_time":"2023-03-06T15:09:21+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","type":"image\/jpeg"}],"author":"Greg Bland","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greg Bland","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/"},"author":{"name":"Greg Bland","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/61200ed458846d146b20de782ae1c103"},"headline":"yfinance Library \u2013 A Complete Guide","datePublished":"2023-03-06T15:09:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/"},"wordCount":1309,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","keywords":["Anaconda","Data Science","Python","yfinance Library"],"articleSection":["Data Science","Programming Languages","Python Development","Quant"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/","name":"yfinance Library \u2013 A Complete Guide | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","datePublished":"2023-03-06T15:09:21+00:00","description":"yfinance is highly Pythonic in it\u2019s design and incredibly streamlined.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/yfinance-library-a-complete-guide\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","width":1000,"height":563,"caption":"Python Quant"},{"@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\/61200ed458846d146b20de782ae1c103","name":"Greg Bland","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/greg-bland\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/03\/python-quant-laptop-coding.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/186080","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\/1120"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=186080"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/186080\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/186094"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=186080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=186080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=186080"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=186080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}