-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgetstarted.html
More file actions
555 lines (510 loc) · 28.1 KB
/
getstarted.html
File metadata and controls
555 lines (510 loc) · 28.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started with Python for Economics | BD Economics</title>
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
<link rel="stylesheet" href="style.css">
<meta name="description" content="Install Python, learn pandas and numpy for economics, and make your first API call. Covers CPI inflation rates, nominal vs real adjustments, growth decomposition, and the Keynesian fiscal multiplier.">
<meta name="keywords" content="Python economics, Python getting started, install Python economics, pandas tutorial economics, numpy linear algebra economics, Jupyter notebook economics, CPI inflation Python, nominal real GDP Python, fiscal multiplier Python, API tutorial setup, Python data analysis beginner">
<meta name="author" content="Brian Dew">
<link rel="canonical" href="https://bd-econ.com/getstarted.html">
<!-- Open Graph -->
<meta property="og:title" content="Getting Started with Python for Economics | BD Economics">
<meta property="og:description" content="Install Python, learn pandas and numpy for economics, and make your first API call. Covers inflation rates, real vs nominal, and the fiscal multiplier.">
<meta property="og:url" content="https://bd-econ.com/getstarted.html">
<meta property="og:type" content="article">
<meta property="og:image" content="https://bd-econ.com/images/01_bdlogo.png">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Getting Started with Python for Economics | BD Economics">
<meta name="twitter:description" content="Install Python, learn pandas and numpy for economics, and make your first API call. Covers inflation rates, real vs nominal, and the fiscal multiplier.">
<meta name="twitter:image" content="https://bd-econ.com/images/01_bdlogo.png">
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
<link rel="manifest" href="favicon/manifest.json">
<meta name="theme-color" content="#ffffff">
<script>
(function() {
const saved = localStorage.getItem('theme');
if (saved) {
document.documentElement.setAttribute('data-theme', saved);
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "Getting Started with Python for Economics",
"description": "Install Python, learn pandas and numpy for economics, and make your first API call. Covers inflation rates, real vs nominal adjustments, growth decomposition, and the Keynesian fiscal multiplier.",
"author": {
"@type": "Person",
"name": "Brian Dew"
},
"publisher": {
"@type": "Organization",
"name": "BD Economics",
"url": "https://bd-econ.com"
},
"mainEntityOfPage": "https://bd-econ.com/getstarted.html",
"datePublished": "2026-03-12",
"dateModified": "2026-03-12"
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Guides",
"item": "https://bd-econ.com/python.html"
},
{
"@type": "ListItem",
"position": 2,
"name": "Getting Started",
"item": "https://bd-econ.com/getstarted.html"
}
]
}
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PGVF5S620Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PGVF5S620Y');
</script>
</head>
<body>
<a href="#main" class="skip-link">Skip to main content</a>
<nav>
<ul class="ul_nav" id="menu">
<li class="nav_main"> <a href="index.html"><svg class="nav-logo" viewBox="0 0 9 5" width="22" height="12" aria-hidden="true"><rect x="0" y="0" width="1" height="5"/><rect x="0" y="4" width="4" height="1"/><rect x="2" y="2" width="2" height="1"/><rect x="3" y="2" width="1" height="2"/><rect x="8" y="0" width="1" height="5"/><rect x="5" y="4" width="4" height="1"/><rect x="5" y="2" width="2" height="1"/><rect x="5" y="2" width="1" height="2"/></svg>Economics</a> </li>
<li><a href="about.html">About</a> </li>
<li><a href="https://briandew.wordpress.com" target="_blank" rel="noopener">Blog <svg class="icon icon-external" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3h6v6M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/></svg></a> </li>
<li><a href="python.html" class="active" aria-current="page">Guides <span class="nav-arrow">↓</span></a>
<ul class="hidden">
<li><a href="getstarted.html">Getting Started</a></li>
<li><a href="imfapi1.html">IMF API</a></li>
<li><a href="blsapi.html">BLS API</a></li>
<li><a href="beaapi.html">BEA API</a></li>
<li><a href="censusapi.html">Census API</a></li>
<li><a href="treasuryapi.html">Treasury API</a></li>
<li><a href="cps.html">CPS Microdata</a></li>
</ul>
</li>
<li>
<a href="reports.html">Reports <span class="nav-arrow">↓</span></a>
<ul class="hidden">
<li><a href="chartbook.html">US Chartbook</a></li>
<li><a href="indicators.html">Economic Indicators</a></li>
<li><a href="gdpm.html">Monthly GDP</a></li>
<li><a href="imfweo.html">IMF WEO</a></li>
<li><a href="calendar.html">Release Calendar</a></li>
</ul>
</li>
<li><button class="theme-toggle" onclick="toggleTheme()" aria-label="Toggle dark mode"><span id="theme-icon"><svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg></span></button></li>
<li class="icon">
<button type="button" onclick="responsiveNav()" aria-label="Toggle navigation menu" aria-expanded="false">☰</button>
</li>
</ul>
</nav>
<div class="page-strip accent-ltblue">
<picture><source srcset="images/getstarted_strip.webp" type="image/webp"><img decoding="async" fetchpriority="high" src="images/getstarted_strip.jpg" alt="" aria-hidden="true" class="page-strip-img"></picture>
</div>
<header>
<h1>Getting Started</h1>
</header>
<main id="main">
<section>
<article class="prose">
<div class="tutorial-meta">
<span>Updated <time datetime="2026-03-12">Mar 2026</time></span>
<span class="meta-sep">·</span>
<span class="trail-badge trail-intro">● Introductory</span>
<span class="meta-sep">·</span>
<button class="tutorial-share" title="Copy link" aria-label="Copy link"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg><span class="share-label">Link</span></button>
</div>
<h2>Getting Started with Python for Economics</h2>
<p>This page covers everything you need to start using the <a href="python.html">six API tutorials</a> on this site: installing Python, the basics of pandas, and common economic calculations. If you already have Python set up, skip ahead to <a href="#pandas">Working with Data</a> or <a href="#calculations">Common Calculations</a>.</p>
<hr class="section-bar accent-ltblue">
<h3 id="setup">Setup</h3>
<h4>Install Python</h4>
<p>The easiest way to install Python is with <a href="https://docs.conda.io/en/latest/miniconda.html">Miniconda</a>, a lightweight installer that works on Windows, Mac, and Linux. Download the installer for your operating system and follow the prompts.</p>
<h4>Install Packages</h4>
<p>Open a terminal (or Anaconda Prompt on Windows) and install the packages used in the tutorials:</p>
<pre><code class="bash">pip install requests pandas matplotlib jupyter</code></pre>
<h4>Launch Jupyter</h4>
<p>Jupyter notebooks let you write and run Python code in small cells, seeing results immediately. This is ideal for exploring data. To start:</p>
<pre><code class="bash">jupyter notebook</code></pre>
<p>This opens a browser window where you can create a new notebook and start writing code. Each cell runs independently, but variables carry over from one cell to the next—so you can build up an analysis step by step.</p>
<hr class="section-bar accent-ltblue">
<h3 id="basics">Python Essentials</h3>
<p>You don't need to learn all of Python to follow the tutorials. Here are the pieces that come up most often.</p>
<span class="step-label accent-ltblue">Variables and Types</span>
<p>In[1]:</p>
<pre><code class="python"># Numbers
gdp = 28_781.0 # underscores for readability (ignored by Python)
growth_rate = 2.5
# Strings
agency = 'Bureau of Economic Analysis'
# Lists (ordered collection)
years = [2022, 2023, 2024, 2025]
# Dictionaries (key-value pairs — used heavily in API responses)
indicators = {
'GDP': 28_781.0,
'Unemployment': 4.0,
'Inflation': 2.5
}</code></pre>
<span class="step-label accent-ltblue">f-strings and Imports</span>
<p>f-strings let you embed variables directly in text. Imports load external packages.</p>
<p>In[2]:</p>
<pre><code class="python">import pandas as pd # data analysis
import numpy as np # math and linear algebra
import requests # HTTP requests (for APIs)
# f-strings: prefix a string with f to embed variables
print(f'{agency} reports GDP of ${gdp:,.0f} billion')
print(f'Year range: {years[0]} to {years[-1]}')</code></pre>
<pre>Bureau of Economic Analysis reports GDP of $28,781 billion
Year range: 2022 to 2025</pre>
<span class="step-label accent-ltblue">Dictionaries in Practice</span>
<p>API responses are typically JSON, which Python reads as nested dictionaries. Navigating them is a core skill.</p>
<p>In[3]:</p>
<pre><code class="python"># A simplified API response
response = {
'status': 'REQUEST_SUCCEEDED',
'Results': {
'series': [
{'seriesID': 'LNS14000003', 'data': [{'year': '2025', 'value': '3.5'}]}
]
}
}
# Navigate to the data
value = response['Results']['series'][0]['data'][0]['value']
print(f'Unemployment rate: {value}%')</code></pre>
<pre>Unemployment rate: 3.5%</pre>
<hr class="section-bar accent-ltblue">
<h3 id="pandas">Working with Data</h3>
<p>Pandas is the main tool for working with tabular data in Python. The two key objects are <strong>Series</strong> (a single column) and <strong>DataFrame</strong> (a table).</p>
<span class="step-label accent-ltblue">Create a DataFrame</span>
<p>In[4]:</p>
<pre><code class="python"># Create from a dictionary
df = pd.DataFrame({
'quarter': ['2024-Q1', '2024-Q2', '2024-Q3', '2024-Q4'],
'gdp': [22050, 22320, 22580, 22710],
'unemployment': [3.8, 3.9, 4.1, 4.0]
})
df</code></pre>
<p>Out[4]:</p>
<table class="dataframe">
<thead>
<tr>
<th></th>
<th>quarter</th>
<th>gdp</th>
<th>unemployment</th>
</tr>
</thead>
<tbody>
<tr><th>0</th><td>2024-Q1</td><td>22050</td><td>3.8</td></tr>
<tr><th>1</th><td>2024-Q2</td><td>22320</td><td>3.9</td></tr>
<tr><th>2</th><td>2024-Q3</td><td>22580</td><td>4.1</td></tr>
<tr><th>3</th><td>2024-Q4</td><td>22710</td><td>4.0</td></tr>
</tbody>
</table>
<span class="step-label accent-ltblue">Time Series Index</span>
<p>Most economic data is a time series. Setting a datetime index unlocks powerful time-based operations.</p>
<p>In[5]:</p>
<pre><code class="python"># Create a monthly series with a date index
months = pd.date_range('2024-01', periods=6, freq='MS')
price_index = pd.Series([310.1, 311.1, 312.2, 313.0, 313.2, 314.1], index=months, name='CPI')
# Select by date range
price_index.loc['2024-03':'2024-05']</code></pre>
<p>Out[5]:</p>
<pre>2024-03-01 312.2
2024-04-01 313.0
2024-05-01 313.2
Name: CPI, dtype: float64</pre>
<span class="step-label accent-ltblue">Combining Series</span>
<p>Much of economics is about relationships between variables. Pandas makes it easy to combine series and compute new ones.</p>
<p>In[6]:</p>
<pre><code class="python"># GDP (billions) and population (millions) by year
gdp = pd.Series([21_061, 22_996, 25_463, 27_361, 28_781],
index=[2020, 2021, 2022, 2023, 2024], name='GDP')
pop = pd.Series([331, 332, 333, 335, 336],
index=[2020, 2021, 2022, 2023, 2024], name='Population')
# GDP per capita (in thousands)
per_capita = (gdp / pop * 1000).round(0)
per_capita</code></pre>
<p>Out[6]:</p>
<pre>2020 63627.0
2021 69265.0
2022 76466.0
2023 81674.0
2024 85657.0
dtype: float64</pre>
<hr class="section-bar accent-ltblue">
<h3 id="economics">Economics Example: The Fiscal Multiplier</h3>
<p>Python can solve the kind of problems you'd work through by hand in an economics class. Here's a simple Keynesian model solved with NumPy's linear algebra tools.</p>
<span class="step-label accent-ltblue">A Simple Macro Model</span>
<p>In the basic Keynesian model, GDP (<em>Y</em>) equals consumption (<em>C</em>) plus investment (<em>I</em>) plus government spending (<em>G</em>). Consumption depends on after-tax income:</p>
<ul>
<li>Y = C + I + G</li>
<li>C = 200 + 0.75(Y − T)</li>
</ul>
<p>With I = 300, G = 400, and T = 300, we can rearrange into a system of two equations:</p>
<ul>
<li>Y − C = 700  (from Y = C + I + G)</li>
<li>−0.75Y + C = −25  (from C = 200 + 0.75(Y − 300))</li>
</ul>
<p>In[7]:</p>
<pre><code class="python"># Coefficient matrix: [Y, C]
A = np.array([[1, -1],
[-0.75, 1]])
b = np.array([700, -25])
Y, C = np.linalg.solve(A, b)
print(f'GDP = ${Y:,.0f}B, Consumption = ${C:,.0f}B')</code></pre>
<pre>GDP = $2,700B, Consumption = $2,000B</pre>
<span class="step-label accent-ltblue">What If Congress Increases Spending?</span>
<p>Suppose government spending rises by $100 billion (G goes from 400 to 500). Only the first equation changes—the right-hand side becomes 800:</p>
<p>In[8]:</p>
<pre><code class="python"># G rises by 100: Y - C = 800 (was 700)
b_new = np.array([800, -25])
Y_new, C_new = np.linalg.solve(A, b_new)
print(f'New GDP = ${Y_new:,.0f}B (was ${Y:,.0f}B)')
print(f'Change in GDP: ${Y_new - Y:,.0f}B from ${100}B in spending')
print(f'Multiplier: {(Y_new - Y) / 100:.0f}x')</code></pre>
<pre>New GDP = $3,100B (was $2,700B)
Change in GDP: $400B from $100B in spending
Multiplier: 4x</pre>
<p>Each dollar of government spending raised GDP by four dollars. The multiplier is 1/(1 − 0.75) = 4, because the initial spending becomes someone's income, 75% of which is spent again, and so on. This is a simplified model, but it illustrates why fiscal policy can have outsized effects on the economy.</p>
<hr class="section-bar accent-ltblue">
<h3 id="calculations">Common Calculations</h3>
<p>The API tutorials use a few economic calculations that are worth seeing in one place.</p>
<span class="step-label accent-ltblue">From Price Index to Inflation Rate</span>
<p>The Consumer Price Index (CPI) is a price level, not an inflation rate. To get the headline inflation rate that you see in the news, compare each month's index to the same month one year earlier.</p>
<p>In[9]:</p>
<pre><code class="python"># 18 months of CPI-U data (made up but realistic)
cpi = pd.Series(
[305.7, 307.0, 307.8, 307.7, 308.0, 308.7,
309.7, 310.3, 312.2, 313.5, 314.1, 314.2,
314.5, 315.6, 315.3, 315.8, 316.2, 316.5],
index=pd.date_range('2023-07', periods=18, freq='MS'),
name='CPI-U'
)
# Headline inflation: 12-month percent change
inflation = (cpi.pct_change(12) * 100).dropna().round(1)
inflation</code></pre>
<p>Out[9]:</p>
<pre>2024-07-01 2.9
2024-08-01 2.8
2024-09-01 2.4
2024-10-01 2.6
2024-11-01 2.7
2024-12-01 2.5
Name: CPI-U, dtype: float64</pre>
<span class="step-label accent-ltblue">Adjusting for Inflation</span>
<p>To compare dollar values across time, adjust for inflation by dividing by the price index. This converts nominal values to real (constant-dollar) values.</p>
<p>In[10]:</p>
<pre><code class="python"># Median weekly earnings (nominal) and CPI-U (2020 = 100)
earnings = pd.Series([984, 1001, 1059, 1100, 1145],
index=[2020, 2021, 2022, 2023, 2024], name='Nominal')
cpi_annual = pd.Series([100.0, 104.7, 113.1, 117.7, 120.6],
index=[2020, 2021, 2022, 2023, 2024], name='CPI')
# Real earnings in 2020 dollars
real = (earnings / cpi_annual * 100).round(0)
pd.DataFrame({'Nominal': earnings, 'Real (2020$)': real})</code></pre>
<p>Out[10]:</p>
<table class="dataframe">
<thead>
<tr>
<th></th>
<th>Nominal</th>
<th>Real (2020$)</th>
</tr>
</thead>
<tbody>
<tr><th>2020</th><td>984</td><td>984.0</td></tr>
<tr><th>2021</th><td>1001</td><td>956.0</td></tr>
<tr><th>2022</th><td>1059</td><td>936.0</td></tr>
<tr><th>2023</th><td>1100</td><td>934.0</td></tr>
<tr><th>2024</th><td>1145</td><td>949.0</td></tr>
</tbody>
</table>
<p>Nominal weekly earnings rose 16% from 2020 to 2024, but real earnings actually fell 4%—wage growth didn't keep pace with inflation. This is a key distinction in any analysis of living standards.</p>
<span class="step-label accent-ltblue">Growth Decomposition</span>
<p>When a total is the sum of components, you can decompose its growth into each component's contribution. Here, consumer spending (PCE) equals goods plus services.</p>
<p>In[11]:</p>
<pre><code class="python"># Quarterly PCE components (billions, made up)
pce = pd.DataFrame({
'Goods': [5800, 5850, 5900, 5880],
'Services': [10200, 10350, 10500, 10650]
}, index=pd.date_range('2024-01', periods=4, freq='QS'))
pce['Total'] = pce['Goods'] + pce['Services']
# Each component's contribution = its change / previous total × 100
for comp in ['Goods', 'Services']:
pce[f'{comp} contribution'] = pce[comp].diff() / pce['Total'].shift() * 100
pce[['Goods contribution', 'Services contribution']].dropna().round(2)</code></pre>
<p>Out[11]:</p>
<table class="dataframe">
<thead>
<tr>
<th></th>
<th>Goods contribution</th>
<th>Services contribution</th>
</tr>
</thead>
<tbody>
<tr><th>2024-04-01</th><td>0.31</td><td>0.94</td></tr>
<tr><th>2024-07-01</th><td>0.31</td><td>0.93</td></tr>
<tr><th>2024-10-01</th><td>-0.12</td><td>0.91</td></tr>
</tbody>
</table>
<p>Services drove most of the growth, while goods spending turned negative in Q4. The contributions sum to the total growth rate each quarter—this is the same technique used in the <a href="beaapi.html">BEA tutorial</a> to analyze real consumer spending.</p>
<hr class="section-bar accent-ltblue">
<h3 id="apis">Setting Up for the API Tutorials</h3>
<span class="step-label accent-ltblue">API Keys</span>
<p>Most government data APIs require a free API key for access. The tutorials on this site store keys in a file called <code>config.py</code> that you create in the same folder as your notebook:</p>
<pre><code class="python"># config.py — keep this file private, don't commit it to git
bls_key = 'your-key-here'
bea_key = 'your-key-here'
census_key = 'your-key-here'</code></pre>
<p>Then in your notebook, import the key you need:</p>
<pre><code class="python">from config import bea_key as api_key</code></pre>
<p>The <a href="treasuryapi.html">Treasury API</a> is the exception—it requires no key at all, which makes it a good first tutorial to try.</p>
<span class="step-label accent-ltblue">Making a Request</span>
<p>The basic pattern for fetching data from an API is the same across all the tutorials:</p>
<p>In[12]:</p>
<pre><code class="python">import requests
url = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service'
url += '/v1/accounting/mts/mts_table_1'
params = {
'fields': 'record_date,current_month_gross_outly_amt',
'sort': '-record_date',
'page[size]': 3
}
r = requests.get(url, params=params)
r.json()['data']</code></pre>
<p>Out[12] (your output will reflect the most recent data available):</p>
<pre>[{'record_date': '2025-10-31', 'current_month_gross_outly_amt': '637640'},
{'record_date': '2025-09-30', 'current_month_gross_outly_amt': '547839'},
{'record_date': '2025-08-31', 'current_month_gross_outly_amt': '527946'}]</pre>
<hr class="section-bar accent-ltblue">
<h3>Next Steps</h3>
<p>Each tutorial below walks through a complete example—from API request to finished chart. Treasury is the easiest starting point since it requires no API key.</p>
</article>
<article class="card-grid">
<a href="treasuryapi.html">
<div class="nav-card accent-red">
<div class="nav-card-banner">
<picture><source srcset="images/treasury_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/treasury_banner.png" alt="Treasury API tutorial" width="391" height="68"></picture>
</div>
<div class="nav-card-head">
<h3>Treasury API</h3>
</div>
<div class="nav-card-body">
<p>Access federal finance data including revenue, spending, and debt from the US Treasury Fiscal Data API. No API key required.</p>
<span class="trail-badge trail-beginner">■ Beginner</span>
</div>
</div>
</a>
<a href="censusapi.html">
<div class="nav-card accent-green">
<div class="nav-card-banner">
<picture><source srcset="images/census_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/census_banner.png" alt="Census API tutorial" width="207" height="68"></picture>
</div>
<div class="nav-card-head">
<h3>Census API</h3>
</div>
<div class="nav-card-body">
<p>Retrieve US economic indicators from the Census Bureau, including manufacturing, international trade, and construction data.</p>
<span class="trail-badge trail-beginner">■ Beginner</span>
</div>
</div>
</a>
<a href="beaapi.html">
<div class="nav-card accent-orange">
<div class="nav-card-banner">
<picture><source srcset="images/bea_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/bea_banner.png" alt="BEA API tutorial" width="542" height="130"></picture>
</div>
<div class="nav-card-head">
<h3>BEA API</h3>
</div>
<div class="nav-card-body">
<p>Retrieve national accounts data from the Bureau of Economic Analysis including GDP, consumer spending, and industry statistics.</p>
<span class="trail-badge trail-intermediate">◆ Intermediate</span>
</div>
</div>
</a>
<a href="blsapi.html">
<div class="nav-card accent-purple">
<div class="nav-card-banner">
<picture><source srcset="images/bls_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/bls_banner.png" alt="BLS API tutorial" width="257" height="68"></picture>
</div>
<div class="nav-card-head">
<h3>BLS API</h3>
</div>
<div class="nav-card-body">
<p>Retrieve US labor statistics—employment, wages, prices—directly from the Bureau of Labor Statistics (BLS) API.</p>
<span class="trail-badge trail-intermediate">◆ Intermediate</span>
</div>
</div>
</a>
<a href="imfapi1.html">
<div class="nav-card accent-blue">
<div class="nav-card-banner">
<picture><source srcset="images/imf_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/imf_banner.png" alt="IMF API tutorial" width="293" height="68"></picture>
</div>
<div class="nav-card-head">
<h3>IMF API</h3>
</div>
<div class="nav-card-body">
<p>Access international economic data from the International Monetary Fund (IMF). Covers GDP, trade, prices, and more for 190+ countries.</p>
<span class="trail-badge trail-intermediate">◆ Intermediate</span>
</div>
</div>
</a>
<a href="cps.html">
<div class="nav-card accent-teal">
<div class="nav-card-banner">
<picture><source srcset="images/cps_banner.webp" type="image/webp"><img loading="lazy" decoding="async" src="images/cps_banner.png" alt="CPS microdata tutorial" width="542" height="130"></picture>
</div>
<div class="nav-card-head">
<h3>CPS Microdata</h3>
</div>
<div class="nav-card-body">
<p>Read and analyze Current Population Survey microdata with Python. Build custom labor market statistics from household-level data.</p>
<span class="trail-badge trail-advanced">◆◆ Advanced</span>
</div>
</div>
</a>
</article>
<div class="subfooter" data-hub="guides" data-current="getstarted.html" style="--accent-color: var(--color-card-ltblue)"></div>
</section>
</main>
<footer>
<div class="footer_left">
<p><time datetime="2026">2026</time>, by Brian Dew</p>
</div>
<div class="footer_right">
<a href="https://github.com/bdecon/" aria-label="GitHub"><svg class="icon" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg></a>
<a href="https://www.linkedin.com/in/brian-dew-5788a386/" aria-label="LinkedIn"><svg class="icon" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.016-.709-.52-1.248-1.342-1.248S1.4 3.226 1.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a.3.3 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z"/></svg></a>
<a href="https://twitter.com/bd_econ" aria-label="Twitter"><svg class="icon" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334q.002-.211-.006-.422A6.7 6.7 0 0 0 16 3.542a6.7 6.7 0 0 1-1.889.518 3.3 3.3 0 0 0 1.447-1.817 6.5 6.5 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.32 9.32 0 0 1-6.767-3.429 3.29 3.29 0 0 0 1.018 4.382A3.3 3.3 0 0 1 .64 6.575v.045a3.29 3.29 0 0 0 2.632 3.218 3.2 3.2 0 0 1-.865.115 3 3 0 0 1-.614-.057 3.28 3.28 0 0 0 3.067 2.277A6.6 6.6 0 0 1 .78 13.58a6 6 0 0 1-.78-.045A9.34 9.34 0 0 0 5.026 15"/></svg></a>
<a href="https://briandew.wordpress.com/" target="_blank" rel="noopener" aria-label="WordPress Blog"><svg class="icon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M21.469 6.825c.84 1.537 1.318 3.3 1.318 5.175 0 3.979-2.156 7.456-5.363 9.325l3.295-9.527c.615-1.54.82-2.771.82-3.864 0-.405-.026-.78-.07-1.11m-7.981.105c.647-.03 1.232-.105 1.232-.105.582-.075.514-.93-.067-.899 0 0-1.755.135-2.88.135-1.064 0-2.85-.15-2.85-.15-.585-.03-.661.855-.075.885 0 0 .54.061 1.125.09l1.68 4.605-2.37 7.08L5.354 6.9c.649-.03 1.234-.1 1.234-.1.585-.075.516-.93-.065-.896 0 0-1.746.138-2.874.138-.2 0-.438-.008-.69-.015C4.911 3.15 8.235 1.215 12 1.215c2.809 0 5.365 1.072 7.286 2.833-.046-.003-.091-.009-.141-.009-1.06 0-1.812.923-1.812 1.914 0 .89.513 1.643 1.06 2.531.411.72.89 1.643.89 2.977 0 .915-.354 1.994-.821 3.479l-1.075 3.585-3.9-11.61.001.014zM12 22.784c-1.059 0-2.081-.153-3.048-.437l3.237-9.406 3.315 9.087c.024.053.05.101.078.149-1.12.393-2.325.609-3.582.609M1.211 12c0-1.564.336-3.05.935-4.39L7.29 21.709C3.694 19.96 1.212 16.271 1.211 12M12 0C5.385 0 0 5.385 0 12s5.385 12 12 12 12-5.385 12-12S18.615 0 12 0"/></svg></a>
</div>
</footer>
<script src="scripts/nav.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</body>
</html>