nunosans / currency

A simple currency converter for iOS
https://itunes.apple.com/app/currency-simple-currency-calculator/id1109685198?mt=8
MIT License
83 stars 15 forks source link

Yahoo API #39

Open ghost opened 6 years ago

ghost commented 6 years ago

It seems that the Yahoo API that you use has recently stopped working (or very unstable ?), returning error "No definition found for Table yahoo.finance.xchange"

nunosans commented 6 years ago

@maximee44 Acknowledged. I will consider moving to a different API in the future. Thanks!

nunosans commented 6 years ago

@maximee44 The free.currencyconverterapi.com API has a limit on the free plan. I will consider other options for getting the exchange rates, but thank you for raising this issue!

istorepro commented 6 years ago

any new update ? we can use fee api ?

nunosans commented 6 years ago

@isotepro no updates at this stage.

I need to find an API that offers the same that Yahoo offered:

That doesn't seem to exist. But free.currencyconverterapi.com that @maximee44 suggested comes close.

I'm considering updating the app to use free.currencyconverterapi.com, or to pull it out from the store until there's a suitable API. I'll update the ticked on how that goes.

istorepro commented 6 years ago

this also have issue

`let url = URL(string: "https://query.yahooapis.com/v1/public/yql?q=" + "select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(" + "%22USD" + self.code + "%22)&diagnostics=true&env=store%3A%2F%2F" + "datatables.org%2Falltableswithkeys")

        let task = URLSession.shared.dataTask(with: url!, completionHandler: {(data, response, error) in

            guard data != nil else {
                print("Error performing Yahoo query.")
                hideActivityIndicator()
                return
            }

            let xml = SWXMLHash.parse(data!)

            guard let rate = xml["query"]["results"]["rate"]["Rate"].element?.text else {
                print("Could not parse XML request.")
                hideActivityIndicator()
                return
            }`
nunosans commented 6 years ago

@istorepro thank you. please open a new issue or a merge request to fix that issue.

gbr33 commented 6 years ago

Hi Maybe you can add this free API http://www.mycurrency.net/page/Free+Currency+Converter+API