Programmatic access of ICTax exchange rates

I have a long list of interest payments in another currency which happened on different dates. For my tax return* I need to get the CHF exchange rate for each of them. The way I know how to get them is on the ICTax website ICTax - Income & Capital Taxes using the box on the right hand side.

Anyone know how to get the exchange rates for every day in the year for the currency i care about? Or to directly get them via API?

Thanks in advance and happy new year to the community.

* Yes, this is me: https://www.youtube.com/watch?v=UlJtfbk1eRs

You can use the annual average published by the tax authorities.

It is accepted by the tax authorities and will simplify your life.

1 Like

I always saw monthly and daily. Where are annual rates published ?

Cours moyen annuel will be published here next week (pdf file, see FY 2023 for comparison)

https://www.ictax.admin.ch/extern/fr.html#/ratelist/2024

2 Likes

Thanks, that’s helpful. Nonetheless I would still be interested to know how to get the numbers automatically as it would make doing my spreadsheets much simpler

Given it says ©SIX, they likely won’t provide access through an API. You can check on SIX if there’s an easy access (my guess is no since they’d want to monetize it).

edit: fwiw if you know a bit how those things work it’s easy to access it, but the disclaimer/screenshot you pasted makes it clear this isn’t allowed.

thanks for the tip! I inspected the network traffic using chrome developer tools when changing the calendar date and saw that the data is coming by making a POST request to https://www.ictax.admin.ch/extern/api/coreGadget/exchangeRates.json, however I was unable to get it working by requesting using curl on the command line in the 10 minutes I tried. Not sure if I just messed something up with the payload/headers or if I am missing something more fundamental.

Indeed as you say, probably for someone who knows about these things it would be pretty straightforward to figure it out.