1
00:00:00,690 --> 00:00:05,010
First, let's take a look at what application programming interfaces

2
00:00:05,070 --> 00:00:10,070
are and then we'll see how we can use them to start pulling in some data from the

3
00:00:10,560 --> 00:00:13,290
internet. So when you're browsing the web,

4
00:00:13,320 --> 00:00:17,070
you might've realized that there's a lot of websites out there that carry a

5
00:00:17,070 --> 00:00:19,140
whole bunch of data. For example,

6
00:00:19,140 --> 00:00:24,140
you could go onto Yahoo weather and see next week's weather predictions for

7
00:00:24,390 --> 00:00:25,650
any city in the world,

8
00:00:26,100 --> 00:00:31,100
you could go onto Coinbase and see what is the current market value of various

9
00:00:31,650 --> 00:00:34,500
cryptocurrencies like Bitcoin and Ethereum.

10
00:00:35,130 --> 00:00:39,600
You can also go onto the MBA website and look at various stats about your

11
00:00:39,600 --> 00:00:42,330
favorite basketball players. Now,

12
00:00:42,480 --> 00:00:45,540
what if we wanted to use the data that they have?

13
00:00:45,780 --> 00:00:50,250
How can we tap into it and use it in our own programs? Well,

14
00:00:50,280 --> 00:00:53,790
that's where application programming interfaces come into play.

15
00:00:54,390 --> 00:00:58,320
They all are a set of commands, functions, protocols, and objects

16
00:00:58,680 --> 00:01:03,680
that programmers can use to create software or interact with an external system.

17
00:01:05,430 --> 00:01:06,720
In the upcoming lessons

18
00:01:06,750 --> 00:01:11,280
what we're going to be focusing on is this interacting with external systems.

19
00:01:11,970 --> 00:01:12,510
Namely,

20
00:01:12,510 --> 00:01:17,510
we're going to try and interact with various websites and pull live data from

21
00:01:17,910 --> 00:01:20,010
those websites. Essentially,

22
00:01:20,010 --> 00:01:25,010
the API is an interface or rather a sort of barrier between your program and an

23
00:01:26,940 --> 00:01:27,900
external system.

24
00:01:28,530 --> 00:01:33,530
And what you're trying to do is you're trying to use the rules that the API has

25
00:01:33,810 --> 00:01:38,810
prescribed to make a request to the external system for some piece of data.

26
00:01:40,650 --> 00:01:42,810
And if you have structured your request

27
00:01:43,080 --> 00:01:48,080
according to all of the requirements that this external system has set out in

28
00:01:48,090 --> 00:01:48,923
their API,

29
00:01:49,200 --> 00:01:54,200
then they will respond to you appropriately and give you the data that you want.

30
00:01:56,940 --> 00:01:58,830
But if you don't follow the rules,

31
00:01:59,040 --> 00:02:03,090
then your request will be invalid and they will tell you to go away.

32
00:02:04,260 --> 00:02:09,120
So if we think about the websites we saw before, Yahoo weather has a Yahoo

33
00:02:09,120 --> 00:02:10,050
weather  API

34
00:02:10,110 --> 00:02:14,700
which you can tap into using your programs or apps and get things like 10-day

35
00:02:14,700 --> 00:02:18,330
forecast, wind, atmosphere, astronomy conditions,

36
00:02:18,750 --> 00:02:21,360
and Coinbase has their own API,

37
00:02:21,420 --> 00:02:26,420
which lets you tap into the current live prices of various cryptocurrencies.

38
00:02:28,020 --> 00:02:32,310
And of course, the MBA also has an API for you to be able to get various

39
00:02:32,310 --> 00:02:37,310
information that you're interested in on leagues, teams, players, games and a whole

40
00:02:37,830 --> 00:02:38,663
bunch more.

41
00:02:39,630 --> 00:02:44,630
So essentially, you can imagine these websites as the sort of restaurant,

42
00:02:44,910 --> 00:02:45,330
right?

43
00:02:45,330 --> 00:02:50,330
And the data that powers these websites as the kitchen behind the scenes.

44
00:02:51,570 --> 00:02:56,570
We can't really go to a restaurant as a member of the public and just go in to

45
00:02:57,660 --> 00:03:01,150
the kitchen and start raiding their cupboards. You can't, you know,

46
00:03:01,810 --> 00:03:05,830
imagine going to your favorite Japanese restaurant and heading straight into the

47
00:03:05,830 --> 00:03:08,830
kitchen for some of your favorite Kewpie mayonnaise.

48
00:03:08,980 --> 00:03:12,160
That's not really appropriate. In a restaurant

49
00:03:12,190 --> 00:03:17,190
we have a menu and this menu is kind of like the interface between you and the

50
00:03:18,670 --> 00:03:19,503
restaurant.

51
00:03:19,690 --> 00:03:24,400
It's the thing that tells you what you can order and what you can't.

52
00:03:24,760 --> 00:03:28,420
So maybe you can get a cake, a sandwich or tea from the restaurant,

53
00:03:28,720 --> 00:03:32,380
but you can't just go into the kitchen and demand whatever it is that you want.

54
00:03:33,180 --> 00:03:37,170
Essentially an API is exactly that. It's the menu.

55
00:03:37,530 --> 00:03:41,850
It's all of the things that you can do to interact with

56
00:03:42,210 --> 00:03:45,240
an external system such as a website

57
00:03:45,240 --> 00:03:47,430
that carries data like Yahoo

58
00:03:47,430 --> 00:03:51,330
weather or the MBA website. In the coming lessons

59
00:03:51,360 --> 00:03:56,360
we're going to be looking at how we can read the documentation for the API and

60
00:03:56,520 --> 00:03:59,820
interact with them to be able to pull pieces of data that

61
00:03:59,880 --> 00:04:04,880
we want in the moment that we want it. So for all of that and more,

62
00:04:05,310 --> 00:04:06,360
I'll see on the next lesson.

