0

I'm trying to build a simple PHP page that pulls today's EURUSD exchange rate from Visa.com.

The URL is http://usa.visa.com/support/consumer/travel-support/exchange-rate-calculator.html/?fromCurr=USD&toCurr=EUR&fee=0&exchangedate=11/23/2015

I want to get today's rate without filling out the form every time.

But when I tried to run file_get_contents with this URL (tried with 2 separate servers) I keep getting

Access Denied

You don't have permission to access "http://usa.visa.com/support/consumer/travel-support/exchange-rate-calculator.html/?" on this server.

Other URLs work fine.

Even http://usa.visa.com does not work.

Dan
  • 1,257
  • 2
  • 15
  • 31
  • 1
    They will have it blocked so people can't do exactly what you're trying to do. Services charge to provide live conversion rates. You might want to try https://openexchangerates.org/ – Styphon Nov 24 '15 at 11:49
  • The problem is that Visa's rate is different from the 'official' bank rate. I haven't been able to find it on any other site. What exactly are they blocking? How is the PHP request different from me going though my browser? I am able to skip the form by just changing the date in the URL. – Dan Nov 24 '15 at 11:55
  • Could also be a permissions problem, check this answer: http://stackoverflow.com/questions/3488425/php-ini-file-get-contents-external-url All else fails, go to CURL & be sure to set the same useragent as a common browser in the headers. That will convince the receiving server that you're a browser and will return results accordingly. – Practically Nov 24 '15 at 12:12
  • I tried CURL; same error. – Dan Nov 24 '15 at 13:42
  • Can I go through a proxy server somehow? – Dan Feb 09 '18 at 00:13

0 Answers0