3

I need to check current Mastercard rates for multiple currencies in my app but I can't found any correct API to do this.

In the same time, large count of sites has regular updates for this rates. Can someone tell me where can I get these rates (buy and sell currency) information?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
DrHolera
  • 189
  • 1
  • 14

3 Answers3

2

Just wanted to add to this because it looks like the accepted answer is now out of date.. They appear to have a Currency Conversion Calculator SDK for various languages. Have tried it out, and it appears to do the job!

Matthew Trout
  • 709
  • 5
  • 20
  • Accepted answer has been updated thanks to a note from @araslanov_e. (You might have tried the same approach instead of starting a new answer.) Do you know of new links for their forum so that we can update the credit to Brett Thomson, whose post on the original MasterCard API Showcase forum is the original source for this information? – kjhughes Jul 13 '22 at 12:56
1

If there is no API for that, you'd have to find another way to obtain that information.. You could just do "web scraping" like ScraperWiki

Web scraping means that you first scrape the data of the site. There are a lot of ways to do this, either you write your own code or just use a library.

After you have the data, you have to parse it to get it in the correct object like in an array or as JSON, you name it.

Alexander
  • 1,554
  • 2
  • 16
  • 23
  • I'm not sure how ScraperWiki can help me. I've never used it before. Could you provide some information about it? – DrHolera Apr 06 '16 at 08:01
  • Here is a better tutorial: https://scotch.io/tutorials/scraping-the-web-with-node-js – Alexander Apr 06 '16 at 08:39
  • I'll try this solution but I think HTML parsing is not very reliable. – DrHolera Apr 07 '16 at 07:16
  • 1
    Yes, when the the site changes their layout it won't work anymore. Plus some sites insist to not "steal" their data. You'll find a way, good luck. – Alexander Apr 07 '16 at 08:47
1

2022 Update

Mastercard's public APIs do not include one for currency exchange rates, but they do have a Currency Conversion Tool:

Source: MasterCard API showcase forum answer by Brett Thomson.

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • 1
    https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/api-reference/ – araslanov_e Jul 13 '22 at 06:30
  • @araslanov_e: Thank you. Links updated, except for the two related to for Brett Thomson forum post, which I can no longer find. Wish everyone honored [Cool URIs don't change](https://www.w3.org/Provider/Style/URI). – kjhughes Jul 13 '22 at 12:51