Title: Fed Data Import
Last modified: August 21, 2016

---

# Fed Data Import

 *  Resolved [bay-fish.com](https://wordpress.org/support/users/bay-fishcom/)
 * (@bay-fishcom)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/fed-data-import/)
 * What I’m about to ask is gold, you should sell it as a plug-in.
 * What I want to do is import data from the St Louis Fed site.
 * [http://api.stlouisfed.org/docs/fred/overview.html](http://api.stlouisfed.org/docs/fred/overview.html).
   
   [http://api.stlouisfed.org/docs/fred/#Toolkits](http://api.stlouisfed.org/docs/fred/#Toolkits)
 * This is what they say:
 * Our API accommodates any programming language that can parse XML or JSON and 
   communicate with our servers using HTTP. The FRED® API is based on the REST web
   service architecture. REST leverages familiar web technologies. Like a website,
   the FRED® API uses HTTP to receive requests and send responses. Also like a website,
   the FRED® API uses URLs to specify requests. This web service differs from a 
   normal website by sending XML or JSON instead of HTML. HTML is a visual medium
   that’s not always strictly formatted and flexible enough for arbitrary data structures.
 * Your plug-In (which is fantastic) says it can import JSON and XLS. So how do 
   I get TablePress to go get the data and add it to a table?
 * What I want to do is import the Daily 10-Year Treasury Data (or 5-Year, etc.)
   to calculate values and display them in on a webpage.
 * Maybe using PHP? The Fed site says they have a PHP way of getting the data, and
   your documentation says PHP can be parsed in a cell.
 * Thank you in advance if you can help.
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/fed-data-import/#post-5148659)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * From what I can see, this won’t be trivial.
    You will indeed need PHP to make
   those requests to their API, but having that PHP in a table cell won’t work. 
   Instead, you will need to write a custom PHP script (e.g. based on the “FRED®
   API Toolkit for PHP” that they offer) that builds your request, according to 
   the documentation of their API, for the relevant data. Then you send that request
   to their servers, for which you presumably need an API key and a user account
   with them. From that, you will get (depending on what you specify) either an 
   XML or a JSON (which I recommend) response. You will then need to parse that 
   response and convert it into a two-dimensional array (that will be your table).
   Then, you can use that JSON and import it into TablePress. So, as you can see,
   it’s not as easy as simply importing data into TablePress here. You will first
   need to develop a custom script that retrieves the data and converts it to the
   necessary format for TablePress.
 * Regards,
    Tobias
 *  Thread Starter [bay-fish.com](https://wordpress.org/support/users/bay-fishcom/)
 * (@bay-fishcom)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/fed-data-import/#post-5148697)
 * That is a bit outside of my capability. Thank you for your response.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/fed-data-import/#post-5148781)
 * Hi,
 * no problem, you are very welcome! Maybe my suggestions can help in the future.
   
   I hope TablePress is still useful for you!
 * Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fed Data Import’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/fed-data-import/#post-5148781)
 * Status: resolved