1 00:00:00,530 --> 00:00:05,060 All right guys it's time for the boss level challenge. 2 00:00:05,060 --> 00:00:10,740 And in this challenge we're going to be using what we learned in previous modules to build out the functionality 3 00:00:10,770 --> 00:00:16,800 of our app so that we can actually get real time data for the price of bitcoin theorem and like coins 4 00:00:17,010 --> 00:00:20,190 to give our app its full functionality. 5 00:00:20,190 --> 00:00:25,020 And we're going to be using the API provided by coin API dot Io. 6 00:00:25,440 --> 00:00:32,040 So if you head over to this Web address and take a look at their API docs you'll see that they can provide 7 00:00:32,040 --> 00:00:35,310 a whole bunch of data on a lot of different coins. 8 00:00:35,730 --> 00:00:39,540 But what we're mostly interested in is the exchange rates. 9 00:00:39,540 --> 00:00:46,710 So and to rest api exchange rates you can see that the way that you would be out to get the price of 10 00:00:46,710 --> 00:00:53,730 bitcoin or any other cryptocurrency that they provide has a U.R.L. that look something like this. 11 00:00:53,760 --> 00:01:00,350 So you have the base U.R.L. up to here and then you have the cryptocurrency identifier. 12 00:01:00,570 --> 00:01:07,170 And then after a fourth flash you have the fiat currencies such as U.S. dollars or pounds sterling or 13 00:01:07,170 --> 00:01:08,370 euros. 14 00:01:08,370 --> 00:01:14,100 And this will give you back a piece of Jason data that looks something like this where you can tap into 15 00:01:14,160 --> 00:01:19,320 this rate object and get hold of the current value. 16 00:01:19,380 --> 00:01:23,370 Say for example in this case the price of bitcoins in U.S. dollars. 17 00:01:23,760 --> 00:01:25,110 But that's not it. 18 00:01:25,110 --> 00:01:28,730 We also have to provide a way of authenticating ourselves. 19 00:01:28,740 --> 00:01:35,000 So an API key just like what we did in the Kliman app when we worked with the open weather map API. 20 00:01:35,640 --> 00:01:42,720 So in order to get hold of an API key you have to head over to coin API dot Io slash pricing and we're 21 00:01:42,720 --> 00:01:46,950 just going to go for the free one which limits us to 100 daily requests. 22 00:01:46,950 --> 00:01:50,010 But that's more than enough to complete our challenge. 23 00:01:50,010 --> 00:01:57,600 So now if you click on get an API key fill in your email and your name the title you can leave us students 24 00:01:58,080 --> 00:02:05,760 and company size leave as one to 10 and then click on get a free API key and then go into the email 25 00:02:05,760 --> 00:02:13,630 that you typed in and you should find an email from KOIN API dot Io giving you access to your API key. 26 00:02:13,890 --> 00:02:18,780 So then the final U.R.L. that you're looking at will look something like this. 27 00:02:18,780 --> 00:02:27,330 So it's rest coin API dot I O slash version 1 V1 slash exchange rate slash the cryptocurrency and then 28 00:02:27,390 --> 00:02:33,060 slash the fiat currency and all of these symbols already listed in the starting projects so you don't 29 00:02:33,060 --> 00:02:34,500 have to worry about that. 30 00:02:34,770 --> 00:02:40,560 And then at the end of the URL we can tag on the API key just like what we did with the parameters in 31 00:02:40,560 --> 00:02:48,310 the open weather map API and then we can set it equal to the API that they sent us through email like 32 00:02:48,430 --> 00:02:49,410 this. 33 00:02:49,480 --> 00:02:56,290 And now when I go ahead and hit enter you can see it gives me back that data and the current price of 34 00:02:56,290 --> 00:03:01,300 bitcoin in U.S. dollars and this works for of course any other currency. 35 00:03:01,300 --> 00:03:07,190 So say if we wanted to know it in euros or if we wanted to know the price of Varian. 36 00:03:08,050 --> 00:03:13,710 So this is going to be the U.R.L. that you're going to be working with in order to complete this challenge.