CINXE.COM
Trading Economics - API
<!doctype html> <html > <head id="ctl00_Head1"><meta charset="utf-8" /><title> Trading Economics - API </title><meta id="metaDesc" name="description" content="Get Free Economic Indicators Charts, Historical Data and Forecasts for 196 Countries." /><meta id="metaKeyword" name="keywords" content="Economic Indicators, Data, Charts" /><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,maximum-scale=1" /><meta name="theme-color" content="#333333" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css" integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.10.2/font/bootstrap-icons.min.css" integrity="sha512-YFENbnqHbCRmJt5d+9lHimyEMt8LKSNTMLSaHjvsclnZGICeY/0KYEeiHwD1Ux4Tcao0h60tdcMv+0GljvWyHg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link href="//d3fy651gv2fhd3.cloudfront.net/stylesheet.min.css?v=20241101b" rel="stylesheet" /> <script type="text/javascript">var TEChartSettings = {}; var TESymbol = ''; var TECountry = ''; var TECategory = ''; var TEFrequency = ''; var TELanguage = ''; var TELastUpdate = '20241031000000'; var TEChartVersion = ''; var symbol = ''; var symbolType = ''; var hasCalendar = false; var isLoggedIn = false; var TEAlertsName = ''; var TEChartsDatasource = 'https://d3ii0wo49og5mi.cloudfront.net'; var IsMobile = false; var TEChartsMeta = ''; var TEForecast = []; var TEAuthorization = ''; var TESecurify = ''; var TESecurifyUrl = ''; var TEType = ''; var TEChartUrl = '/api/?source=menu'; var TEComparable = 0; var isAlertsLoaded = false; var IsDarkMode = false; var isPakoLoaded = false; var TEChartsToken = '20240229:nazare'; var TEObfuscationkey = 'tradingeconomics-charts-core-api-key'; var isCopyright = false;</script> <script type="text/javascript">var DEBUG = false;if (window.location.host.indexOf('localhost') > -1) DEBUG = true;else if (window.location.href.indexOf('debug') > -1) DEBUG = true;if (!DEBUG) {if (!window.console) window.console = {};var methods = ["log", "debug", "info"];for (var i = 0; i < methods.length; i++) {console[methods[i]] = function () { };}}</script> <link rel="icon" href="//d3fy651gv2fhd3.cloudfront.net/favicon.ico" /><link rel="canonical" href="https://tradingeconomics.com/api/?source=menu" /></head> <body > <script>IsDarkMode=false;</script> <form method="post" action="./?source=menu" id="aspnetForm"> <div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="Q7JapVyQV8nfnrlhGp6c94DG58KB0fRBba8+lxsQaWqI2fDukfrcMtUmCmvC5+NjQP6dXWPZpfraCg38KC0yDYbMb5w=" /> </div> <div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="161BE38B" /> </div> <nav id="ctl00_NavigationUC1_ctl00_menu" class="navbar navbar-dark fixed-top" role="navigation"> <div class="container"> <div class="navbar-header navbar-header-search" id="searchMobileHeader"> <div class="d-flex justify-content-between"> <a class="navbar-brand" style="width: 100%"> <input type="text" placeholder="Search" id="thisIstheTinySearchBoxIdTag" autocomplete="off" class="nav-search-input-class navbar-search-2" /> </a> <ul id="thisIstheTinySearchResultsIdTag" class="dropdown-menu navbar-search-1"> <li> <div class="container-fluid"> <div id="dpSearch-resultCnt-tiny" class="dpTaResult"> </div> </div> </li> </ul> <div class="navbar-mobile-close-search"> <a noref class="navbar-mobile-item" id="thisIsTheTinyRemoveId"><i class="bi bi-x-lg"></i></a> </div> </div> </div> <div class="navbar-header navbar-collapse float-end" id="mainHeader"> <div class="d-flex"> <button type="button" class="navbar-toggler" data-bs-toggle="offcanvas" data-bs-target="#tesidemenu" aria-controls="tesidemenuoptions"> <span class="navbar-toggler-icon"></span> </button> <div class="logo-banner d-flex justify-content-between float-right"> <a class="navbar-brand" href="/"> <svg width="129" height="35" version="1.1" viewBox="0 0 34.131 9.2604" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" aria-label = "Trading Economics logo"> <g fill="#858585" stroke="#858585" stroke-width=".1" ><path d="m1.3315 8.5517v-3.7879h2.8086v0.64079h-2.0438v0.83974h1.9017v0.6382h-1.9017v1.0309h2.1162v0.6382z"/><path d="m7.2846 7.1591 0.74156 0.23513q-0.17053 0.62012-0.56844 0.92242-0.39532 0.29972-1.0051 0.29972-0.75448 0-1.2402-0.51418-0.48576-0.51676-0.48576-1.4108 0-0.94568 0.48834-1.4676 0.48834-0.52452 1.2842-0.52452 0.69505 0 1.1291 0.41083 0.25838 0.24288 0.38757 0.69763l-0.75706 0.18087q-0.067179-0.29456-0.28164-0.46509-0.21187-0.17053-0.51676-0.17053-0.42116 0-0.68471 0.30231-0.26097 0.30231-0.26097 0.97927 0 0.7183 0.25838 1.0232 0.25838 0.30489 0.67179 0.30489 0.30489 0 0.52452-0.19379 0.21962-0.19379 0.31523-0.60978z"/><path d="m8.5275 6.681q0-0.57878 0.17312-0.97152 0.12919-0.28939 0.3514-0.51935 0.22479-0.22996 0.49093-0.34106 0.35398-0.14986 0.81649-0.14986 0.83716 0 1.3384 0.51935 0.50385 0.51935 0.50385 1.4444 0 0.91726-0.49868 1.4366-0.49868 0.51676-1.3333 0.51676-0.84491 0-1.3436-0.51418-0.49868-0.51676-0.49868-1.4211zm0.78807-0.025838q0 0.64337 0.29714 0.97669 0.29714 0.33073 0.75448 0.33073 0.45734 0 0.74931-0.32815 0.29456-0.33073 0.29456-0.9896 0-0.65112-0.2868-0.97152-0.28422-0.32039-0.75706-0.32039-0.47284 0-0.76223 0.32556-0.28939 0.32298-0.28939 0.97669z"/><path d="m12.806 8.5517v-3.7879h0.74414l1.5503 2.5296v-2.5296h0.71055v3.7879h-0.7674l-1.527-2.4701v2.4701z"/><path d="m16.465 6.681q0-0.57878 0.17312-0.97152 0.12919-0.28939 0.3514-0.51935 0.22479-0.22996 0.49093-0.34106 0.35398-0.14986 0.81649-0.14986 0.83716 0 1.3384 0.51935 0.50384 0.51935 0.50384 1.4444 0 0.91726-0.49868 1.4366-0.49868 0.51676-1.3333 0.51676-0.84491 0-1.3436-0.51418-0.49868-0.51676-0.49868-1.4211zm0.78807-0.025838q0 0.64337 0.29714 0.97669 0.29714 0.33073 0.75448 0.33073t0.74931-0.32815q0.29456-0.33073 0.29456-0.9896 0-0.65112-0.2868-0.97152-0.28422-0.32039-0.75706-0.32039t-0.76223 0.32556q-0.28939 0.32298-0.28939 0.97669z"/><path d="m20.726 8.5517v-3.7879h1.1446l0.6873 2.5838 0.67955-2.5838h1.1472v3.7879h-0.71055v-2.9817l-0.75189 2.9817h-0.73639l-0.74931-2.9817v2.9817z"/><path d="m25.121 8.5517v-3.7879h0.76481v3.7879z"/><path d="m29.038 7.1591 0.74156 0.23513q-0.17053 0.62012-0.56844 0.92242-0.39532 0.29972-1.0051 0.29972-0.75448 0-1.2402-0.51418-0.48576-0.51676-0.48576-1.4108 0-0.94568 0.48834-1.4676 0.48834-0.52452 1.2842-0.52452 0.69505 0 1.1291 0.41083 0.25838 0.24288 0.38757 0.69763l-0.75706 0.18087q-0.06718-0.29456-0.28164-0.46509-0.21187-0.17053-0.51676-0.17053-0.42116 0-0.68471 0.30231-0.26097 0.30231-0.26097 0.97927 0 0.7183 0.25838 1.0232 0.25838 0.30489 0.67179 0.30489 0.30489 0 0.52452-0.19379 0.21962-0.19379 0.31523-0.60978z"/><path d="m30.242 7.3193 0.74414-0.072347q0.06718 0.37465 0.2713 0.55035 0.2067 0.1757 0.55552 0.1757 0.36949 0 0.55552-0.15503 0.18862-0.15761 0.18862-0.3669 0-0.13436-0.0801-0.22738-0.077514-0.095602-0.27388-0.16536-0.13436-0.046509-0.61237-0.16536-0.61495-0.15245-0.863-0.37465-0.34882-0.31264-0.34882-0.76223 0-0.28939 0.16278-0.54002 0.16536-0.25321 0.47284-0.38499 0.31006-0.13178 0.74672-0.13178 0.71314 0 1.0723 0.31264 0.36174 0.31264 0.37982 0.83457l-0.76481 0.03359q-0.04909-0.29197-0.21187-0.41858-0.1602-0.12919-0.48317-0.12919-0.33331 0-0.52193 0.13694-0.12144 0.08785-0.12144 0.23513 0 0.13436 0.11369 0.22996 0.14469 0.12144 0.7028 0.25321t0.82424 0.27389q0.26872 0.13953 0.41858 0.38499 0.15244 0.24288 0.15244 0.60203 0 0.32556-0.18087 0.60978-0.18087 0.28422-0.5116 0.42375-0.33073 0.13694-0.82424 0.13694-0.7183 0-1.1033-0.33073-0.38499-0.33331-0.45992-0.96893z"/></g> <g fill="#ddd" stroke="#ddd" stroke-width=".1" ><path d="m1.4629 4.2437v-2.8324h-1.0116v-0.57671h2.7091v0.57671h-1.0092v2.8324z"/><path d="m3.607 4.2437v-3.4091h1.4487q0.54648 0 0.79297 0.093018 0.24882 0.090692 0.39765 0.32556 0.14883 0.23487 0.14883 0.53718 0 0.3837-0.22557 0.63484-0.22557 0.24882-0.67438 0.31393 0.22324 0.13022 0.36742 0.28603 0.1465 0.1558 0.393 0.55345l0.41625 0.66508h-0.82321l-0.49764-0.74182q-0.2651-0.39765-0.36277-0.49997-0.097668-0.10464-0.20696-0.14185-0.1093-0.039532-0.34649-0.039532h-0.13953v1.4232zm0.68833-1.9673h0.50927q0.49532 0 0.61857-0.041858t0.19301-0.14418q0.069763-0.10232 0.069763-0.2558 0-0.17208-0.093018-0.27673-0.090692-0.10697-0.25812-0.13488-0.083716-0.011627-0.50229-0.011627h-0.53718z"/><path d="m10.118 4.2437h-0.74879l-0.29766-0.77437h-1.3627l-0.28138 0.77437h-0.73019l1.3278-3.4091h0.72786zm-1.2674-1.3488-0.46974-1.265-0.46044 1.265z"/><path d="m10.481 0.8346h1.2581q0.42556 0 0.6488 0.065112 0.29998 0.088367 0.51392 0.31393 0.21394 0.22557 0.32556 0.55345 0.11162 0.32556 0.11162 0.8046 0 0.4209-0.10464 0.72554-0.1279 0.37207-0.36509 0.60229-0.17906 0.17441-0.48369 0.27208-0.22789 0.072089-0.60926 0.072089h-1.2953zm0.68833 0.57671v2.258h0.51392q0.28835 0 0.41625-0.032556 0.16743-0.041858 0.27673-0.14185 0.11162-0.099994 0.18138-0.32789 0.06976-0.23022 0.06976-0.62554t-0.06976-0.60694-0.19534-0.33021q-0.12557-0.1186-0.31858-0.16046-0.14418-0.032556-0.56508-0.032556z"/><path d="m13.902 4.2437v-3.4091h0.68833v3.4091z"/><path d="m15.253 4.2437v-3.4091h0.66973l1.3953 2.2766v-2.2766h0.6395v3.4091h-0.69066l-1.3743-2.2231v2.2231z"/><path d="m20.271 2.9903v-0.57438h1.4836v1.3581q-0.21627 0.20929-0.62787 0.36974-0.40928 0.15813-0.83018 0.15813-0.53485 0-0.9325-0.22324-0.39765-0.22557-0.59764-0.64182-0.19999-0.41858-0.19999-0.90925 0-0.53253 0.22324-0.94645 0.22324-0.41393 0.65345-0.63484 0.32789-0.16976 0.81623-0.16976 0.63484 0 0.99064 0.26743 0.35812 0.2651 0.46044 0.73484l-0.68368 0.1279q-0.072088-0.25115-0.27208-0.39532-0.19766-0.1465-0.49532-0.1465-0.45114 0-0.71856 0.28603-0.2651 0.28603-0.2651 0.84879 0 0.60694 0.26975 0.91157 0.26975 0.30231 0.70693 0.30231 0.21627 0 0.43253-0.083716 0.21859-0.086041 0.3744-0.20696v-0.43253z"/></g> </svg> </a> <div class="d-flex align-items-center nav-options"> <div class="d-flex align-items-center nav-entry-link-group"> <a class="nav-entry-link d-none d-md-block" href="/calendar"><span>Calendar</span></a> <a class="nav-entry-link d-none d-md-block" href="/stream"><span>News</span></a> <div class="dropdown"> <a href="#" class="dropdown d-flex nav-entry-link d-none d-md-block" data-bs-toggle="dropdown"><span>Markets</span></a> <ul class="dropdown-menu nav-dropdown-menu"> <li class='dropdown-item nav-dropdown-item'><a href="/commodities">Commodities</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/currencies">Currencies</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/stocks">Stocks</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/bonds">Bonds</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/crypto">Crypto</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/earnings">Earnings</a></li> </ul> </div> <a class="nav-entry-link d-none d-lg-block" href="/indicators"><span>Indicators</span></a> <a class="nav-entry-link d-none d-xl-block" href="/countries"><span >Countries</span></a> <div class="dropdown"> <a href="#" class="dropdown d-flex nav-entry-link d-none d-md-block" data-bs-toggle="dropdown"><span>Forecasts</span></a> <ul class="dropdown-menu nav-dropdown-menu"> <li class='dropdown-item nav-dropdown-item'><a href="/forecast/commodity">Commodities</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/forecast/currency">Currencies</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/forecast/stock-market">Stocks</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/forecast/government-bond-10y">Bonds</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/forecast/crypto">Crypto</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/forecasts">Countries</a></li> <li class='dropdown-item nav-dropdown-item'><a href="/indicators?g=forecast">Indicators</a></li> </ul> </div> </div> <div class="search-li d-none d-lg-block"> <a noref id="thisIsTheSearchPlaceholderId" class="nav-searchbox-class stickydropdown d-block" title="Search"> <div id="thisIsTheSearchBoxWrapperId" class="typeahead-searchbox-glyphicon-wrapper d-flex "> <input type="text" placeholder="Search" aria-label="Search" id="thisIstheSearchBoxIdTag" autocomplete="off" class="d-none d-md-block nav-search-input-class"> </div> </a> <ul id="thisIstheSearchResultsIdTag" class="dropdown-menu nav-dropdown-menu typeahead-wrapper"> <li> <div class="container"> <div id="dpSearch-resultCnt" class="dpTaResult"> </div> </div> </li> </ul> </div> <div> <a class="d-block d-lg-none navbar-mobile-item" id="thisIsTheTinyGlyphiconId"><i class="bi bi-search me-2"></i></a> </div> <div class="dropdown dropdown-notification-list"> <button class="btn btn-notification-list" type="button" id="dropdownNotificationList" data-bs-toggle="offcanvas" data-bs-target="#offcanvasTop"> <svg xmlns="http://www.w3.org/2000/svg" width="21px" height="21px" viewBox="0 0 24 24" id="notification-empty" style="vertical-align:middle !important" data-name="notification-empty"><rect id="view-box" width="24" height="24" fill="none"/><path id="Shape" d="M6,17v-.5H2.25A2.253,2.253,0,0,1,0,14.25v-.382a2.542,2.542,0,0,1,1.415-2.289A1.248,1.248,0,0,0,2.1,10.572l.446-4.91a6.225,6.225,0,0,1,12.4,0l.446,4.91a1.26,1.26,0,0,0,.686,1.005,2.547,2.547,0,0,1,1.418,2.29v.382a2.252,2.252,0,0,1-2.25,2.25H11.5V17A2.75,2.75,0,0,1,6,17Zm1.5,0A1.25,1.25,0,0,0,10,17v-.5H7.5ZM4.045,5.8,3.6,10.708A2.738,2.738,0,0,1,2.089,12.92a1.055,1.055,0,0,0-.589.949v.382A.751.751,0,0,0,2.25,15h13A.751.751,0,0,0,16,14.25v-.382a1.054,1.054,0,0,0-.586-.948A2.739,2.739,0,0,1,13.9,10.708L13.456,5.8a4.725,4.725,0,0,0-9.411,0Z" transform="translate(3.25 2.25)" fill="#ddd"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="21px" height="21px" viewBox="0 0 24 24" id="notification-new" style="vertical-align:middle !important; display:none" data-name="notification-new"><rect id="view-box" width="24" height="24" fill="none" /><path id="Shape" d="M6,17v-.5H2.25A2.253,2.253,0,0,1,0,14.25v-.382a2.542,2.542,0,0,1,1.415-2.289A1.247,1.247,0,0,0,2.1,10.572l.446-4.91A6.227,6.227,0,0,1,10.618.286a5.477,5.477,0,0,0-.635,1.374A4.794,4.794,0,0,0,8.75,1.5,4.7,4.7,0,0,0,4.045,5.8L3.6,10.708A2.739,2.739,0,0,1,2.089,12.92a1.055,1.055,0,0,0-.589.949v.382A.751.751,0,0,0,2.25,15h13A.751.751,0,0,0,16,14.25v-.382a1.053,1.053,0,0,0-.586-.948A2.739,2.739,0,0,1,13.9,10.708l-.2-2.18a5.473,5.473,0,0,0,1.526.221l.166,1.822a1.26,1.26,0,0,0,.686,1.005,2.547,2.547,0,0,1,1.418,2.29v.382a2.252,2.252,0,0,1-2.25,2.25H11.5V17A2.75,2.75,0,0,1,6,17Zm1.5,0A1.25,1.25,0,0,0,10,17v-.5H7.5ZM15.047,6.744A3.486,3.486,0,0,1,13.5,6.28L13.456,5.8a4.7,4.7,0,0,0-1.648-3.185,3.5,3.5,0,0,1,.61-1.417A6.221,6.221,0,0,1,14.95,5.662l.1,1.081v0Z" transform="translate(3.25 2.25)" fill="#ddd" /> <path id="Shape-2" data-name="Shape" d="M3.5,7A3.5,3.5,0,1,1,7,3.5,3.5,3.5,0,0,1,3.5,7Z" transform="translate(15 2)" fill="#4287f5" /> </svg> </button> <div class="offcanvas offcanvas-top notification-list container custom-offcanvas" tabindex="-1" id="offcanvasTop" data-bs-scroll="true" aria-labelledby="offcanvasTopLabel" style="top:50px !important; border: var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);"> <div class="empty-notificationlist"> <div class="empty-notificationlist-content"> <span>You have no new notifications</span> <br> <i class="bi bi-bell-slash-fill"></i> <br> <div><a href="/stream" title="Show all news" class="empty-notificationlist-more"><div class="btn btn-outline-secondary">All News</div></a></div> </div> </div> </div> </div> <div class="userOptionsMenu"> <a title="" data-bs-toggle="offcanvas" href="#offcanvasGuest" role="button" aria-controls="offcanvasGuest"><i class="bi bi-person"></i></a> </div> </div> </div> </div> </div> <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasGuest" aria-labelledby="offcanvasGuestLabel"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="offcanvasGuestLabel"><b>Members</b></h5> <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> <div class="offcanvas-body user-offcanvas-body"> <div class="list-group list-group-user"> <a href="/analytics/pricing.aspx?source=menu " class="user-item list-group-item"> <b class="list-group-item-heading"><i class="bi bi-save2-fill me-2"></i> DATA PLANS</b><br> <span class="list-group-item-text">Download historical data for 20 million indicators using your browser.</span> </a> <div class="user-item list-group-item"> <div class="navbar-user-link"> <a href="/analytics/pricing.aspx?source=menu" class="navbar-te-link mx-1">Subscription Plans</a> | <a href="/analytics/features.aspx?source=menu" class="navbar-te-link mx-1">Features</a> </div> </div> </div> <div class="list-group list-group-user"> <a href="/api/" class="user-item list-group-item"> <b class="list-group-item-heading"><i class="bi bi-phone mx-1 me-2"></i>API GATEWAY</b><br> <span class="list-group-item-text mx-1">Direct access to our data from your apps using any programing language.</span> </a> <div class="user-item list-group-item"> <div> <a href="https://docs.tradingeconomics.com/" target="_blank" class="navbar-te-link mx-1">Docs</a> | <a href="/api/?source=menu" class="navbar-te-link mx-1">Features</a> | <a href="https://developer.tradingeconomics.com/" class="navbar-te-link mx-1">Developer</a> </div> </div> </div> <div class="list-group list-group-user"> <a class="user-item list-group-item" href="https://sso.tradingeconomics.com/sso/login?returnurl=https://tradingeconomics.com/api/?source=menu"><i class="bi bi-person-fill"></i> Already a user? <b>Login</b></a> </div> <style> .form-switch { width: 3.5em !important; height: 2em !important } .bi-sun-fill { font-size: 12px; color: #ddd !important; } .bi-moon-fill { font-size: 10px; color: #333 !important; } .darkmode-toggle-container { width: auto; padding: 0px; margin-left: 0px; margin-top: 0px; border: none; } .form-check-div-sun { width: 20px; margin-bottom: 3px; margin-left: -54px; position: relative } .form-check-div-moon { width: 20px; margin-bottom: 3px; margin-left: 3px; position: relative } .dk-switch-right-menu{ padding-left:10px; } </style> <div class="list-group list-group-user dk-switch-right-menu"> <div class="d-flex align-items-center darkmode-toggle-container"> <div class="form-check form-switch darkmode-form-switch user-item"> <input class="form-check-input p-1" type="checkbox" role="button" id="flexSwitchCheckChecked"> </div> <div class="form-check-div-sun"> <label class="form-check-label form-check-label-sun p-1 d-inline" for="flexSwitchCheckChecked"><i class="bi bi-sun-fill"></i></label> </div> <div class="form-check-div-moon"> <label class="form-check-label form-check-label-moon p-1 d-inline" for="flexSwitchCheckChecked"><i class="bi bi-moon-fill"></i></label> </div> </div> </div> <script> function SetTheme(isDark) { console.log('Changing theme', isDark); if (IsDarkMode != isDark) { IsDarkMode = isDark; document.body.classList.toggle("dark-theme"); // Set cookie const d = new Date(); d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); let expires = "expires=" + d.toUTCString(); document.cookie = "IsDarkMode" + "=" + IsDarkMode + ";" + expires + ";path=/"; IsDarkMode ? ga('event', 'te_darkmode_on') : ga('event', 'te_darkmode_off'); window.location.reload(); } } document.addEventListener('DOMContentLoaded', function () { let checkbox = document.getElementById("flexSwitchCheckChecked"); let sundiv = document.getElementsByClassName("form-check-label-sun")[0]; let moondiv = document.getElementsByClassName("form-check-label-moon")[0]; if (IsDarkMode) { sundiv.classList.add("d-none"); moondiv.classList.remove("d-none"); } else { moondiv.classList.add("d-none"); sundiv.classList.remove("d-none"); } checkbox.checked = IsDarkMode; }); document.getElementById("flexSwitchCheckChecked").addEventListener("change", function () { SetTheme(!IsDarkMode) }); </script> </div> </div> <div class="offcanvas offcanvas-start" tabindex="-1" id="tesidemenu" aria-labelledby="tesidemenuoptions"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="offcanvasWithBothOptionsLabel"></h5> <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> <div class="offcanvas-body"> <div class="row navbar-nav-scroll" style="--bs-scroll-height: 95vh;"> <div class="accordion" id="accordionNavbar"> <div class="accordion-item"> <div class="accordion-header menu-main-option"><a class="nav-link accordion-button navmenu-mobile-item" href="/calendar" target="_self"><i class="bi bi-calendar3 me-2"></i>Calendar</a></div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option"><a class="nav-link accordion-button navmenu-mobile-item" href="/stream" target="_self"><i class="bi bi-layout-text-sidebar me-2"></i>News</a></div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMarkets" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-arrow-down-up me-2"></i>Markets <i class="bi bi-caret-up-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseMarkets" class="accordion-collapse collapse show" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="/currencies" target="_self">Currencies</a></li> <li><a class="navmobile-link nav-link" href="/stocks" target="_self">Stocks</a></li> <li><a class="navmobile-link nav-link" href="/commodities" target="_self">Commodities</a></li> <li><a class="navmobile-link nav-link" href="/bonds" target="_self">Bonds</a></li> <li><a class="navmobile-link nav-link" href="/crypto" target="_self">Crypto</a></li> <li><a class="navmobile-link nav-link" href="/earnings" target="_self">Earnings</a></li> <li><a class="navmobile-link nav-link" href="/holidays" target="_self">Holidays</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseCountries" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-globe me-2"></i>Countries<i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseCountries" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="/united-states/indicators" target="_self">United States</a></li> <li><a class="navmobile-link nav-link" href="/united-kingdom/indicators" target="_self">United Kingdom</a></li> <li><a class="navmobile-link nav-link" href="/euro-area/indicators" target="_self">Euro Area</a></li> <li><a class="navmobile-link nav-link" href="/australia/indicators" target="_self">Australia</a></li> <li><a class="navmobile-link nav-link" href="/canada/indicators" target="_self">Canada</a></li> <li><a class="navmobile-link nav-link" href="/japan/indicators" target="_self">Japan</a></li> <li><a class="navmobile-link nav-link" href="/china/indicators" target="_self">China</a></li> <li><a class="navmobile-link nav-link" href="/brazil/indicators" target="_self">Brazil</a></li> <li><a class="navmobile-link nav-link" href="/russia/indicators" target="_self">Russia</a></li> <li><a class="navmobile-link nav-link" href="/india/indicators" target="_self">India</a></li> <li><a class='navmobile-link nav-link' href="/countries" target="_self"><i class="bi bi-plus-square me-2"></i>More Countries</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseIndicators" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-bar-chart-fill me-2"></i>Indicators <i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseIndicators" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="/country-list/interest-rate" target="_self">Interest Rate</a></li> <li><a class="navmobile-link nav-link" href="/country-list/inflation-rate" target="_self">Inflation Rate</a></li> <li><a class="navmobile-link nav-link" href="/country-list/unemployment-rate" target="_self">Unemployment Rate</a></li> <li><a class="navmobile-link nav-link" href="/country-list/gdp-growth-rate" target="_self">GDP Growth</a></li> <li><a class="navmobile-link nav-link" href="/country-list/gdp-per-capita" target="_self">GDP per Capita</a></li> <li><a class="navmobile-link nav-link" href="/country-list/current-account-to-gdp" target="_self">Current Account</a></li> <li><a class="navmobile-link nav-link" href="/country-list/gold-reserves" target="_self">Gold Reserves</a></li> <li><a class="navmobile-link nav-link" href="/country-list/government-debt-to-gdp" target="_self">Government Debt</a></li> <li><a class="navmobile-link nav-link" href="/country-list/crude-oil-production" target="_self">Crude Oil Production</a></li> <li><a class="navmobile-link nav-link" href="/country-list/gasoline-prices" target="_self">Gasoline Prices</a></li> <li><a class="navmobile-link nav-link" href="/country-list/rating" target="_self">Credit Rating</a></li> <li><a class='navmobile-link nav-link' href="/indicators" target="_self"><i class="bi bi-plus-square me-2"></i>More Indicators</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseForecasts" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-graph-down-arrow me-2"></i>Forecasts <i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseForecasts" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li class="d-block d-sm-none"><a class="navmobile-link nav-link" href="/indicators?g=forecast" target="_self">Markets & Indicators</a></li> <li class="d-block d-sm-none"><a class="navmobile-link nav-link" href="/forecasts" target="_self">Countries</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecasts">Countries</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/indicators?g=forecast">Indicators</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecast/currency">Currencies</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecast/stock-market">Stocks</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecast/commodity">Commodities</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecast/government-bond-10y">Bonds</a></li> <li class="d-none d-sm-block"><a class='navmobile-link nav-link' href="/forecast/crypto">Crypto</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSolutions" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-code-square me-2"></i>Solutions <i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseSolutions" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="/analytics/features.aspx" title="Register">Data Subscriptions</a></li> <li><a class="navmobile-link nav-link" href="/api/" title="Register">API Access</a></li> <li><a class="navmobile-link nav-link" href="/analytics/pricing.aspx?source=nav">Pricing</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseApps" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-phone me-2"></i>Apps <i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseApps" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="https://itunes.apple.com/us/app/trading-economics/id1142178921?mt=8" target="_self">App Store</a></li> <li><a class="navmobile-link nav-link" href="https://play.google.com/store/apps/details?id=com.tradingeconomics.calendar" target="_self">Google Play</a></li> <li><a class="navmobile-link nav-link" href="https://www.twitter.com/teconomics" target="_self">Twitter</a></li> </ul> </div> </div> </div> <div class="accordion-item"> <div class="accordion-header menu-main-option d-flex align-items-center"> <button class="accordion-button navmenu-mobile-item collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMore" aria-expanded="false" aria-controls="collapseTwo"> <i class="bi bi-question-circle me-2"></i>About <i class="bi bi-caret-down-fill ms-auto caret-toggle"></i> </button> </div> <div id="collapseMore" class="accordion-collapse collapse" data-bs-parent="#accordionNavbar"> <div class="accordion-body mobile-accordion-body"> <ul class="nav navbar-nav navbarMobile"> <li><a class="navmobile-link nav-link" href="/api/customers.aspx" target="_self">Customers</a></li> <li><a class="navmobile-link nav-link" href="/investors.aspx" target="_self">Investors</a></li> <li><a class="navmobile-link nav-link" href="/careers.aspx" target="_self">Careers</a></li> <li><a class="navmobile-link nav-link" href="/about-te.aspx" target="_self">About us</a></li> <li><a class="navmobile-link nav-link" href="/contact.aspx" target="_self">Contact</a></li> </ul> </div> </div> </div> <div class="accordion-item d-block d-md-none" style="border: none"> <div class="accordion-header menu-main-option accordion-last-item" style="padding: 30px 0px !important;"></div> </div> </div> </div> </div> </div> </div> </nav> <script> document.addEventListener('DOMContentLoaded', function () { let accordionHeaders = document.querySelectorAll('.menu-main-option'); accordionHeaders.forEach(function (header) { header.addEventListener('click', function () { let caretIcon = header.querySelector('.caret-toggle'); let allCaretIcons = document.querySelectorAll('.menu-main-option .caret-toggle'); allCaretIcons.forEach(function (icon) { if (icon !== caretIcon) { icon.classList.remove('bi-caret-up-fill'); icon.classList.add('bi-caret-down-fill'); } }); caretIcon.classList.toggle('bi-caret-down-fill'); caretIcon.classList.toggle('bi-caret-up-fill'); }); }); }); </script> <style>body {padding-top: 140px;}.pagemenu {top: 50px;}.pagetabs {top: 90px;}.navbar-default .navbar-nav>.active>a{ background-color: whitesmoke;} .navbar .navbar-expand-lg>.active, .navbar .navbar-expand-lg>.active>a{background-color: #f5f5f5;} .navbar .navbar-expand-lg>li:hover, .navbar .navbar-expand-lg>li:hover>a{background-color: #fff;} .nav-link:focus{color: #000;}</style> <style>.title-notes {padding-left: 10px;font-size: 80%;padding-top: 3px;font-weight:lighter;}</style> <div id="ctl00_ctl05_pageMenu"> <div class="pagemenu"> <div class="container"> <div class="row"> <div class='col-xl-12' style="display: flex; flex-direction: row"> <h1 class='title-indicator'>TRADING ECONOMICS API</h1> </div> </div> </div> </div> </div> <div id="ctl00_ctl05_pageTabs" class="pagetabs"> <div class="container "> <ul id="pagemenutabs" class="nav nav-tabs " style="border-bottom: none;"> <li class="nav-item "> <a class="nav-link active" href="/api/" class="" > Overview </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/calendar.aspx" class="" > Calendar </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/indicators.aspx" class="" > Indicators </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/markets.aspx" class="" > Markets </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/financials.aspx" class="" > Financials </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/excel.aspx" class="" > Excel </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/customers.aspx" class="" > Customers </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/pricing.aspx" class="" > Pricing </a> </li> <li class="nav-item "> <a class="nav-link " href="/api/contact.aspx" class="" > Contact Us </a> </li> </ul> </div> </div> <div class="container"> <div class="row"> <div class='col-xl-12' role="main"> <style type="text/css"> .te-features-description { text-align: justify; padding-top: 15px; } /*.bi { font-size: 25px; }*/ .bs-glyphicons { margin: 0 -19px 20px -16px; overflow: hidden; } .bs-glyphicons-list { padding-left: 0; list-style: none; } .bs-glyphicons li { float: left; width: 250px; height: 150px; padding: 10px; padding-top: 20px; line-height: 1.4; text-align: center; border: 1px solid #fff; background-color: #ddd; } .bs-glyphicons .bi { margin-top: 5px; margin-bottom: 10px; font-size: 24px; } .bs-glyphicons .glyphicon-class { display: block; text-align: center; word-wrap: break-word; } .bs-glyphicons li:hover { color: #fff; background-color: #e7e7e7; } .bs-glyphicons { margin-left: 0; margin-right: 0; } .bs-glyphicons-main { color: #fff; background-color: #333 !important; } @media only screen and (min-width:320px) and (max-width : 700px) { .bs-glyphicons { font-size: 14px; } .bs-glyphicons li { width: 180px; padding: 5px; } .bs-glyphicons .bi { margin-top: 0px; } .te-features-description { padding-top: 5px; } } body.dark-theme .bs-glyphicons li { background-color: #3679b5; border-color: #333; } body.dark-theme .bs-glyphicons-main { background-color: #5cb65c !important; border-color: #333; } </style> <div class="col-sm-12 col-md-10"> <div id="ctl00_ContentPlaceHolder1_HeaderUC_panel1" style="text-align: justify;"> <br />The Trading Economics Application Programming Interface (API) provides direct access to our data. It allows clients to download millions of rows of historical data, to query our real-time economic calendar and to subscribe to updates. Providing several request methods to query our databases, with samples available in different programming languages, it is the best way to export data in XML, CSV or JSON format. The API can be used to feed a custom developed application, a public website or just off-the-shelf software like Microsoft Excel. The API subscription pricing is adjusted accordingly to the features you use, to your volume of requests and to the distribution you make. Click on the squares below to learn more. </div> <br /> <div style="min-height: 400px;"> <div> <div class="bs-glyphicons"> <ul class="bs-glyphicons-list"> <li style="background-color: #d63384"> <br /> <br /> <span style="font-weight: bold; font-size: 2em; color: #fff">Features</span> </li> <li> <a style="text-decoration: none;" href="/api/calendar.aspx"> <i class="bi bi-calendar3"></i> <br /> <strong>Calendar</strong><br /> <span>Query the best economic calendar in the web and subscribe to live events</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/indicators.aspx"> <i class="bi bi-grid-fill"></i> <br /> <strong>Indicators</strong><br /> <span>Current figures and historical data on 20 Million indicators for 196 Countries</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/markets.aspx"> <i class="bi bi-shuffle"></i> <br /> <strong>Markets</strong><br /> <span>Live quotes and historical prices for currencies, stocks, commodities and bonds. </span> </a> </li> <li> <a style="text-decoration: none;" href="/api/financials.aspx"> <i class="bi bi-bar-chart-fill"></i> <br /> <strong>Financials</strong><br /> <span>Financial data for fundamental analysis on thousands of public traded companies.</span> </a> </li> <li> <a style="text-decoration: none;" href="/countries?g=forecast" target="_blank"> <i class="bi bi-arrow-down-up"></i> <br /> <strong>Forecasts</strong><br /> <span>Access proprietary predictions for indicators and markets</span> </a> </li> <li> <a style="text-decoration: none;" href="http://docs.tradingeconomics.com/" target="_blank"> <i class="bi bi-journals"></i> <br /> <strong>Documentation</strong> <br /> <span>Get help doing authentication and requests</span> </a> </li> <li> <a href="/analytics/excel.aspx" target="_blank" style="text-decoration: none;"> <i class="bi bi-grid-fill"></i> <br /> <strong>Excel</strong><br /> <span>Access our datasets directly from Microsoft Excel</span> </a> </li> <li> <a style="text-decoration: none;" href="https://github.com/tradingeconomics/tradingeconomics" target="_blank"> <i class="bi bi-eye"></i> <br /> <strong>Open Source</strong> <br /> <span>GitHub Examples in Python, R, C#, NODEJS, JAVA, PHP, etc</span> </a> </li> </ul> </div> </div> <br /> <div class="bs-glyphicons"> <ul class="bs-glyphicons-list"> <li style="background-color: #6f42c1"> <br /> <br /> <span style="font-weight: bold; font-size: 2em; color: #fff">Data</span> </li> <li> <a href="/api/indicators.aspx" style="text-decoration: none;"> <i class="bi bi-bar-chart-fill"></i> <br /> <strong>National Statistics</strong><br /> <span>Latest data sourced directly from official sources</span> </a> </li> <li> <a href="/api/calendar.aspx" target="_blank" style="text-decoration: none;"> <i class="bi bi-calendar3"></i> <br /> <strong>Economic Calendar</strong><br /> <span>Get releases from our calendar updated 24 hours a day. </span> </a> </li> <li> <a href="/api/indicators.aspx" style="text-decoration: none;"> <i class="bi bi-shuffle"></i> <br /> <strong>Forecasts</strong><br /> <span>Proprietary predictions for many indicators and financial markets</span></a> </li><li> <a style="text-decoration: none;" href="/api/markets.aspx"> <i class="bi bi-currency-euro"></i><br /> <strong>Currencies</strong><br /> <span>Exchange rate quotes for 150 currency majors and 29K crosses</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/markets.aspx?category=index"> <i class="bi bi-shuffle"></i><br /> <strong>Stocks</strong><br /> <span>Quotes for stock indexes and individual shares</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/markets.aspx?category=commodity"> <i class="bi bi-arrow-down-up"></i><br /> <strong>Commodities</strong><br /> <span>Energy, Metals, Agricultural, Livestock, Industrial</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/markets.aspx?category=bond"> <i class="bi bi-arrow-left-right"></i><br /> <strong>Bonds</strong><br /> <span>Government Bond Yields for several maturities</span> </a> </li> <li> <a style="text-decoration: none;" href="/api/markets.aspx?category=crypto"> <i class="bi bi bi-currency-bitcoin"></i><br /> <strong>Crypto</strong><br /> <span>Live prices and quotes for dozens of Crypto currencies</span> </a> </li> <li> <a style="text-decoration: none;" target="_blank" href="/united-states/states"> <i class="bi bi-house-door-fill"></i><br /> <strong>FRED</strong><br /> <span>US Federal Reserve Data by State and County</span> </a> </li> <li> <a href="/country-list/index-wb-data.html" target="_blank" style="text-decoration: none;"> <i class="bi bi-globe"></i><br /> <strong>World Bank</strong><br /> <span>Development indicators from official sources.</span> </a> </li> <li> <a style="text-decoration: none;" target="_blank" href="/countries?g=exports-by-country"> <i class="bi bi-arrows-fullscreen"></i><br /> <strong>COMTRADE</strong><br /> <span>International Trade Statistics for more than 170 countries.</span> </a> </li> </ul> </div> </div> </div> <div class="btn-group" role="group"> <a class="btn btn btn-success" href="https://tradingeconomics.com/api/pricing.aspx?source=/api/?source=menu">Get Started</a> </div> </div> </div> <br /> <br /> </div> <div class="container-fluid te-footer"> <footer> <div class="container"> <div class="row"> <div id="ctl00_Footer1_PanelFooter"> <style>.footer-spacer{padding: 4px}.footer-spacer-head{padding: 30px 4px 4px 4px;}@media only screen and (max-width:768px){.footer-icons{display: flex;margin-left: 50%;}.footer-icons a{padding: 0 12px 8px 0px; }}.footer-twitter{width: 50px; height: 50px;}.footer-github{width: 40px; height: 40px;}.footer-appstore{display: inline-block; overflow: hidden; background: url(//d3fy651gv2fhd3.cloudfront.net/images/appstore-lrg.svg?v=20171228) no-repeat; width: 135px; height: 40px; background-size: contain;}</style> <br /> <br /> <div class="container"> <div class="row"> <div class="col-lg-2 col-md-2 col-6"> <div class="footerHeader">Indicators</div> <a id="ctl00_Footer1_HyperLink6" class="footerItems" href="../">Homepage</a><br /> <a id="ctl00_Footer1_HyperLink17" class="footerItems" href="../countries">Countries</a><br /> <a id="ctl00_Footer1_HyperLink18" class="footerItems" href="../indicators">Indicators</a><br /> <a id="ctl00_Footer1_HyperLink1" class="footerItems" href="../calendar">Calendar</a><br /> <a id="ctl00_Footer1_HyperLink2" class="footerItems" href="../forecasts">Forecasts</a><br /> <a id="ctl00_Footer1_HyperLink11" class="footerItems" href="../country-list/rating">Ratings</a> </div> <div class="col-lg-2 col-md-2 col-6"> <div class="footerHeader">Solutions</div> <a href="/analytics/features.aspx?source=footer"><span class="footerItems">Data Subscriptions</span></a><br /> <a href="/api/?source=footer"><span class="footerItems">API Access</span></a><br /> <a href="/analytics/excel.aspx"><span class="footerItems">Excel Add-In</span></a><br /> <a href="https://developer.tradingeconomics.com/" target="_blank"><span class="footerItems">Developer Account</span></a><br /> <a href="https://docs.tradingeconomics.com/" target="_blank"><span class="footerItems">Documentation</span></a><br /> <a href="/analytics/pricing.aspx?source=footer" target="_blank"><span class="footerItems">Pricing</span></a><br /> <br /> </div> <div class="col-lg-2 col-md-2 col-6"> <div class="footerHeader">About Us</div> <a id="ctl00_Footer1_HyperLink8" class="footerItems" href="customers.aspx">Customers</a><br /> <a id="ctl00_Footer1_HyperLink23" class="footerItems" href="../careers.aspx">Careers</a><br /> <a id="ctl00_Footer1_HyperLink21" class="footerItems" href="../investors.aspx">Investors</a><br /> <a id="ctl00_Footer1_HyperLink20" class="footerItems" href="../advertise.aspx">Advertisers</a><br /> <a id="ctl00_Footer1_HyperLink19" class="footerItems" href="../about-te.aspx">About us</a><br /> <a id="ctl00_Footer1_HyperLink9" class="footerItems" href="../privacy-policy.aspx">Privacy</a> </div> <div class="col-lg-2 col-md-2 col-6"> <div class="footer-spacer-head"></div> <span class="footerHeader">Contact Us</span><br /> <a href="/contact.aspx"><span class="footerItems">Submit Request</span></a><br /><br /> <span class="footerHeader">Call Us</span><br /> +1 708-669-0606 <br /> <br /> </div> <div class="col-lg-2 col-md-2 col-6"> <div class="footer-spacer-head"></div> <a href="https://itunes.apple.com/us/app/trading-economics/id1142178921?mt=8" class="footer-appstore"></a> <div class="footer-spacer"></div> <a href="https://play.google.com/store/apps/details?id=com.tradingeconomics.calendar"> <img alt="Android app on Google Play" src="https://d3fy651gv2fhd3.cloudfront.net/images/google-play.png" /></a> </div> </div> </div> <br /> <div class="footer-copyright"> <br /> <span>Copyright ©2024 TRADING ECONOMICS<br /> All Rights Reserved</span><br /> </div> <br /> <br /> </div> </div> </div> </footer> </div> </form> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.bundle.min.js"></script> <script type="text/javascript" src="//d3fy651gv2fhd3.cloudfront.net/js/search.min.js?v=20240502" async></script> <script> TENotificationsHistorical = [] TENotificationsNews = [] //console.log('• Notifications Script Loaded - 20240701') setTimeout(() => { getNotificationsFromCookie() loadBellStatus() },1000) function loadBellStatus() { //console.log("• get bell status from cookie") var seenData = false const cookieData = document.cookie.split(';').find(item => item.trim().startsWith('TENewNotifications')); if (cookieData) { seenData = cookieData.split('TENewNotifications=')[1].split(',')[0] } if (seenData == 'true') { //console.log("new notification") $('#notification-new').show() $('#notification-empty').hide() } else { $('#notification-new').hide() $('#notification-empty').show() } } function setNotificationCookieStatus(status) { document.cookie = `TENewNotifications=${status.toString()}; expires=${createExpirationDate('eod')}; path=/`; } function changeIconStatus(isHover) { try { //console.log("change bell") if (TENotificationsHistorical.length > 0 && !isHover) { $('#notification-new').show() $('#notification-empty').hide() setNotificationCookieStatus(true) } else if (TENotificationsNews.length > 0 && !isHover) { $('#notification-new').show() $('#notification-empty').hide() setNotificationCookieStatus(true) } else { $('#notification-new').hide() $('#notification-empty').show() setNotificationCookieStatus(false) } } catch (e) { console.error(e) } } function timeAgo(datetime) { try { const now = new Date(); const diff = now - new Date(datetime); let seconds = Math.floor(diff / 1000); const minuteInSecs = 60; const hourInSecs = minuteInSecs * 60; let timeAgoString; if (seconds < minuteInSecs) { if (seconds == 0) { seconds = 1 } const plural = seconds == 1 ? '' : 's'; timeAgoString = `${seconds} second${plural} ago`; } else if (seconds < hourInSecs) { const minutes = Math.floor(seconds / minuteInSecs); timeAgoString = `${minutes} minutes ago`; } else { const hours = Math.floor(seconds / hourInSecs); const plural = hours > 1 ? 's' : ''; timeAgoString = `${hours} hour${plural} ago`; } return timeAgoString; } catch (e) { console.error(e) } } function createExpirationDate(span) { const expires = new Date(); if (span == '1d') { expires.setDate(expires.getDate() + 1) return expires.toUTCString() } else if (span == '1h') { expires.setHours(expires.getHours() + 1); return expires.toUTCString(); } else if (span == 'eod') { //end of day const expiresTime = new Date(expires.getTime()); expiresTime.setHours(23, 59, 59); return expiresTime.toUTCString(); } } function removeNotificationIndex(i) { try { if (TENotificationsHistorical.length == 0 && TENotificationsNews.length > 0) { TENotificationsNews.splice(i, 1); document.cookie = `TELastNews=${JSON.stringify(TENotificationsNews)}; path=/`; } if (TENotificationsHistorical.length > 0) { TENotificationsHistorical.splice(i, 1); } $('.notification-list').empty(); addNotificationCookie() if (TENotificationsNews.length == 0 || (TENotificationsNews.length == 0 && TENotificationsHistorical.length == 0)) { addEmptyContent() } if (TENotificationsHistorical.length > 0 || TENotificationsNews.length > 0) { upsertNotification(null, true, false) } } catch (e) { console.error(e) } } function addEmptyContent() { try { //console.log("Add Empty Content") const notificationList = $('.notification-list'); notificationList.empty(); //notificationList.append('<div style="display:flex;justify-content:space-between;align-itens:center"><span style="margin-left:18px"><b>Notifications</b></span></div>') let html = `<div class="empty-notificationlist"> <div class="empty-notificationlist-content"> <span>You have no new notifications</span> <br> <i class="bi bi-bell-slash-fill"></i> <br> <div><a href="/stream" title="Show all news" class="empty-notificationlist-more"><div class="btn btn-outline-secondary">All News</div></a></div> </div> </div>`; notificationList.append(html); } catch (e) { console.error(e) } } function addContent() { try { //console.log("AddContent") const notifiList = TENotificationsHistorical.length > 0 ? TENotificationsHistorical : TENotificationsNews; const notificationList = $('.notification-list'); notificationList.empty(); if (notifiList.length > 0) { notificationList.append('<div class="notificationList-first-title"><span style="margin-left:18px"><b>Notifications</b></span><span class="notifications-clean-all" title="Delete all notifications">Clear all</span></div>') for (let i = notifiList.length - 1; i >= 0; i--) { const notification = notifiList[i]; let html = `<div> <div class="card notificationlist-card" style="margin:0;"> <div class="card-body notificationlist-body"> <div class="notificationlist-header"> <div class="notificationlist-header-title"><a href="${notification.url}"><b>${notification.title}</b></a><span class="badge badge-notification-type" style="background-color:${notification.color}">${notification.type}</span></div> <span id="n-${i}" title="Delete" style="cursor:pointer"><i id="cleanIndividualNotif" class="bi bi-trash3"></i></span> </div> <span style="font-size:15px">${notification.text}</span> <div class="notificationlist-footer"> <p>${timeAgo(notification.datetime)}</p> </div> </div> </div> </div>`; notificationList.append(html); $(`#n-${i}`).on('click', function () { removeNotificationIndex(i) }) } notificationList.append('<div class="notificationlist-more-div"><a href="/stream" title="Show more streams" class="notificationlist-more"><div class="btn btn-outline-secondary">More News</div></a></div>') $('.notifications-clean-all').on('click', function () { //console.log("Clicked") notificationList.empty(); if (TENotificationsHistorical.length > 0) { document.cookie = "TENotifications=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; TENotificationsHistorical = [] } else if (TENotificationsNews.length > 0) { document.cookie = `TELastNews=[]; path=/`; TENotificationsNews = [] } upsertNotification(null, true, false) }); } } catch (e) { console.error(e) } } function fetchLastNews() { try { //console.log("• Fetch News") TENotificationsNews = [] const newsUrl = '/ws/stream.ashx?start=0&size=3' fetch(newsUrl) .then(response => { if (!response.ok) { console.error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => { for (let item of data) { if (item.description.length > 300) { item.description = item.description.substring(0, 300) + ' ...'; let lastPeriodIndex = Math.min(item.description.lastIndexOf('. '), 300); if (lastPeriodIndex !== -1) { item.description = item.description.substring(0, lastPeriodIndex + 1) + '..'; } else { item.description = item.description.substring(0, 300) + '...'; } } TENotificationsNews.unshift({ title: item.title, url: item.url, text: item.description, importance: item.importance, datetime: item.date, type: 'News', color: '#ddd' }) } document.cookie = `TELastNews=${JSON.stringify(TENotificationsNews)}; path=/`; // console.log("• Saved News on Cookies TELastNews") upsertNotification(null, true, false) }) .catch(error => { console.error('Error fetching last news:', error); }); } catch (e) { console.error(e) } } function getNotificationsFromCookie() { try { //console.log("• get Notifications From Cookie") const cookieData = document.cookie.split(';').find(item => item.trim().startsWith('TENotifications')); if (cookieData) { let encodedData = cookieData.split('TENotifications=')[1].split(',') //const decrompressedData = pako.inflate(encodedData, { to: 'string' }); try { TENotificationsHistorical = JSON.parse(encodedData); //console.log(TENotificationsHistorical) if (TENotificationsHistorical.length > 0) { upsertNotification(null, true, false) } } catch (error) { console.error("Error parsing existing cookie data:", error); } } } catch (e) { console.error(e) } } function estimateNotificationSize() { return JSON.stringify(TENotificationsHistorical).length; } function getCookieSize() { try { let safeLoop = 0 const cookies = document.cookie.split(';'); let total = 0 for (const cookie of cookies) { if (safeLoop == 50) { return 0; } const [key, value] = cookie.trim().split('='); if (key !== 'TENotifications') { total = total + JSON.stringify(cookie).length + 2 } safeLoop++ } return total; } catch (e) { console.error(e); } } function manageCookieSize(maxSize) { try { //console.log("• Check threshold of cookies size"); const currentCookieSize = getCookieSize(); const currentNotificationsSize = estimateNotificationSize(); let totalBytes = currentCookieSize + currentNotificationsSize; let nLoopCount = 0; //console.log("• Current Cookies Estimated Size: " + currentCookieSize); //console.log("• With Notifications Cookie Estimated Size: " + currentNotificationsSize); if (totalBytes > maxSize) { while (nLoopCount < 10 && totalBytes > maxSize) { //console.log("---------------------> nLoopCount: " + nLoopCount); TENotificationsHistorical.shift(); totalBytes = currentCookieSize + estimateNotificationSize(); //console.log(`• Notification removed to control cookie size. New size: ${totalBytes} bytes`); if (totalBytes <= maxSize) { //console.log(`• Cookie size is already within limit: ${totalBytes} bytes`); break; } nLoopCount++; } }// else { //console.log(`• Cookie size is within limit: ${totalBytes} bytes`); //} } catch (e) { console.error(e); } } function addNotificationCookie() { try { //console.log("• Add Notifications on Cookie"); const isEmptyNews = TENotificationsNews.length === 0; const isEmptyHistorical = TENotificationsHistorical.length === 0; document.cookie = `TELastNews=${isEmptyNews ? '[]' : JSON.stringify(TENotificationsNews)}; path=/`; manageCookieSize(3400); if (isEmptyHistorical) { document.cookie = `TENotifications=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`; } else { document.cookie = `TENotifications=${JSON.stringify(TENotificationsHistorical)}; expires=${createExpirationDate('1d')}; path=/`; } } catch (e) { console.error(e); } } function createDefaultNotification(n) { return { ...n, datetime: new Date(), type: n.importance > 0 ? 'Calendar' : 'News', color: n.importance > 0 ? '#ffb3ba' : '#ddd', }; } function upsertNotification(n, cookie, fromStream) { try { //console.log("-----------------------------------------------> Start of upsert Notification on list flow"); //console.log(`• Dealing with ${JSON.stringify(n)}`); if (!cookie) { const newNotification = createDefaultNotification(n); const existingNotification = TENotificationsHistorical.find(item => item.text === newNotification.text); if (existingNotification) { TENotificationsHistorical.splice(TENotificationsHistorical.indexOf(existingNotification), 1); } TENotificationsHistorical.push(newNotification); } const notificationListContainer = $('.offcanvas-top.notification-list.container'); const notificationList = $('.notification-list'); if (!notificationList.length) { notificationListContainer.append(`<div class="offcanvas-header"></div>`); } if (TENotificationsHistorical.length > 0 || TENotificationsNews.length > 0) { if (fromStream == true) { changeIconStatus(false); setNotificationCookieStatus(true); } if (!cookie) { addNotificationCookie(); } addContent(); } else { addEmptyContent(); } } catch (e) { console.error(e); } } $('.btn-notification-list').on('click', function (event) { //console.log('click') event.preventDefault() let cookieNewsIsPresent = false //console.log("• Check if there is LastNews Cookie") const cookieData = document.cookie.split(';').find(item => item.trim().startsWith('TELastNews')); if (cookieData) { let cookieNews = cookieData.split('TELastNews=')[1].split(',') cookieNewsIsPresent = true TENotificationsNews = JSON.parse(cookieNews) } //console.log(cookieNewsIsPresent) if (TENotificationsHistorical.length == 0 && TENotificationsNews.length == 0 && !cookieNewsIsPresent) { //console.log("IF") $('.offcanvas-top').removeClass("show") $('.offcanvas-top').removeClass("showing") fetchLastNews() } else { if (TENotificationsNews.length > 0 || TENotificationsHistorical.length > 0) { upsertNotification(null, true, false) } else { addEmptyContent() } } changeIconStatus(true) }); </script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-SZ14JCTXWQ"></script> <script> window.dataLayer = window.dataLayer || []; function ga() { dataLayer.push(arguments); } ga('js', new Date()); ga('config', 'G-SZ14JCTXWQ', { 'allow_google_signals': false }); </script> </body> </html>