Table of Contents
Introduction
The Monitor+ 'R' package gives subscribers access to a huge range of reference market
data from global stock, commodity exchanges, currencies, crypto-currencies and
independent data vendors.
Before you begin, you will need to have 'R' installed on your computer and your
Monitor+ API key
available.
The Monitor+ package integrates into 'R' to make accessing the market data easy.
Market data
can be accessed easily with commands beginning with the class name
'idata'.
Installation.
If you do not have already 'R' (or the Monitor+ 'R' package installed) then please
click on the 'Install' button below.
You will need to have your API key available. If you cannot find the API key, see the 'My Account' section below for help. For any other problems, please see the 'Contact Us' section below.
Getting Help
The 'idmmonitor' package has detailed interactive help as can be seen in the RStudio screenshot below. Type 'idata' in the console window on the left and the available commands are displayed in a dropdown list. Select a command and press the 'F1' key to display the relevent help in the ‘Help’ tab (in the right section). Many of the help topics also have clickable links that can open the relevant section in the Monitor+ online API help.
The Monitor+ API documentation
The Monitor+ 'R' package is a subset of the full API. You can view the API documents by clicking on the 'Documents' menu above and selecting the 'API Documentation' menu.
The API documentation shows in detail the available functions and their parameters and should be referenced when writing 'R' code that uses the Monitor+ 'R' package. The API, 'R' and Python function and parameter names are very similar to make the online documentation familiar to all developers. Note that not all API functions or parameters are available (or needed) in the 'R' package.
If you need further assistance please go to the 'Contact Us' section below.
Locating your API key
You will need your Monitor+ API key to download the 'R' package. You should have received your API key from us via email. You can also access your API key by logging in using the top right 'Login' menu at the top of this page, logging in and viewing your account. If you are already logged in, your user name will be displayed on this menu (see the image below).
Click on the symbol in the edit box to see the API key. Click the 'Copy' link to copy the API key to the clipboard.
If you still have a problem locating your API key, please see the 'Contact us' section below.
Using the package
You will need your Monitor+ API key to access the data on the service. If you have a problem locating your API key, please see the 'Locating your API key' section above.
To begin you need to enable the ‘idmmonitor’ package, register your API key and get a session token from the remote API server. To do this you need to type three simple commands (in black text below) in the 'R' console. In the example below, comments are in green text and results from the server are in blue.
# Enable the library
> library(idmmonitor)Loading required package: R6
Loading required package: jsonlite
Loading required package: httr
# Register your API key with the service
> idata.set_api_key("XXXXX-XXXXX-XXXXX-XXXXX")Stored the new API key XXXXX-XXXXX-XXXXX-XXXXX.
# Get a session token
> idata.get_session_token()A new token 2b4a1038338c9b4234a1a8c5cc01ba3d has been set.
>
Once you have successfully entered the commands above and have a valid session token, you can access the full service. As you can see above, commands to the Monitor+ package are prefixed with the term 'idata'. A full list of functions available in the package is located at the bottom of this document.
Session tokens are needed to access data and metadata. Session tokens expire after a number of minutes of inactivity. The Monitor+ package will automatically attempt to get a new session token if the current one has expired. You can check the milliseconds of life remaining in the current session token with the query_session_token command below. You can also use it to test communications with the API server is OK.
> idata.query_session_token()
[1] 1796000
You should now be able to list datasources and their datasets. You can download values for any datasets that you have access to. You can check what datasources you can access using the 'idata.get_user_datasources' command.
User Favorites
The Monitor+ API allows you to build, structure and manage a list of user 'favorite' or frequently used datasets (time series). This ‘favorites’ list is designed to allow the user to create and manage their own selection of datasets from the many tens of thousands that may be available with their subscription. The favorites list is also is very useful for creating applications for end users.
There are 4 user "favorite" commands in the 'idata' class to help manage your favorite datasets. They are get_user_favorite_status(), get_user_favorites(), add_user_favorites() and remove_user_favorites().
Please look at the available 'R' functions table at the end of this document for more details. Also look at the API documentation for more detailed information on using each function. See the "The Monitor+ API documentation" section above for details.
You can also manage your list of favourite datasets using your user account menu and selecting the 'My Favorites' menu. After logging in, the 'Register/Login' top menu will display your user name. Click on this menu to access the 'My Favorites' page.
My Account
You can view your account details online by logging in using the 'Login' menu above at the top right of this page. If you are already logged in, your user name will be displayed on this menu (see the image above).
To login you will need your User Reference Number, Username and password (these should have been emailed to you). Click on the 'Login' menu and enter your reference number, user name and password. Once logged in, click on the the top right menu (with your user name) to access your account. From here you can see your datasources, reset your password or API key, manage your user favorites and more.
If you have problems accessing your account page, please check your emails page, contact your IT colleagues or see the 'Contact us' section below.
Contact us
For general enquiries please click the 'Contact' menu at the top of the window and select the contact choice you require.
For technical support enquiries, please email support@sarus.com with a subject of 'Monitor+ R Package Support Question'. Send your contact details, User Reference Number (if known), a description of the question and any images, output or screenshots necessary.
Please note we do not offer advice with any 'R' coding issues, only issues regarding accessing data from the API.
And finally…
If you have any questions or suggestions, please don’t hesitate to contact us. We’re always glad to offer assistance and advice.
Available 'R' Functions:
Function | Description |
---|---|
set_api_key | Register your API key to be able to get a session token. |
print_api_key() | Return the API key that was set with the set_api_key command. |
get_api_address() | Displays the selected API server address. |
get_api_version() | Returns the API version number. |
request_new_api_key() | Return a new API key (any active API key will be invalidated). |
get_session_token() | Return a new session token. |
query_session_token() | Return the remaining token life in milliseconds. |
renew_session_token() | Restore the current token to full life. |
revoke_session_token() | Invalidate the current token. |
print_session_token() | Display the current session token value. |
get_datasource() | Return metadata for one named datasource. |
get_all_datasources() | Return metadata for all available datasources. |
get_user_datasources() | Return metadata for the datasources that the user can access. |
get_datasets() | Return metadata for the datasets in one datasource |
get_selected_datasets() | Return metadata for multiple named datasets in one or more datasources. |
get_dataset_values() | Return a range of dataset values or averages for named datasets in one or more datasources. |
get_dataset_values_rc() | As with get_dataset_values above but values are returned formatted row X column. |
get_dataset_values_for_date() | Return dataset values (or averages)for named datasets (in one or more datasources) for a single date. |
get_user_favorite_status() | Return the server date and time that the user favorites list was last changed. |
get_user_favorites() | Return metadata for all the datasets in the user favorites list. |
add_user_favorites() | Add datasets to the user favorites list. |
remove_user_favorites() | Remove datasets from your user favorites list. |
get_my_account_details() | Return registered user account details including API key. |
set_return_raw_data(false) | If true return raw JSON is returned from all server requests. |
set_verbose | If true extra request details are displayed in the console. |
get_api_version | Returns the API version string from the server. |