Menu

One currency pair, every central bank: comparing official USD/INR rates across sources
📰

One currency pair, every central bank: comparing official USD/INR rates across sources

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

Ask five central banks for USD/INR and you'll get five slightly different numbers. They fix at different times of day, some publish a mid rate and others buying and selling rates, and some publish INR only through a cross rate.

Frankfurter v2 picks a source for you when you ask for a pair, or lets you choose a provider explicitly. Sometimes you want to see them all side by side: for a reconciliation, a dispute, or just to understand why two systems disagree.

Every official rate for a pair, in one call

import os , requests

r = requests . get ( "https://allratestoday.com/api/v1/central-banks/rates" , params = { "source" : "USD" , "target" : "INR" } , headers = { "Authorization" : f "Bearer {os.environ['ART_KEY']}" } , ) print ( r . json ( ) )

Enter fullscreen mode

Exit fullscreen mode

This returns each covered institution's latest official rate for the pair, with the institution, its publication date and the rate type.…

Continue reading — create a free account

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