1 00:00:00,490 --> 00:00:00,940 Perfect. 2 00:00:01,420 --> 00:00:10,590 We've got our star, we are ready to go, just like in previous project when we work with API first 3 00:00:10,600 --> 00:00:14,620 I would want to go over the end points and not get there. 4 00:00:14,930 --> 00:00:20,730 I'm going to navigate through my search engine and we're just going to type hacker news online. 5 00:00:20,740 --> 00:00:25,300 What's important, go with our goal here, because I believe there's multiple APIs and then the one 6 00:00:25,300 --> 00:00:27,520 we're looking for is all going on. 7 00:00:27,790 --> 00:00:33,580 So we'll go with Hacker News, I'll Golia API and then we're looking for this link. 8 00:00:34,490 --> 00:00:40,490 And then, of course, I would want to open this link in the new tab and in here, if you want to search 9 00:00:40,490 --> 00:00:47,780 for items again, there is a root and point and we're looking for items and specific items. 10 00:00:48,380 --> 00:00:52,620 So if you would want to get specific item, this is what you would need to know. 11 00:00:52,850 --> 00:00:58,460 What I'm looking for is not the users, because also I can get more info about the user. 12 00:00:58,820 --> 00:01:01,240 What we're going to use is this search. 13 00:01:01,360 --> 00:01:08,450 One second we've got some kind of root and point and then we just need to add, search, questionmark 14 00:01:08,660 --> 00:01:09,670 and then query. 15 00:01:10,070 --> 00:01:16,420 And of course, whatever value I'm putting in the query, I'm going to get some kind of results. 16 00:01:16,790 --> 00:01:21,680 So in this case, what I would want is just to copy and paste that because I would want to test it in 17 00:01:21,680 --> 00:01:24,560 the browser and we're going to go svelte. 18 00:01:25,330 --> 00:01:34,340 And we type here and we should get some kind of result and our results should be in the hit. 19 00:01:34,810 --> 00:01:39,700 So there is a property by the name of it and the value is. 20 00:01:40,480 --> 00:01:41,880 And in that right. 21 00:01:42,970 --> 00:01:48,280 Of course, we have objects and that each object represents that story. 22 00:01:49,170 --> 00:01:51,310 And what else I'm looking for? 23 00:01:51,390 --> 00:01:55,130 Well, I can say that I have these different parameters. 24 00:01:55,560 --> 00:01:58,890 I have the query, OK, that's something that we're going to use. 25 00:01:59,310 --> 00:02:06,720 But also later, the page number is going to be important because if we take a look and if we keep on 26 00:02:06,720 --> 00:02:11,280 scrolling, I believe somewhere in the bottom we're going to have these hits. 27 00:02:11,500 --> 00:02:17,940 So that just means how many stories we have here and that what is the page number, which notice here 28 00:02:18,210 --> 00:02:19,130 is zero. 29 00:02:19,440 --> 00:02:23,890 And also keep in mind that technically there is some kind of default already. 30 00:02:24,510 --> 00:02:30,450 So if I would have went with query and then so well and then specifically page zero, of course I would 31 00:02:30,450 --> 00:02:34,020 get the same result because by default this is going to be zero. 32 00:02:34,410 --> 00:02:38,430 And then I have a number of pages and then how many items per page. 33 00:02:38,850 --> 00:02:42,900 So my query of course, was well, and there I have the result. 34 00:02:43,590 --> 00:02:44,820 So hopefully that is clear. 35 00:02:45,090 --> 00:02:51,480 That page can be added or we can set up the fetch without the page. 36 00:02:51,690 --> 00:02:56,370 But in our case, of course, we will use the page because I would want to use the pagination. 37 00:02:56,670 --> 00:02:59,510 And then as far as the results, I have the hits. 38 00:02:59,520 --> 00:02:59,900 All right. 39 00:03:00,330 --> 00:03:02,610 And then I also have more specific info. 40 00:03:02,910 --> 00:03:08,040 For example, this tells me, well, how many hits total I have and then what is the current page, 41 00:03:08,460 --> 00:03:09,900 which by default is going to be zero? 42 00:03:10,050 --> 00:03:16,590 And then what is the total amount of pages and then how many hits per page, meaning how many items 43 00:03:16,590 --> 00:03:17,280 per page? 44 00:03:17,490 --> 00:03:19,290 Am I getting back again? 45 00:03:19,530 --> 00:03:27,090 If you're interested in different setups and of course, just go through the docs and see what parameters 46 00:03:27,090 --> 00:03:28,140 you need to in. 47 00:03:28,500 --> 00:03:35,040 But in our case, we just worry about this particular URL where we have the query and then some kind 48 00:03:35,040 --> 00:03:39,870 of value and also our attach those pages, not technically. 49 00:03:40,850 --> 00:03:46,130 If we wouldn't have the pagination, I really don't care about these pages, because by default, I'm 50 00:03:46,130 --> 00:03:48,590 going to get zero and I'm going to be in good shape. 51 00:03:48,890 --> 00:03:57,260 But since we will set up the pagination, our euro is going to be a tiny bit different than the one 52 00:03:57,260 --> 00:04:01,060 that I just typed, because we will add those pages. 53 00:04:01,550 --> 00:04:09,260 So if you want to start out, it's going to look like just go here with and right after the query and 54 00:04:09,260 --> 00:04:15,980 then type of page and then whatever the value again, if you type zero, you'll get the same result. 55 00:04:16,160 --> 00:04:16,580 Correct. 56 00:04:16,860 --> 00:04:20,170 Because remember, by default the page is zero like. 57 00:04:20,220 --> 00:04:25,250 So however, if I'm going to go with one, two or whatever and of course I'm going to be getting different 58 00:04:25,250 --> 00:04:32,660 results from here if I go with four, because this is what I'm getting back, essentially I have different 59 00:04:32,660 --> 00:04:32,950 hits. 60 00:04:33,320 --> 00:04:39,890 So because we have pagination are you here is going to be something like this where again we have the 61 00:04:39,890 --> 00:04:46,850 root one, then we have search, questionmark query and then whatever, we will type in the input and 62 00:04:46,850 --> 00:04:49,160 then and and then whatever the pages. 63 00:04:49,460 --> 00:04:51,050 So by default to start with zero. 64 00:04:51,320 --> 00:04:57,110 And then every time we click on increase or decrease, of course it will change the value here. 65 00:04:58,160 --> 00:05:05,240 And then once that is clear, we can navigate back to our project and I just want to showcase that I 66 00:05:05,240 --> 00:05:07,760 already copy and pasted the URL. 67 00:05:07,880 --> 00:05:08,300 Why? 68 00:05:08,510 --> 00:05:10,880 Well, because there's no reason of copying pasting. 69 00:05:10,880 --> 00:05:12,630 If I can just provide the value again. 70 00:05:12,980 --> 00:05:16,310 Yes, we'll construct the you are all together. 71 00:05:16,760 --> 00:05:23,540 But as far as the API endpoint, I might as well provide that because it just involves copy and paste. 72 00:05:24,080 --> 00:05:25,430 Hopefully everything is clear. 73 00:05:26,000 --> 00:05:30,700 You know where to find documentation if you want to explore deeper. 74 00:05:30,920 --> 00:05:36,080 In our case, we just worry about the endpoint, the one with the search. 75 00:05:36,350 --> 00:05:42,200 And then of course, we'll construct our URL when we start searching for the stories.