Okay, everyone.
So just a brief recap on the last section.
We looked into the Nordstrom site and we tried to find an API or rather discover whether there's an
API inside Nordstrom site that we can use to extract results.
And we found something inside of this query where there's a response that looks exactly like the same
data, the traces we're trying to get here.
So now the next step we want to try now is to replicate calling this API, getting the result inside
of Postman instead of inside of a browser inside the Nordstrom Web app.
So we're going to try and do that and let's see how it goes.
So as I search for query inside the network tab, when I search on the Nordstorm site like we did in
the last section, we have the query down here with the Http get and for the query e-commerce e-commerce
API.
And so I'm going to take this URL here and copy that, and then I'm going to open up Postman.
So if you don't have Postman already, just go ahead and download it.
Google Postman download it.
It's a free app to make calls in if you're not familiar with it already.
So I'm starting up postman here and opening a new tab.
And then I'll just paste in the URL here that we had inside of the Chrome tab where we search for query
and find the hidden secret API.
So I'm going to press send, make sure it's Http get.
And now it gives us an error.
It says for one unauthorized and it says a valid API key is required.
So we need to find an API key and well, in the last section there was a part inside of the source where
there was an API key.
Now if we also try and look inside of the request headers in here inside of Google Chrome, we can see
there's a header for authorization that says API key and then it has the API key in here.
So what we can do is to replicate this header inside the request from Chrome where it says authorization
and paste in the API key.
So let's go ahead and do that.
Go to the headers tab in Postman and type in authorization.
Paste in the API key.
Actually paste in the text as it says in here.
I don't think it's useful that they write API key before they write the API key, but I mean every API
is different.
I mean there's just some developers who made this and they make weird quirks sometimes anyway.
We try with this header now.
Now it says another error.
Now it says unable to parse the request version include a valid Nor API version header in the request.
So it's even so nice to tell us that we need the Nor API version header inside of our requests.
So let's go and look inside the Chrome request again and we can see.
There is a header that is called nor a version and it has a value of one.
So let's go ahead and go in the header tab again inside of Postman.
Paste in the Nor version and put in one and let's see if it works now.
So we get some nice data now and you can see the populations through sequin mini minidress, which is
um, this one here.
So it's not exactly the same order of items, but it's you're definitely getting some items using this
core.
Now let's see, what else can we change?
So inside of the query parameters, this params tab, we can also set how many items we want.
So if you want ten items we just set.
Ten.
And then we get more data.
We get ten items instead.
We can also change the search term here to be something like.
Preen, then remember, it needs to be Uri encoded, I think it's called.
So the space is encoded as a percent 20 sign where you can do that automatically inside of our JavaScript
later.
Don't worry about it.
I'm just trying to show you that you can enter in keywords now.
So now we're searching for green dresses instead and we get results for this.
I'm not quite sure what include facets mean.
Um, I haven't digged into that yet.
But I am just going to leave it at false as it is by default inside of the Nordstrom site.
Now what we can do is we have seen how to perform the API query inside of Postman.
The next step now is to build our back end so we can query on our back end and then we can go to the
Nordstrom API from the back end and return results from our own back end.
Now the reason we make a back end is because most of the time these APIs have something called course,
uh, set up, which means that not every site can just query from the Nordstrom site and return it on
the app.
You're making the front end app we're going to make.
So we need to make our own back end usually imply our own course headers.
If you don't know exactly what this means, we're going to get to it in the next section or the next
one again and you'll see what I mean.
But for now, we are getting the results.
Fine instead of Postman.
Next up is making the backend in NodeJS Express.