Perfect.
We've got our star, we are ready to go, just like in previous project when we work with API first
I would want to go over the end points and not get there.
I'm going to navigate through my search engine and we're just going to type hacker news online.
What's important, go with our goal here, because I believe there's multiple APIs and then the one
we're looking for is all going on.
So we'll go with Hacker News, I'll Golia API and then we're looking for this link.
And then, of course, I would want to open this link in the new tab and in here, if you want to search
for items again, there is a root and point and we're looking for items and specific items.
So if you would want to get specific item, this is what you would need to know.
What I'm looking for is not the users, because also I can get more info about the user.
What we're going to use is this search.
One second we've got some kind of root and point and then we just need to add, search, questionmark
and then query.
And of course, whatever value I'm putting in the query, I'm going to get some kind of results.
So in this case, what I would want is just to copy and paste that because I would want to test it in
the browser and we're going to go svelte.
And we type here and we should get some kind of result and our results should be in the hit.
So there is a property by the name of it and the value is.
And in that right.
Of course, we have objects and that each object represents that story.
And what else I'm looking for?
Well, I can say that I have these different parameters.
I have the query, OK, that's something that we're going to use.
But also later, the page number is going to be important because if we take a look and if we keep on
scrolling, I believe somewhere in the bottom we're going to have these hits.
So that just means how many stories we have here and that what is the page number, which notice here
is zero.
And also keep in mind that technically there is some kind of default already.
So if I would have went with query and then so well and then specifically page zero, of course I would
get the same result because by default this is going to be zero.
And then I have a number of pages and then how many items per page.
So my query of course, was well, and there I have the result.
So hopefully that is clear.
That page can be added or we can set up the fetch without the page.
But in our case, of course, we will use the page because I would want to use the pagination.
And then as far as the results, I have the hits.
All right.
And then I also have more specific info.
For example, this tells me, well, how many hits total I have and then what is the current page,
which by default is going to be zero?
And then what is the total amount of pages and then how many hits per page, meaning how many items
per page?
Am I getting back again?
If you're interested in different setups and of course, just go through the docs and see what parameters
you need to in.
But in our case, we just worry about this particular URL where we have the query and then some kind
of value and also our attach those pages, not technically.
If we wouldn't have the pagination, I really don't care about these pages, because by default, I'm
going to get zero and I'm going to be in good shape.
But since we will set up the pagination, our euro is going to be a tiny bit different than the one
that I just typed, because we will add those pages.
So if you want to start out, it's going to look like just go here with and right after the query and
then type of page and then whatever the value again, if you type zero, you'll get the same result.
Correct.
Because remember, by default the page is zero like.
So however, if I'm going to go with one, two or whatever and of course I'm going to be getting different
results from here if I go with four, because this is what I'm getting back, essentially I have different
hits.
So because we have pagination are you here is going to be something like this where again we have the
root one, then we have search, questionmark query and then whatever, we will type in the input and
then and and then whatever the pages.
So by default to start with zero.
And then every time we click on increase or decrease, of course it will change the value here.
And then once that is clear, we can navigate back to our project and I just want to showcase that I
already copy and pasted the URL.
Why?
Well, because there's no reason of copying pasting.
If I can just provide the value again.
Yes, we'll construct the you are all together.
But as far as the API endpoint, I might as well provide that because it just involves copy and paste.
Hopefully everything is clear.
You know where to find documentation if you want to explore deeper.
In our case, we just worry about the endpoint, the one with the search.
And then of course, we'll construct our URL when we start searching for the stories.