Now, before we now dive into building APIs
and how we can build our own APIs and services,
there is one very important differentiation
and clarification which I have to make here.
In the past in this course,
we often also used third-party JavaScript packages
like Express or the Stripe package.
And I did mention that those packages
in the end also could be called services that we use
because they provide certain features
which we use in our project.
And that those packages also had an API
because an API is just a general term
for describing the bridge between your code
to a third-party package or web service.
So therefore, we can of course say
that when we talk about services and APIs,
we could talk about third-party packages
which offer a certain API to us
or web services that expose certain URLs
to which we can send requests.
And as in the case of Stripe, that might also be connected
and you might have a JavaScript package
offered by a service provider,
which talks to that service web API under the hood.
That's what the Stripe package did for us.
We didn't send requests directly to Stripe
from inside our code there.
Instead, we used the Stripe package, which did that for us.
Now, in case of a JavaScript package,
the API would be the collection of methods and objects
and properties that are documented
and that we can use in our code to use the functionalities
provided by that package.
So that's what this package would expose them.
And if we would wanna build such a package on our own,
we would have to dive deeper into frontend
and especially JavaScript development
since we would need extra tools
and would need to use npm,
this tool which was installed together with Node.js
to build such a package.
It's possible, but beyond the scope of this course,
and definitely more advanced.
Building such a package
is something you can do as a web developer,
but it also requires many other skills,
which are not necessarily skills you need to have
as a web developer.
So therefore, that's not the part
on which we will focus here.
Instead, in this course section,
we'll do something which you'll have to do a lot
as a web developer, we'll build a URL-based API,
so a web service that exposes certain URLs
to which requests can be sent.
And then for those incoming requests,
certain actions will be triggered.
And to be precise, those actions would be triggered
by sending requests to certain so-called endpoints,
which is a certain URL reached by a request
that has a clearly specified HTTP method:
get, post, patch, put, delete.
You learned about them before.
They will become important again in this course section.
Now the key thing about such a URL-based API
is that different requests sent to different URLs
with different HTTP methods will trigger different actions
and therefore get back different responses.
And here, of course,
you need a lot of web development skills
because as you will see throughout this course section,
we will still apply what you learned.
You don't need to learn a bunch of brand new things.
Instead, we'll just tweak a couple of smaller things
here and there and introduce a few new concepts.
But generally, we'll still be building a web backend
with any programming language of your choice,
Node.js in this example here in this course section,
and then we can take our existing web developer skills
and build a brand new thing with it,
an API instead of a website.