Javascript 2021 - "Displaying quotes"

Right now I am doing JavaScript Course 2021. I am at “Displaying quotes” And in order to finish the problem I have to use a link to an API quote for exchanging “fromToken” “toToken.”. But the link the instructor gave, is no longer available because 1inch has moved from v3.0 to v4.0. I also tried to find similar quotes, but I failed.

The link from the course is: https://api.1inch.exchange/v3.0/quote?fromTokenAddress=0x2260fac5e5542a773aa44fbcfedf7c193bc2c599&toTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&amount=10000000000

Can anyone give me a similar link or a solution to my problem?

1 Like

Hey @Zolee, hope you are well.

Indeed, 1inch have updated their API, I have added the link to the documentation to the lessons about it, I have tested the following link which is the requested URL with your parameters just to verify that is working.

https://api.1inch.io/v4.0/1/quote?fromTokenAddress=0x2260fac5e5542a773aa44fbcfedf7c193bc2c599&toTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&amount=10000000000

You can also try over their documentation and using the ‘quote’ function

(On the URL that you posted, its does not have a numbered folder after the version, i think that folder number is related to the chain you want to use, ‘1’ is for eth for example)

Hope this helps.

Carlos Z