Files
OpenBB/sdk/usage/basics.html
github-actions[bot] ed205b0ae6 deploy: c0f0445762
2024-01-12 12:02:39 +00:00

19 lines
99 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-sdk/usage/basics" data-has-hydrated="false">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.4.3">
<title data-rh="true">Basics | OpenBB Docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://docs.openbb.co/img/banner.png"><meta data-rh="true" name="twitter:image" content="https://docs.openbb.co/img/banner.png"><meta data-rh="true" property="og:url" content="https://docs.openbb.co/sdk/usage/basics"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Basics | OpenBB Docs"><meta data-rh="true" name="description" content="This page provides a detailed overview of using the OpenBB SDK - a tool that brings programmatic access to nearly all Terminal commands. Topics covered include installation, essential terminal command usage, working with Python environments, using Jupyter and various code editors, managing API keys, functionality, and navigation of the SDK. There are also specifics on using function inputs and responses, as well as dealing with plot themes and changing data sources. Support is offered via the support page, GitHub, and Discord."><meta data-rh="true" property="og:description" content="This page provides a detailed overview of using the OpenBB SDK - a tool that brings programmatic access to nearly all Terminal commands. Topics covered include installation, essential terminal command usage, working with Python environments, using Jupyter and various code editors, managing API keys, functionality, and navigation of the SDK. There are also specifics on using function inputs and responses, as well as dealing with plot themes and changing data sources. Support is offered via the support page, GitHub, and Discord."><meta data-rh="true" name="keywords" content="OpenBB SDK,Terminal commands,Installation,Python environment,Jupyter,Code Editors,API Keys,Programming,Conda,Pandas DataFrame,Python packages,Stocks,Screener preset,OpenBB Hub,VS Code"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.openbb.co/sdk/usage/basics"><link data-rh="true" rel="alternate" href="https://docs.openbb.co/sdk/usage/basics" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.openbb.co/sdk/usage/basics" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://7D1HQ0IXAS-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="OpenBB Docs" href="/opensearch.xml">
<link rel="stylesheet" href="/katex/katex.min.css"><link rel="stylesheet" href="/assets/css/styles.35f072c4.css">
<link rel="preload" href="/assets/js/runtime~main.971adda6.js" as="script">
<link rel="preload" href="/assets/js/main.875c0435.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus">
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav class="border-b border-grey-600 lg:px-12 header_docs_sdk navbar navbar--fixed-top"><div class="navbar__inner items-center"><div class="navbar__items"><div class="items-center ml-2 flex"><a href="/"><svg viewBox="0 0 271 19" width="271" height="19" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="M126.316.99V14.33l-1.144-1.11-1.142-1.113-1.144-1.11-1.142-1.114-1.144-1.11-1.145-1.113-1.141-1.11-1.145-1.114-1.142-1.113-1.144-1.11-1.142-1.11-1.144-1.114H110.311v17.788H112.597V4.323l1.144 1.113 1.142 1.113 1.144 1.11 1.142 1.114 1.145 1.11 1.141 1.113 1.145 1.11 1.144 1.114 1.142 1.11 1.144 1.113 1.142 1.113 1.144 1.11 1.142 1.111h1.145V.989h-2.287ZM163.123 7.66h-2.286V.99H147.12v17.79h18.294V7.65h-2.286l-.005.01ZM149.406 6.54V3.213h9.144V7.66h-9.144V6.54Zm13.717 4.447v5.566h-13.717V9.886h13.717v1.102ZM201.057 7.66h-3.427V.99h-13.72v17.79h18.289V7.65l-1.142.01ZM186.196 6.54V3.213h9.148V7.66h-9.148V6.54Zm13.72 4.447v5.566h-13.72V9.886h13.72v1.102ZM89.662.99H73.656v17.787H91.942v-2.22H75.945V12.106H89.656V9.883H75.945V3.213H91.942V.99H89.661ZM16.02.99H.018v17.79h18.291V.99H16.02Zm0 3.336v12.23H2.301V3.213h13.72v1.113ZM52.862.99H36.86v17.79h2.286v-6.673h16.003V.977h-2.287V.99Zm0 3.336v5.565H39.146V3.213h13.716v1.113ZM226.316 10.14h-6.117v8.64h6.141l.992-1v-7l-1.016-.64Zm-.002 1.62v5.94h-5.1v-6.48h5.1v.54ZM240.447 10.14h-7.115v8.64h8.133v-8.64h-1.018Zm0 1.62v5.94h-6.1v-6.48h6.1v.54ZM254.9 10.14H247.465v8.64H255.959V17.7H248.528V11.22H255.959v-1.08H254.9ZM269.404 10.14h-7.444V15h7.448v2.701h-5.853l-1.596.005.001.535v.539h8.505V17.7h-1.061.004H263.555l6.913.066.002-.607-.002-.41-.003-.67.005-1.08h-6.248 6.248l-.002-1.08H263.024v-2.7h7.441v-1.08h-1.061Z"></path></svg></a></div></div><div class="navbar__items navbar__items--right hidden sm:block"><div class="flex items-center"><div class="flex gap-4 mr-12 md:mr-0 ml-4"><button type="button" aria-haspopup="dialog" aria-expanded="false" aria-controls="" data-state="closed" class="bg-grey-900 radix-state-open:text-white hover:border-grey-200 hover:text-grey-200 radix-state-open:border-white border -mt-[0.6px] h-[34px] w-[34px] text-grey-400 border-grey-400 rounded flex items-center justify-center"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4 h-4"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div><div class="searchBox_ZlJk"><div class="flex gap-2"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button><a href="https://my.openbb.co/" class="_btn-dark text-xs hover:text-black"><span class="md:hidden">Hub</span><span class="hidden md:inline">OpenBB Hub</span></a></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav class="menu thin-scrollbar !px-10 text-sm !pb-10 mt-[40px] menu_Y1UP"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/platform">OpenBB Platform</a><button aria-label="Toggle the collapsible sidebar category &#x27;OpenBB Platform&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/terminal">OpenBB Terminal</a><button aria-label="Toggle the collapsible sidebar category &#x27;OpenBB Terminal&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/bot">OpenBB Bot</a><button aria-label="Toggle the collapsible sidebar category &#x27;OpenBB Bot&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><span class="sidebar-divider"></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menuHtmlItem_PEWV menu__list-item sidebar-title">LEGACY</li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/sdk">OpenBB SDK</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sdk">Introduction</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sdk/installation">Installation</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/sdk/usage">Usage</a><button aria-label="Toggle the collapsible sidebar category &#x27;Usage&#x27;" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/sdk/usage/basics">Basics</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/sdk/usage/api-keys">Setting API Keys</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/sdk/data-available">Data Available</a><button aria-label="Toggle the collapsible sidebar category &#x27;Data Available&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/sdk/reference">Reference</a><button aria-label="Toggle the collapsible sidebar category &#x27;Reference&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/sdk/faqs">FAQs</a><button aria-label="Toggle the collapsible sidebar category &#x27;FAQs&#x27;" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/sdk/showcase">Showcase</a></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">OpenBB SDK</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/sdk/usage"><span itemprop="name">Usage</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Basics</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_bxCs"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Basics</h1></header><h2 class="anchor anchorWithStickyNavbar_LWe7" id="overview">Overview<a href="#overview" class="hash-link" aria-label="Direct link to Overview" title="Direct link to Overview">​</a></h2><p>The OpenBB SDK provides programmatic access to nearly all Terminal commands, allowing custom scripts and functions to power creations built on top of the core platform. It is easy to use and as flexible as one&#x27;s imagination. The sections below will outline how to get started using it. If it isn&#x27;t already installed, follow the instructions to install via <a href="/terminal/installation/pypi">PyPi (pip)</a> or from the <a href="/terminal/installation/source">source code</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="importing-the-openbb-sdk">Importing the OpenBB SDK<a href="#importing-the-openbb-sdk" class="hash-link" aria-label="Direct link to Importing the OpenBB SDK" title="Direct link to Importing the OpenBB SDK">​</a></h2><p>No additional software is required to use the OpenBB SDK, it can be consumed directly from the command line Terminal within the virtual environment created during the installation process.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="terminal-command-line">Terminal Command Line<a href="#terminal-command-line" class="hash-link" aria-label="Direct link to Terminal Command Line" title="Direct link to Terminal Command Line">​</a></h3><p>The <code>obb</code> virtual environment has both <code>python</code> and <code>ipython</code> as methods for starting a new session from scratch.</p><ul><li>Step 1: Activate the <code>obb</code> virtual environment.<ul><li><code>conda activate obb</code></li></ul></li></ul><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>If this doesn&#x27;t work, there may be an obvious reason why.</p><ul><li>The installation was not completed.</li><li>The terminal being used is different from the one which was used for installation. For example, Miniconda was installed using <code>CMD.exe</code> or <code>Anaconda Prompt</code>, but the current terminal is PowerShell.</li></ul><p>Open the same terminal used for installation and activate the <code>obb</code> environment, then enter:</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">conda init --all --system</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><code>Exit</code> and re-open. Conda should now be callable from all terminal shell profiles.</p></div></div><ul><li>Step 2: Start a new Python or iPython session.<ul><li><code>python</code></li><li><code>ipython</code></li></ul></li></ul><p>This will display a similar message to the one below.</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">(obb) Steves-MacBook-Pro:OpenBBTerminal steve$ python</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:13) [Clang 14.0.6 ] on darwin</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">&gt;&gt;&gt; from openbb_terminal.sdk import openbb</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><code>ipython</code> will look slightly different.</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">(obb) Steves-MacBook-Pro:OpenBBTerminal steve$ ipython</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:13) [Clang 14.0.6 ]</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Type &#x27;copyright&#x27;, &#x27;credits&#x27; or &#x27;license&#x27; for more information</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">IPython 8.11.0 -- An enhanced Interactive Python. Type &#x27;?&#x27; for help.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">In [1]: from openbb_terminal.sdk import openbb</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><code>ipython</code> is a good choice for exploring and working on scripts without saving them as a new file, while the plain command line version, <code>python</code>, is what a scripted <code>.py</code> file would use to run.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="jupyter">Jupyter<a href="#jupyter" class="hash-link" aria-label="Direct link to Jupyter" title="Direct link to Jupyter">​</a></h3><p>Jupyter is a code editor and IDE that runs in a web browser, served over localhost. No additional installation steps are required to use it, in two flavours, <code>notebook</code> and <code>lab</code>. Both are launched from the terminal command line, after activating the <code>obb</code> virtual Python environment.</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">conda activate obb</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">jupyter lab</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Or</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">conda activate obb</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">jupyter notebook</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This will launch the Jupyter server and open a browser window with the application.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/4a289ef0-11af-4909-af7a-66fe97e9ffea" alt="Jupyter Lab" class="img_ev3q"></p><p>There will be only one choice for the kernel, <code>Python3 (ipykernel)</code>. Click on, <code>Select</code>.</p><p>In the console window (or a new Notebook file) the OpenBB SDK is imported by entering:</p><div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-console codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">from openbb_terminal.sdk import openbb</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Docstrings can be viewed in a pop-up with the key command, <code>shift+tab</code>. The contents of each module (similar to the menus in the OpenBB Terminal) can be browsed by hitting the <code>tab</code> key.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/7cc04e49-57fe-4bbf-bb5e-4cfbdab62eaf" alt="Jupyter Lab Import" class="img_ev3q"></p><p>The <code>Contextual Help</code> window displays more details, and also previews DataFrames after they are assigned. These tools are an excellent way to understand the structure of the SDK along with the syntax for each command and argument.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="code-editors-and-ides">Code Editors and IDEs<a href="#code-editors-and-ides" class="hash-link" aria-label="Direct link to Code Editors and IDEs" title="Direct link to Code Editors and IDEs">​</a></h3><p>Regardless of the code editor of choice, the program must know that the <code>obb</code> virtual Python environment exists. The steps for setting it up will vary by platform, consult the manual for the specific editor. VS Code is a recommended choice because it is free, flexible, and has integrations with GitHub and Jupyter, and has a plugin marketplace that can enhance a workspace with tools like GitHub Co-Pilot. Some code editing and IDE suites will charge a subscription for Jupyter integrations, which make them less ideal.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Spyder is not recommended for installing or operating the OpenBB SDK.</p></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="helpful-vs-code-extensions">Helpful VS Code Extensions<a href="#helpful-vs-code-extensions" class="hash-link" aria-label="Direct link to Helpful VS Code Extensions" title="Direct link to Helpful VS Code Extensions">​</a></h4><p>Installing a few extensions in VS Code will improve the user experience and provide enhanced functionality.</p><ul><li>Python Extension Pack (Don Jayamanne)</li><li>Jupyter PowerToys (Microsoft)</li><li>Jupyter Notebook Renderers</li><li>Codeium</li></ul><p>Icons on the sidebar for Jupyter and Python provide quick access to the virtual environments, and a new notebook or interactive window are created with a mouse click.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/bf04c707-a591-47c8-a5e9-c4c0e60e302a" alt="VS Code" class="img_ev3q"></p><p>When opening a Notebook file, or a new interactive window, ensure that the correct environment is being used. If the selected environment is not the one created during installation, the OpenBB SDK will not import.</p><p>Click on the item in the top-right of the window to select or change the environment.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/0e4904cf-4ff7-4130-b965-30b3de140392" alt="VS Code environment" class="img_ev3q"></p><p>The OpenBB SDK is imported with:</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> openbb_terminal</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">sdk </span><span class="token keyword" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> openbb</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="navigation">Navigation<a href="#navigation" class="hash-link" aria-label="Direct link to Navigation" title="Direct link to Navigation">​</a></h2><p>The layout of the OpenBB SDK is similar to the menus in the OpenBB Terminal, with each one represented as a module. Instead of a <code>/</code> in the path, it is <code>.</code>. For example, <code>openbb.stocks.gov</code> is the Government submodule of <code>stocks</code>.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/ad3617fe-b84c-4bbd-9139-2563702849ba" alt="Navigation" class="img_ev3q"></p><p>The attributes for each module - and docstrings for a function - can also be printed directly to the screen, insert a question mark at the end of the string.</p><div class="language-jupyterpython codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-jupyterpython codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb.stocks.gov.contracts?</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><strong>Note</strong>: For a regular <code>python</code> session, the syntax is: <code>help(openbb.stocks.gov.contracts)</code></p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-text codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">Signature: openbb.stocks.gov.contracts(symbol: str, past_transaction_days: int = 10) -&gt; pandas.core.frame.DataFrame</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Call signature: openbb.stocks.gov.contracts(*args: Any, **kwargs: Any) -&gt; Any</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Type: get_contracts</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">String form: &lt;openbb_terminal.stocks.government.quiverquant_model.Operation object at 0x2b57d0700&gt;</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">File: ~/GitHub/OpenBBTerminal/openbb_terminal/stocks/government/quiverquant_model.py</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Docstring:</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Get government contracts for ticker [Source: quiverquant.com]</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Parameters</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">----------</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">symbol: str</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> Ticker to get congress trading data from</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">past_transaction_days: int</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> Number of days to get transactions for</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Returns</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">-------</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">pd.DataFrame</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> Most recent transactions by members of U.S. Congress</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="docstrings">Docstrings<a href="#docstrings" class="hash-link" aria-label="Direct link to Docstrings" title="Direct link to Docstrings">​</a></h2><p>Docstrings are the SDK equivalent to the Terminal&#x27;s <code>--help</code> argument. They contain information on the functions, its input parameters, and the type of data being returned. The Contextual Help window, in Jupyter, is a very convenient way to keep this information on hand. Referencing the docstrings will greatly reduce the need to consult the online documentation pages.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/ffbfcdec-c16e-41e7-8828-b099325910a5" alt="Docstrings" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="api-keys">API Keys<a href="#api-keys" class="hash-link" aria-label="Direct link to API Keys" title="Direct link to API Keys">​</a></h2><p>The <code>keys</code> module provides methods for managing access credentials to data sources. If the API keys have already been set in a locally installed OpenBB Terminal application, no further action is required. A new installation can be authorized using the OpenBB Hub, or they can be entered manually in the SDK. For instructions on obtaining and authorizing each individual source, see the guide <a href="/sdk/usage//api-keys">here</a>. A key can be stored permanently, or only for the active session. Use the <code>persist</code> boolean argument to remember or forget it.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">keys</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">fred</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">key</span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;REPLACE_WITH_YOUR_KEY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> persist</span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token boolean">True</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="authorize-with-the-openbb-hub">Authorize With the OpenBB Hub<a href="#authorize-with-the-openbb-hub" class="hash-link" aria-label="Direct link to Authorize With the OpenBB Hub" title="Direct link to Authorize With the OpenBB Hub">​</a></h3><p>API keys can be imported to the session by logging in to an <a href="https://my.openbb.co/app/sdk/api-keys" target="_blank" rel="noopener noreferrer">OpenBB Hub account</a>. The session can persist, if desired, otherwise they will be valid only for the current session. We recommend connecting to Hub by generating a Personal Access Token. Follow the <a href="https://my.openbb.co/app/sdk/api-keys" target="_blank" rel="noopener noreferrer">link</a>, scroll to the bottom of the page, and click the &quot;Generate&quot; button.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/8c3988b4-cba9-4008-b8f3-04eef72878be" alt="OpenBB Personal Access Token" class="img_ev3q"></p><p>Copy the generated token and enter as the value for the <code>token</code> parameter, ignoring the email and password fields. By default, the credentials will be forgotten when the SDK session is terminated.</p><div class="language-jupyterpython codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-jupyterpython codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb.login?</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-text codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">Signature:</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb.login(</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> email: str = &#x27;&#x27;,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> password: str = &#x27;&#x27;,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> token: str = &#x27;&#x27;,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> keep_session: bool = False,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> silent: bool = False,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">)</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Docstring:</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Login and load user info.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">If there is a saved session it will be used (this can be achieved by `keep_session=True`).</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">If there&#x27;s not a local session,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">the user can use either email and password or the OpenBB Personal Access Token.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Parameters</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">----------</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">email : str</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> The email.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">password : str</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> The password.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">token : str</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> The OpenBB Personal Access Token.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">keep_session : bool</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> Keep the session, i.e., next time the user logs in,</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> there is no need to enter the email and password or the token.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">silent : bool</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"> If True, the console print will be silent.</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Examples</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">--------</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">&gt;&gt;&gt; from openbb_terminal.sdk import openbb</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">&gt;&gt;&gt; openbb.login(email=&quot;&lt;your email&gt;&quot;, password=&quot;&lt;your password&gt;&quot;)</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">File: ~/GitHub/OpenBBTerminal/openbb_terminal/core/session/sdk_session.py</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Type: function</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Login with an access token with the syntax:</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">login</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">token </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;REPLACE_WITH_THE_PERSONAL_ACCESS_TOKEN&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The token can be revoked from the OpenBB Hub API Keys page, by clicking on the <code>Regenerate</code> button, which will invalidate the current one.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-use-the-sdk">How to Use the SDK<a href="#how-to-use-the-sdk" class="hash-link" aria-label="Direct link to How to Use the SDK" title="Direct link to How to Use the SDK">​</a></h2><p>The syntax examples provided assume that the SDK has already been imported.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> openbb_terminal</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">sdk </span><span class="token keyword" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> openbb</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="function-inputs">Function Inputs<a href="#function-inputs" class="hash-link" aria-label="Direct link to Function Inputs" title="Direct link to Function Inputs">​</a></h3><p>The majority of parameters accept a string as the input. The docstrings will describe the expected inputs, but most will follow these general guidelines, unless otherwise stated:</p><ul><li>String values are surrounded by quotation marks, or a single apostrophe.<ul><li><code>&quot;the string&quot;</code>, or <code>&#x27;the string to enter&#x27;</code></li></ul></li><li>Some commands expect a list for the main input, and are contained within square brackets, with each item separated by a comma.<ul><li><code>[&quot;the first string&quot;, &quot;the second string&quot;]</code></li><li><code>openbb.stocks.quote([&quot;SPY&quot;, &quot;QQQ&quot;, &quot;IWM&quot;, &quot;AAPL&quot;, &quot;MSFT&quot;, &quot;TSLA&quot;, &quot;GOOG&quot;, &quot;META&quot;, &quot;AMZN&quot;])</code></li></ul></li><li>Dates are entered as a string, and follow the format: &quot;YYYY-MM-DD&quot;.<ul><li><code>openbb.stocks.load(&quot;SPY&quot;, start_date=&quot;1994-01-01&quot;)</code></li></ul></li><li>When the expected input of a parameter is an integer or float value, they are entered without quotes.<ul><li><code>limit = 10</code></li></ul></li><li>Boolean arguments are always capitalized.<ul><li>True</li><li>False</li></ul></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="function-responses">Function Responses<a href="#function-responses" class="hash-link" aria-label="Direct link to Function Responses" title="Direct link to Function Responses">​</a></h3><p>Most data objects returned by functions are Pandas DataFrames, and the results will be printed without first assigning it to a variable.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">quote</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/cb932ee1-3a87-4744-81a5-840c452eac51" alt="Data Response" class="img_ev3q"></p><p>The presentation of the responses will vary by platform, the sample above is from Jupyter Lab. When the same function in the Terminal outputs a chart, the response is separated into the model and view components. The SDK map will show two functions for the same command where the second has <code>_chart</code> added on. Using this second command will display the chart while the former returns the raw Pandas DataFrame.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/08bccaae-13f3-4fcd-857c-13cd30250492" alt="Model and View" class="img_ev3q"></p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> weekly </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token boolean">True</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">ta</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">atr_chart</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> symbol </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If the SDK session is from the command line (<code>python</code> or <code>ipython</code>), a window will open to display the chart. Within an IDE, or Jupyter Notebook, they will be displayed inline and will not have the same toolbars.</p><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/b668556b-27a5-49cc-989b-8d7de1e420e2" alt="openbb.ta.atr_chart" class="img_ev3q"></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="passing-data-through">Passing Data Through<a href="#passing-data-through" class="hash-link" aria-label="Direct link to Passing Data Through" title="Direct link to Passing Data Through">​</a></h3><p>Using the output of one function to feed another input will be a common workflow. Basic operations do not require importing any Python packages. The example below adds a new column, with the 20-day simple moving average, to the existing DataFrame.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;VOO&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> start_date </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;2022-05-15&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SMA&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">ta</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">sma</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Close&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> length </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">20</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The code block below takes the top ten results from the <code>unusual_volume</code> <a href="/sdk/menus/stocks/screener">screener preset</a>, gets a single DataFrame with the daily returns for each ticker YTD, then identifies the date of the best performing day. These operations will require importing the Pandas library to the session.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> pandas </span><span class="token keyword" style="color:rgb(86, 156, 214)">as</span><span class="token plain"> pd</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">results </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">screener</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">screener_data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;unusual_volume&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">tickers </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> results</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">sort_values</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">by </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Volume&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> ascending </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token boolean">False</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">head</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token number" style="color:rgb(181, 206, 168)">10</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Ticker&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">to_list</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">quote</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">tickers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">ytd_returns </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">ca</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">hist</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">tickers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> start_date </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;2023-01-01&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> candle_type </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;r&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">date </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> ytd_returns</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">idxmax</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">returns </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> ytd_returns</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token builtin" style="color:rgb(86, 156, 214)">max</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">max_returns </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> pd</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">concat</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain">date</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain">returns</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> axis </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">1</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">max_returns</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">columns </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Date&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Returns&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">max_returns</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><table><thead><tr><th align="left"></th><th align="left">Date</th><th align="right">Returns</th></tr></thead><tbody><tr><td align="left">GSIT</td><td align="left">2023-05-12 00:00:00</td><td align="right">2.10366</td></tr><tr><td align="left">WISA</td><td align="left">2023-03-27 00:00:00</td><td align="right">0.894737</td></tr><tr><td align="left">LMFA</td><td align="left">2023-05-15 00:00:00</td><td align="right">0.399731</td></tr><tr><td align="left">OKE</td><td align="left">2023-05-05 00:00:00</td><td align="right">0.0300176</td></tr><tr><td align="left">GETR</td><td align="left">2023-05-12 00:00:00</td><td align="right">0.450151</td></tr><tr><td align="left">MMP</td><td align="left">2023-05-15 00:00:00</td><td align="right">0.12994</td></tr><tr><td align="left">ORMP</td><td align="left">2023-05-15 00:00:00</td><td align="right">0.106007</td></tr><tr><td align="left">MGOL</td><td align="left">2023-03-28 00:00:00</td><td align="right">0.322957</td></tr><tr><td align="left">TIVC</td><td align="left">2023-01-12 00:00:00</td><td align="right">0.19</td></tr><tr><td align="left">REAL</td><td align="left">2023-05-08 00:00:00</td><td align="right">0.191304</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="openbb-figure-objects">OpenBB Figure Objects<a href="#openbb-figure-objects" class="hash-link" aria-label="Direct link to OpenBB Figure Objects" title="Direct link to OpenBB Figure Objects">​</a></h3><p>Functions returning a chart will have a boolean argument labeled, <code>external_axes</code>. When this is set as <code>True</code>, and the function&#x27;s output is assigned to a variable, a Plotly figure object is returned, which can be manipulated accordingly. Copy the block below to see all the parameters that can be set.</p><div class="language-jupyterpython codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-jupyterpython codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">data = openbb.stocks.candle(&quot;SPY&quot;, external_axes = True)</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">data?</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><img loading="lazy" src="https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/71f272f4-49eb-42c7-bd93-bd06f364ce32" alt="OpenBB Figure" class="img_ev3q"></p><p>Charts called from a command line session, will open a new window and appear the same as they are in the OpenBB Terminal application.</p><p><img loading="lazy" src="https://user-images.githubusercontent.com/85772166/233247951-e011fe2c-23a6-4518-bd17-3f43a9c2011a.png" alt="OpenBB Terminal Charts" class="img_ev3q"></p><p>See the page <a href="/terminal/usage/basics#charts">here</a> for a detailed explanation of the toolbar.</p><p>To create an empty figure object, import the <code>OpenBBFigure</code> class directly.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> openbb_terminal</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">core</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">plots </span><span class="token keyword" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> OpenBBFigure</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">fig </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> OpenBBFigure</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="chart-themes">Chart Themes<a href="#chart-themes" class="hash-link" aria-label="Direct link to Chart Themes" title="Direct link to Chart Themes">​</a></h3><p>Themes used by the charting and tables libraries are accessible in the SDK through a separate import statement.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> openbb_terminal </span><span class="token keyword" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> theme</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Print the path to the location of the style files with:</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">theme</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">plt_styles_available</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Set the charts theme as light or dark:</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">theme</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">apply_style</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;light&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Refer to the <a href="https://plotly.com/python/templates/" target="_blank" rel="noopener noreferrer">Plotly documentation</a> for details on customizing style sheets.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="chart-cheat-sheet">Chart Cheat Sheet<a href="#chart-cheat-sheet" class="hash-link" aria-label="Direct link to Chart Cheat Sheet" title="Direct link to Chart Cheat Sheet">​</a></h3><p><img loading="lazy" src="https://user-images.githubusercontent.com/85772166/234313541-3d725e1c-ce48-4413-9267-b03571e0eccd.png" alt="OpenBB Chart Cheat Sheet" class="img_ev3q"></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="changing-data-sources">Changing Data Sources<a href="#changing-data-sources" class="hash-link" aria-label="Direct link to Changing Data Sources" title="Direct link to Changing Data Sources">​</a></h3><p>The source of the data can be specified - where more than one is available - by including the <code>source</code> argument in the syntax.</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_m3Ux"><pre tabindex="0" class="prism-code language-python codeBlock_qGQc thin-scrollbar"><code class="codeBlockLines_p187"><span class="token-line" style="color:#9CDCFE"><span class="token plain">polygon </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> source </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Polygon&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">eodhd </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> source </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;EODHD&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">av </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> source </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;AlphaVantage&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">intrinio </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> source </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;Intrinio&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">databento </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> openbb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">stocks</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token plain">load</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&quot;SPY&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> source </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&quot;DataBento&quot;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="support-bug-reports--feedback">Support, Bug Reports &amp; Feedback<a href="#support-bug-reports--feedback" class="hash-link" aria-label="Direct link to Support, Bug Reports &amp; Feedback" title="Direct link to Support, Bug Reports &amp; Feedback">​</a></h2><p>Issues can be raised through the <a href="https://my.openbb.co/app/sdk/support" target="_blank" rel="noopener noreferrer">support page</a> or on <a href="https://github.com/OpenBB-finance/OpenBBTerminal/issues/new/choose" target="_blank" rel="noopener noreferrer">GitHub</a>. You can also chat with the community on <a href="https://openbb.co/discord" target="_blank" rel="noopener noreferrer">Discord</a> to find help or inspiration. Feedback is always welcome.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/OpenBB-finance/OpenBBTerminal/edit/main/website/content/sdk/usage/basics.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2024-01-12T11:39:37.000Z">Jan 12, 2024</time></b> by <b>Danglewood</b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/sdk/usage"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Usage</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/sdk/usage/api-keys"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Setting API Keys</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_jeP5 thin-scrollbar text-sm mt-[48px] xl:max-w-[216px] theme-doc-toc-desktop"><p class="uppercase text-sm font-bold text-grey-600 dark:text-grey-200 tracking-widest mb-2">On this page</p><ul class="border-l border-grey-300 dark:border-grey-600 list-none pl-4"><li class="pb-1"><a href="#overview" class="text-grey-400 capitalize !no-underline">Overview</a></li><li class="py-1"><a href="#importing-the-openbb-sdk" class="text-grey-400 capitalize !no-underline">Importing the OpenBB SDK</a><ul class="list-none ml-1 border-l border-grey-300 dark:border-grey-600 mt-2"><li class="pb-1 pl-3"><a href="#terminal-command-line" class="text-grey-400 capitalize !no-underline">Terminal Command Line</a></li><li class="py-1 pl-3"><a href="#jupyter" class="text-grey-400 capitalize !no-underline">Jupyter</a></li><li class="py-1 pl-3"><a href="#code-editors-and-ides" class="text-grey-400 capitalize !no-underline">Code Editors and IDEs</a></li></ul></li><li class="py-1"><a href="#navigation" class="text-grey-400 capitalize !no-underline">Navigation</a></li><li class="py-1"><a href="#docstrings" class="text-grey-400 capitalize !no-underline">Docstrings</a></li><li class="py-1"><a href="#api-keys" class="text-grey-400 capitalize !no-underline">API Keys</a><ul class="list-none ml-1 border-l border-grey-300 dark:border-grey-600 mt-2"><li class="pb-1 pl-3"><a href="#authorize-with-the-openbb-hub" class="text-grey-400 capitalize !no-underline">Authorize With the OpenBB Hub</a></li></ul></li><li class="py-1"><a href="#how-to-use-the-sdk" class="text-grey-400 capitalize !no-underline">How to Use the SDK</a><ul class="list-none ml-1 border-l border-grey-300 dark:border-grey-600 mt-2"><li class="pb-1 pl-3"><a href="#function-inputs" class="text-grey-400 capitalize !no-underline">Function Inputs</a></li><li class="py-1 pl-3"><a href="#function-responses" class="text-grey-400 capitalize !no-underline">Function Responses</a></li><li class="py-1 pl-3"><a href="#passing-data-through" class="text-grey-400 capitalize !no-underline">Passing Data Through</a></li><li class="py-1 pl-3"><a href="#openbb-figure-objects" class="text-grey-400 capitalize !no-underline">OpenBB Figure Objects</a></li><li class="py-1 pl-3"><a href="#chart-themes" class="text-grey-400 capitalize !no-underline">Chart Themes</a></li><li class="py-1 pl-3"><a href="#chart-cheat-sheet" class="text-grey-400 capitalize !no-underline">Chart Cheat Sheet</a></li><li class="py-1 pl-3"><a href="#changing-data-sources" class="text-grey-400 capitalize !no-underline">Changing Data Sources</a></li></ul></li><li class="py-1"><a href="#support-bug-reports--feedback" class="text-grey-400 capitalize !no-underline">Support, Bug Reports &amp; Feedback</a></li></ul></div></div></div></div></main></div></div><footer class="px-4 border-t dark:border-grey-600/50 lg:px-12 py-14 bg-white dark:bg-grey-850 z-10 overflow-hidden flex flex-col gap-10 items-center justify-center"><div class="flex w-full justify-between md:flex-row"><div class="md:items-start mt-2"><a aria-label="Home" class="hover:text-grey-700 dark:text-white dark:hover:text-gray-50" href="/"><svg viewBox="0 0 170 17" width="170" height="17" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-[14px] w-[140px]"><path d="M106.107 1.889v11.334l-.961-.946-.959-.945-.962-.943-.959-.946-.961-.943-.962-.945-.959-.944-.961-.945-.96-.943-.961-.946-.96-.943-.96-.945H92.66V17H94.582V4.723l.96.943.96.945.961.944.96.945.961.943.959.946.962.943.961.945.959.946.962.943.959.945.961.944.96.945h.961V1.889H106.107ZM137.03 7.557h-1.921V1.889h-11.524V17h15.37V7.546h-1.92l-.005.01Zm-11.524-.946V3.773h7.683v3.78h-7.683V6.61Zm11.524 3.778v4.727h-11.524v-5.67h11.524v.943ZM168.901 7.557h-2.88V1.889h-11.526V0h-1.921v1.889h1.921V17h15.365V7.546l-.959.01Zm-12.485-.946V3.773h7.684v3.78h-7.684V6.61Zm11.526 3.778v4.727h-11.526v-5.67h11.526v.943ZM75.314 1.889H61.867V17H77.23V15.111H63.787V11.332h11.521V9.443H63.788V3.777H77.23V1.89h-1.916ZM13.444 1.889H0V17h15.367V1.889h-1.922Zm0 2.834V15.11H1.918V3.773h11.527v.95ZM44.397 1.889H30.952V17h1.92v-5.666h13.445V1.88h-1.92v.009Zm0 2.834V9.45H32.873V3.773h11.524v.95Z" fill="currentColor"></path></svg></a></div><div class="justify-end"><a class="flex h-[32px] w-[172px] rounded-md border border-grey-300 hover:bg-grey-100 dark:border-white bg-grey-100 dark:bg-white text-xs hover:no-underline" href="https://github.com/OpenBB-finance/OpenBBTerminal" target="_blank" rel="noreferrer"><span class="inline-flex w-[60%] items-center gap-x-[6px] px-3 py-2 text-grey-800"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-bottom:3px" class="h-[14.67px] w-[14.67px]"><path d="m12 1 3.263 7.439L23 9.403l-5.72 5.562L18.798 23 12 18.999 5.202 23l1.518-8.035L1 9.403l7.737-.964L12 1Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path></svg>Star us</span><span class="inline-flex w-[40%] items-center justify-center rounded-r-md bg-grey-850 text-grey-200">0</span></a></div></div><div class="flex w-full flex-col items-center justify-between gap-4 md:flex-row md:gap-0"><div class="flex flex-col items-start justify-end gap-4 self-start font-light text-grey-500 md:flex-row md:items-center"><p class="text-sm">© 2024 OpenBB</p><div class="_divider-x hidden h-[20px] border-[0.5px] md:block"></div><a href="https://openbb.co/legal/privacy-policy" target="_blank" rel="noopener noreferrer" class="text-sm dark:hover:text-white">Privacy Policy</a><div class="_divider-x hidden h-[20px] border-[0.5px] md:block"></div><a href="https://openbb.co/legal/terms-of-service" target="_blank" rel="noopener noreferrer" class="text-sm dark:hover:text-white">Terms</a></div><div class="mt-4 mb-10 grid grid-cols-4 gap-4 self-start md:my-0 md:grid-cols-7 md:self-end"><a aria-label="GitHub Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://github.com/OpenBB-finance/OpenBBTerminal"><svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M6 12.76c-3.333 1-3.333-1.667-4.667-2l4.667 2Zm4.667 2v-2.58a2.246 2.246 0 0 0-.627-1.74c2.094-.233 4.294-1.027 4.294-4.667 0-.93-.359-1.825-1-2.5a3.38 3.38 0 0 0-.06-2.513s-.787-.233-2.607.987a8.92 8.92 0 0 0-4.667 0C4.18.527 3.393.76 3.393.76a3.38 3.38 0 0 0-.06 2.513 3.627 3.627 0 0 0-1 2.52c0 3.614 2.2 4.407 4.294 4.667A2.248 2.248 0 0 0 6 12.18v2.58" fill="currentColor"></path><path d="M10.667 14.76v-2.58a2.246 2.246 0 0 0-.627-1.74c2.094-.233 4.294-1.027 4.294-4.667 0-.93-.359-1.825-1-2.5a3.38 3.38 0 0 0-.06-2.513s-.787-.233-2.607.987a8.92 8.92 0 0 0-4.667 0C4.18.527 3.393.76 3.393.76a3.38 3.38 0 0 0-.06 2.513 3.627 3.627 0 0 0-1 2.52c0 3.614 2.2 4.407 4.294 4.667A2.248 2.248 0 0 0 6 12.18v2.58m0-2c-3.333 1-3.333-1.667-4.667-2l4.667 2Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></a><a aria-label="LinkedIn Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://www.linkedin.com/company/openbb-finance/"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M13 21H9V9h4v2a4.618 4.618 0 0 1 3.525-1.763A4.5 4.5 0 0 1 21 13.75V21h-4v-6.75a2.265 2.265 0 0 0-2.247-1.944A1.815 1.815 0 0 0 13 14.25V21Zm-6 0H3V9h4v12ZM5 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z" fill="currentColor"></path></svg></a><a aria-label="Twitter Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://twitter.com/openbb_finance"><svg viewBox="0 0 24 24" width="10" height="10" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" fill="#E7E9EA"></path></svg></a><a aria-label="Tiktok Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://www.tiktok.com/@openbb"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" class="h-5 w-5 pl-[2.5px]"><path d="M0 0h24v24H0z" stroke="none"></path><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"></path></svg></a><a aria-label="Reddit Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://www.reddit.com/r/openbb/"><svg viewBox="0 0 16 16" width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M8 14.667A6.667 6.667 0 1 1 14.667 8 6.674 6.674 0 0 1 8 14.667ZM4.538 7.029a.973.973 0 0 0-.405 1.858 1.707 1.707 0 0 0 0 .292c0 1.494 1.743 2.708 3.886 2.708 2.142 0 3.886-1.214 3.886-2.708a1.857 1.857 0 0 0 0-.292.96.96 0 0 0-.432-1.825h-.035a.97.97 0 0 0-.638.271 4.744 4.744 0 0 0-2.567-.82l.434-2.08 1.425.3a.667.667 0 0 0 .735.591A.667.667 0 1 0 10.685 4a.667.667 0 0 0-.506.328L8.547 4a.207.207 0 0 0-.244.158l-.499 2.315a4.749 4.749 0 0 0-2.6.82.967.967 0 0 0-.666-.264Zm3.582 3.987h-.225a2.568 2.568 0 0 1-1.534-.515.18.18 0 0 1 .139-.294.18.18 0 0 1 .114.04c.374.274.825.421 1.289.42h.216c.457 0 .903-.143 1.274-.41a.187.187 0 0 1 .267 0 .19.19 0 0 1-.003.267v-.027a2.557 2.557 0 0 1-1.537.518v.001Zm1.418-1.63h-.01l.005-.025a.626.626 0 1 1 .49-.188.659.659 0 0 1-.462.214h-.024.001Zm-3.091-.053a.667.667 0 1 1 0-1.333.667.667 0 0 1 0 1.333Z" fill="currentColor"></path></svg></a><a aria-label="Discord Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer" href="https://discord.gg/xPHTuHCmuV"><svg viewBox="0 0 16 12" width="16" height="12" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M13.38 8.836a4.375 4.375 0 0 1-2.474 1.507c.407.481.897 1.025.901 1.03 1.655.033 3.221-.688 4.193-1.929-.05-2.572-.724-5.1-1.973-7.397A7.139 7.139 0 0 0 10.194.71h-.016l-.192.203a9.52 9.52 0 0 1 3.412 1.61 11.875 11.875 0 0 0-4.125-1.217 12.415 12.415 0 0 0-2.766.025c-.065.001-.13.008-.193.019h-.04a10.98 10.98 0 0 0-3.11.801c-.493.21-.796.362-.809.368-.013.005 0 0 0-.01A10.022 10.022 0 0 1 5.96.866L5.815.714h-.009a7.142 7.142 0 0 0-3.833 1.335A16.003 16.003 0 0 0 0 9.447c.96 1.249 2.528 1.972 4.182 1.929 0 0 .517-.583.92-1.054a4.307 4.307 0 0 1-2.405-1.496c.01.006.153.096.384.213a.17.17 0 0 0 .056.04.409.409 0 0 0 .058.031 8.043 8.043 0 0 0 1.064.462c.653.24 1.33.423 2.019.548.604.106 1.217.16 1.832.16.576 0 1.15-.049 1.717-.146a9.64 9.64 0 0 0 1.986-.546 8.203 8.203 0 0 0 1.566-.752Zm-2.94-.57c-.627.05-1.224-.26-1.502-.784a1.335 1.335 0 0 1 .244-1.581 1.612 1.612 0 0 1 1.68-.363c.586.212.973.735.973 1.319.032.745-.592 1.374-1.396 1.41h.001Zm-5.001 0c-.79-.064-1.395-.676-1.395-1.41 0-.733.606-1.345 1.395-1.408.363 0 .71.138.963.38.286.276.442.645.433 1.027.033.747-.59 1.378-1.396 1.411Z" fill="currentColor"></path></svg></a><a aria-label="Youtube Link" class="h-8 w-8 dark:hover:!text-white hover:text-grey-700" target="_blank" rel="noreferrer noopener" href="https://www.youtube.com/channel/UCaeFEx-W16IuxRsHlM1ywBQ"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2c.313-1.732.467-3.49.46-5.25a29.005 29.005 0 0 0-.46-5.33v0Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="m9.75 15.017 5.75-3.27-5.75-3.27v6.54Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></a></div></div></footer></div>
<script src="/assets/js/runtime~main.971adda6.js"></script>
<script src="/assets/js/main.875c0435.js"></script>
</body>
</html>