Skip to content

Latest commit

 

History

History
48 lines (28 loc) · 1.62 KB

README.md

File metadata and controls

48 lines (28 loc) · 1.62 KB

MACROBOND Data API for MATLAB

This repository autogenerates the Macrobond Data API for MATLAB. The latest openAPI definition is pulled once a month from the official directory:

https://api.macrobondfinancial.com/swagger/v1/swagger.json

which generates the MATLAB files into /AutogeneratedAPI. This is then manually ammended to add a few bits like the authentication and finally packaged as a toolbox.

The official documentation for this api is published by macrobond here:

Macrobond WebAPI Documentation

How to use

You need to create a MacrobondClient, for example:

mc = MacrobondClient()

and optionally pass the scopes (scopes = ["macrobond_web_api.read_mb"]. Otherwise, all scopes will be used.

There is no need to pass any authentication, if not set, it will automatically prompt for it.

At this point, the API is completely autogenerated, so some of the methods my have odd names, For example:

data = mc.Series.seriesFetchseriesGet("usgdp")

In time, the most common methods will be streamlined a bit, but fo the full reference, please look at the official doc:

Macrobond WebAPI Documentation

or in the help of the method:

help macrobond.api.Series.seriesFetchseriesPost

be aware that many of the classes needed are in the models namespace. For example:

er = macrobond.models.EntityRequest(name = 'usgdp', ifModifiedSince='2024-10-1');
data = macrobond.api.Series.seriesFetchseriesPost(er);