Menu

Month-end close: getting the exchange rate that was in force on a date
📰

Month-end close: getting the exchange rate that was in force on a date

DEV Community: python·chathuranga basnayaka·3 days ago
#w1yhU1f5
#devtopython#devto#dev#rate#date
Long article (299 words) — no AI summary yet.
Reading 0:00
15s threshold

Your books close on the 30th. The 30th is a Sunday. Which rate do you use?

Most rules say: the last rate published on or before that date. Frankfurter v2 will return a value for a weekend date, which is convenient, but for an audit trail you also want to know which publication it came from.

Ask for the date, get the rate in force

import os , requests

r = requests . get ( "https://allratestoday.com/api/v1/central-bank/ecb/2026-11-29" , params = { "source" : "EUR" , "target" : "USD" } , headers = { "Authorization" : f "Bearer {os.environ['ART_KEY']}" } , ) . json ( )

print ( r [ "rate_date" ] ) # 2026-11-27 (the Friday publication) print ( r [ "published_on_requested_date" ] ) # False

Enter fullscreen mode

Exit fullscreen mode

rate_date tells you which table the number came from, and published_on_requested_date tells you whether the bank published on the day you asked for.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.