• If you would like to post, please check out the MrExcel Message Board FAQ and register here. If you forgot your password, you can reset your password.
  • Excel articles and downloadable files provided in the articles have not been reviewed by MrExcel Publishing. Please apply the provided methods / codes and open the files at your own risk. If you have any questions regarding an article, please use the Article Discussion section.
J

Template to create a URL for Power Query to make a API Call for Federal Reserve Economic Data (FRED)

I've been able to create formulas for the top 3 rows in the original post. The field names have also changed. Here's a snapshot:
1687356801752.png

I had to post a snapshot because the formulas require a key which I didn't want to post. Here are the formulas. Be aware that FAKEKEY is a named range for the required API key. In the formulas below it is set to
Excel Formula:
="api_key=abcdefghijklmnopqrstuvwxyz123456"

The formulas for B1:B3 are as follows:
Excel Formula:
=FILTERXML(WEBSERVICE("https://api.stlouisfed.org/fred/series?series_id="&$B$4&"&"&FAKEKEY), "//series[@id='"&$B$4&"']/@"&LOWER(A1) )
Excel Formula:
=FILTERXML(WEBSERVICE("https://api.stlouisfed.org/fred/series?series_id="&$B$4&"&"&FAKEKEY), "//series[@id='"&$B$4&"']/@"&LOWER(A2) )&", "&
FILTERXML(WEBSERVICE("https://api.stlouisfed.org/fred/series?series_id="&$B$4&"&"&FAKEKEY), "//series[@id='"&$B$4&"']/@seasonal_adjustment" )
Excel Formula:
=FILTERXML(
WEBSERVICE("https://api.stlouisfed.org/fred/release/sources?release_id="&
   FILTERXML(WEBSERVICE("https://api.stlouisfed.org/fred/series/release?series_id="&$B$4&"&"&FAKEKEY),
"//release/@id")&"&"&FAKEKEY), "//source/@name")
Note that all of the cells in column A use the custom format
#,##0.00;-#,##0.00;0.00;@": "
which adds a colon and a space at the end of text which is right aligned. I changed the names of the first two items so I could use them in the formulas and they better reflect the data itself.

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top