TS API for Reports and Market Data

Modified on Thu, 22 Oct at 8:21 PM

Print

The TS API lets users and data centres fetch data from TS reports and market data:

  • Report data: any report in TS, run in real time (/realtime/), or a daily snapshot of a system report (/atdate/ and /daterange/).
  • Market data: FX and interest rates and more, as they're shown in TS.

Get started

There are two ways to authenticate:

Give a user access for Excel or Power BI

  1. Sign in to TS as a user with permission to edit users.
  2. In Roles & Permissions, give the user who wants to use the API from Excel or Power BI the permission Public API Access.

    Roles and Permissions in TS, with a user selected and Public API Access in their user permissions

The API now accepts that user's requests.

Set up token access for tools, scripts and applications

  1. Set up an application in your identity provider. If your organisation uses Entra ID, see Register an application in Microsoft Entra ID for the TS API.
  2. Call the API once, so that TS creates an API user; see Use Tools, Scripting or Integration Platforms to access TS Report and Market Data API.
  3. Sign in to TS as a user with permission to edit users, and give the new API user the permission Public API Access.

    Roles and Permissions in TS, with the new API user selected and Public API Access in its user permissions

The API now accepts the application's requests.

Ways to call the API

ToolHow
Excel or Power BISee Use Excel or Power BI to access TS Report and Market data API.
cURL, PowerShell, Logic AppsSee the examples in Use Tools, Scripting or Integration Platforms to access TS Report and Market Data API.
PostmanAdd an application and create a token; see Register an application in Microsoft Entra ID for the TS API.
PythonDownload the attached file FetchTSdata.py (below the article) and update the tenant and customer name (domain) in it.

Versions

Every request names an API version: add /v and the version number to the endpoint's URL. Old versions are kept for six months.

https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/realtime/v3
ReleaseVersionAdded
26.5v4VaR scenarios (/var/) and historical market values (/historicalmarketvalue/)
26.4v4FX rates against a specific currency, rather than by the currency hierarchy set in Currencies (see FX rates)
25.13v3Intraday rates in /fx/ and /fxfwd/
25.9v3The reports in TS (see Reports (create new and update a report)), as an extension of /realtime/
25.7v3Date ranges for FX and interest rate market data; FX market data against a currency; YTD and MTD rates, and bid and ask rates with forward points; the parameter date (called dateCode before)
25.3v2The /fxfwd/ endpoint, interpolating rates for specific maturity dates
25.1v2An improved JSON format

Report data endpoints

The base URL for report data is:

https://ts.treasurysystems.com/tenants/[CUSTOMERNAME]/api/reportdata/

The /atdate/ and /daterange/ endpoints return a snapshot taken every day at 21:00 CET, based on a system report you manage in TS; see Save Report Data to the API. You can update the snapshot with the TS Autopilot; see Schedule the saving/updating of API data.

/atdate/

Returns the dataset created on the date you give.

ParameterRequiredDescription
dateYesThe date to fetch the dataset for, as a date code (see Date codes below)
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/atdate/v3?date=20241001

/realtime/

Runs the system report in real time and returns its data. If anything changes in TS and you call it again the same day, you may get a different dataset. This endpoint has no parameters.

https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/realtime/v3

/realtime/[report ID]/

Runs the report with the given ID in real time and returns its current data. If anything changes in TS, the next call may return a different dataset. To find a report's ID, select Report ID in the reports view.

The reports view in TS with Report ID selected, showing each report's ID next to its name

The three parameters are optional. Each one replaces the value saved in the report. They aren't supported for the "Multiple Balance Days" report.

ParameterRequiredDescription
balanceDateNoThe report's balance date
measuringPeriodStartNoThe start of the report's measuring period
measuringPeriodEndNoThe end of the report's measuring period
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/realtime/12345/v3?balanceDate=2025-04-01&measuringPeriodStart=2025-04-01&measuringPeriodEnd=2025-06-30
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/realtime/10066/v3?balanceDate=2025-05-31
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/realtime/10066/v3

Report 10066 in TS, with its saved balance date marked on the Overview tab

/daterange/

Works like /atdate/, but returns every dataset between two dates, as a JSON collection. For example, fromDate=20240301 and toDate=20240401 return the daily datasets from 1 March to 1 April 2024.

ParameterRequiredDescription
fromDateYesThe start of the date range, as a date code
toDateYesThe end of the date range, as a date code
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/reportdata/daterange/v3?fromDate=20241001&toDate=20241010

Market data endpoints

The base URL for market data is:

https://ts.treasurysystems.com/tenants/[CUSTOMERNAME]/api/marketdata/

/fx/

Returns FX rates for a date, as a JSON object: the time the rate is valid, the base currency, the price currency, the mid, bid and ask rates, and the periods the rates are valid for. YTD and MTD rates are included for the SPOT period.

ParameterRequiredDescription
dateYesA date code. Set it to intradayrate to get intraday rates.
priceCurrency (v4), currency (v3)YesThe currency to get rates against; see FX rates. v3 returns rates in the default market convention. v4 returns the price currencies, unless defaultConvention is true.
periodsNoOne or more periods, separated by semicolons (SPOT;3M;6M). The default is SPOT. Available: ALL, SPOT, 1W, 2W, 3W, 1M to 11M, 1Y, 2Y, 3Y. ALL returns every period.
defaultConvention (v4)NoTrue returns default market convention rates. False, or left out, returns price currencies.
# v4
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/v4?date=260120&priceCurrency=USD&periods=ALL&defaultConvention=true
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/v4?date=260120&priceCurrency=SEK
# v3
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/v3?date=20240312&currency=SEK
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/v3?date=intradayrate&currency=SEK
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/v3?date=20240312&currency=USD&periods=SPOT;3M;6M

/fx/daterange/

Returns FX rates for a range of dates, with the same content for each day as /fx/. The parameters are the same as for /fx/, with a from and to date in place of the date.

ParameterRequiredDescription
fromDateYesThe start of the date range, as a date code
toDateYesThe end of the date range, as a date code
priceCurrency (v4), currency (v3)YesThe currency to get rates against; see FX rates
periodsNoOne or more periods, as for /fx/
defaultConvention (v4)NoTrue returns default market convention rates
# v4
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/daterange/v4?fromDate=260217&toDate=260220&priceCurrency=SEK
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/daterange/v4?fromDate=251215&toDate=260401&priceCurrency=SEK&defaultConvention=true
# v3
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fx/daterange/v3?fromDate=20240312&toDate=20240316&currency=USD&periods=SPOT;3M

/ir/

Returns interest rates for a date, as a JSON collection.

ParameterRequiredDescription
dateYesA date code, as for /fx/
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/ir/v3?date=20240312

/ir/daterange/

Returns interest rates for a range of dates, with the same content for each day as /ir/.

ParameterRequiredDescription
fromDateYesThe start of the date range, as a date code
toDateYesThe end of the date range, as a date code
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/ir/daterange/v3?fromDate=20240312&toDate=20240316

/fxfwd/

Contact sales if you want to use this endpoint.

Returns an FX forward rate for a date. For a broken date, it returns the rate interpolated for a maturity date between the start and end of the tenor period. The rate depends on the deal date, the maturity date, the currency pair, and whether you ask for buy (ask) or sell (bid) rates.

ParameterRequiredDescription
buyOrSellYesBuy or Sell: which rates are returned
currencyPairYesA/B gives the number of units of currency B per unit of currency A; B/A gives the opposite
maturityDateYesThe date code the rate is interpolated up to
dealDateYesThe date code the rate is interpolated at
rateDateNoThe date code of the rate table to use; intradayrate uses intraday rates (see Intraday FX rates)
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fxfwd/v3?buyOrSell=Sell&currencyPair=EUR/SEK&maturityDate=20250311&dealDate=20250307
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/fxfwd/v3?buyOrSell=Sell&currencyPair=EUR/SEK&maturityDate=20250311&dealDate=20250307&rateDate=intradayrate

FX rates in TS for EUR/SEK, annotated with the deal date, currency A and B, the tenor period, and a maturity date between SPOT and 1W

/var/

Returns the market value in the consolidated currency; see Value at Risk.

ParameterRequiredDescription
fromDateYesThe start of the market value period
toDateYesThe end of the market value period
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/var/v4?fromDate=260217&toDate=260220

/historicalmarketvalue/

Returns the market value in the consolidated currency; see Historical Market Values.

ParameterRequiredDescription
fromDateYesThe start of the market value period
toDateYesThe end of the market value period
https://ts.treasurysystems.com/tenants/CUSTOMERNAME/api/marketdata/historicalmarketvalue/v4?fromDate=260217&toDate=260220

Errors and limits

Errors

Any unexpected error returns status code 500. If errors occur, contact TS support.

Rate limit

The standard limit is 100 requests a day. Contact sales if you need more.

Response codes

CodeMeaning
200 OKThe request succeeded
204 No ContentThere are no datasets to return for the endpoint
400 Bad RequestInvalid request: the endpoint doesn't follow the expected pattern
401 UnauthorizedAuthentication failed
403 ForbiddenThe API user is missing the permission Public API Access
404 Not FoundThe resource wasn't found
405The parameters weren't entered correctly
500 Internal Server ErrorSomething went wrong on the server

Date codes

Write dates as a date, such as 20240101, or as a code such as TODAY, which is the date the request is sent.

CodeMeans
TODAYThe current date
DThe next day
BDThe next business day
WA week from now
MA month from now
QA quarter from now
YA year from now
Monday to SundayThe next such weekday after today

Combine an operator (+ or -), a number and a code:

  • -5W: 35 days before today
  • -7BD: 7 business days before today, taking holidays into account
  • -1Monday: the Monday before today

Related articles

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

More in TS Report and Marketdata API

Still need help? Reach people who already know your configuration.

Submit a ticket