Accessing BEA’s API through R

Here’s a simple script that pulls BEA data from its API into an R dataframe. The function below is written specifically for its NIPA tables – if you want data from the regional tables you’ll need to add a few parameters as arguments, but this is the basic gist of it.