#Fred Basically the same thing as reonomy/node-fred for browser usage (replaced mikeal/request with jQuery).
Also using afeld/jsonp to work around XHR issues.
Fred and the FRED API require and API key. You can request an api key from the official Federal Reserve web site.
Include the JS files:
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
<script type="text/javascript" src="fred.js"></script>
Create an instance of fred
with your API key:
var fred = Fred('GiVeMe1APIKeYPLeaSe');
Request a resource:
fred.series.observations('GDP', function(err, grossNationalProduct) {
if (!err) console.log(grossNationalProduct.observations)
});
The documentation for the FRED API is available on the Federal Reserve's web site.