Last answered:

25 Aug 2022

Posted on:

29 Oct 2021

0

I am not getting the filtered data using symbols parameter

I have gone through the documentation and the tutorial video. I have used the correct parameters and the code. However I am not getting the filtered set of results. It is showing me the entire set of rates. What could have possibly gone wrong?
This is my code -
base_url = 'http://api.exchangeratesapi.io/v1/latest?access_key=d907503a0296cec21d4fcf96d293c60a&format=1'
url= base_url + '?symbols=INR,USD'
data = requests.get(url).json()

I am getting 200 as response status but it is returning all the rates instead of only two.

2 answers ( 0 marked as helpful)
Posted on:

15 Mar 2022

0

Use & instead of ?. It should solve your problem.

Posted on:

25 Aug 2022

0

I can't sign up on the website in this video...It always redirect me to https://apilayer.com

If you want to see only two rates, e.g. INR & USD. The following code should work well, as the KEY is provided by "Nishi Paul" in this post:

url = 'http://api.exchangeratesapi.io/latest?symbols=INR,USD&access_key=d907503a0296cec21d4fcf96d293c60a'

Otherwise, you can get the same result from the following code as the KEY is provided freely after signing up on  https://apilayer.com

url = 'https://api.apilayer.com/exchangerates_data/latest?symbols=INR,USD&apikey=__________'
url 

Submit an answer