skillfed

beaapi

BEA API Python package

beaapi v0.2.0 153.3K downloads/30d#10,885 on PyPI66
Permissive license CC0 Active released

What it is and what it does

beaapi is a Python wrapper around the U.S. Bureau of Economic Analysis public data API. It simplifies access to BEA's economic datasets—including NIPA tables, GDP by industry, international trade accounts, and regional data—by providing functions to list available datasets, discover parameters and their allowed values, search metadata by keyword, and retrieve data directly into pandas DataFrames.

The package handles the HTTP communication and response parsing, so you work with structured data immediately. It requires only pandas as a runtime dependency and supports current Python versions. You supply an API key (obtained free from BEA) and call functions like `get_data()` to fetch specific tables, `get_parameter_list()` to explore what parameters a dataset accepts, and `search_metadata()` to find tables by keyword. The result is always a DataFrame, making downstream analysis straightforward.

Use it for:

  • Retrieve quarterly or annual NIPA tables for macroeconomic analysis and forecasting.
  • Query GDP-by-industry data to analyze sectoral economic performance over time.
  • Access international trade and investment position data for cross-border economic research.
  • Search metadata to discover which BEA tables contain specific economic indicators.
  • Build automated data pipelines that fetch updated economic statistics on a schedule.
  • Combine BEA data with other sources in a pandas workflow for integrated economic analysis.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

beaapi retrieves and processes economic data from the U.S. Bureau of Economic Analysis API, returning results as pandas DataFrames for analysis and visualization.

Yes. beaapi is actively maintained, has no known vulnerabilities, installs with minimal friction, and is the official Python interface to BEA's economic data. If you need U.S. economic statistics—GDP, trade, industry output, or regional data—this is the right tool. The only prerequisite is obtaining a free API key.

Install

beaapi on PyPI

pip

pip install beaapi

uv

uv add beaapi

poetry

poetry add beaapi

Installing beaapi

Before you install

Low friction to install; depends only on pandas. The package is actively maintained with recent commits and is in beta status, suitable for production use with the understanding that the API surface may evolve.

License in practice

Licensed under CC0 (public domain), so you may use, modify, and distribute the package freely without attribution requirements or restrictions.

Quickstart

pip install beaapi

import beaapi

beakey = 'YOUR_36_DIGIT_API_KEY'
bea_tbl = beaapi.get_data(beakey, datasetname='NIPA', TableName='T20305', Frequency='Q', Year='2015')

You must register for a free BEA API key at https://apps.bea.gov/api/signup/ before making any data requests.

Verify before relying

  • Whether the package handles rate limiting or pagination for large data requests automatically.
  • Performance characteristics when querying across multiple datasets or years simultaneously.
  • Whether offline metadata caching is fully functional or requires periodic API calls.

Package facts

License CC0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pandas
Maintenance actively maintained — 178 days since the last release
Last repo commit
First released
Downloads 153,316/month — #10,885 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: beaapi-0.2.0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: EducationIntended Audience :: Financial and Insurance IndustryIntended Audience :: Science/ResearchLicense :: Public DomainOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsProgramming Language :: Python :: 3

Tags

BEA economic data APIUS economic statistics retrievalNIPA table data accessGDP and national income datainternational trade statisticsregional economic dataeconomic dataset queries
economic-datagovernment-apidata-retrieval

More Information Analysis packages