So now that we know
what services and APIs are
and that these are two closely connected concepts,
why would we be using services or APIs in our websites?
Well, the reason is rather straightforward.
As a web developer,
you typically can't build all the features
your website might need on your own,
or at least you don't want to.
If you have a website that needs some map
and where you wanna handle payments,
of course, theoretically,
you could build it all on your own.
You could start cartographing the world.
You could build your own maps database
with all the data about all the cities
and streets from the world.
You could write code for displaying such a map
with different colors and elements on the screen.
And you could negotiate contracts
with credit card providers,
build a secure platform for handling payments, handle fraud.
And all of that, you could do that,
and you would probably take years or decades for that
especially if you're doing it on your own,
or you just use a third-party service
that provides that feature
and you focus on the core feature
that makes up your website.
For example, the core focus and business of Airbnb
is to offer vacation rentals and to offer a platform
for people who have a vacation rental
and people who want one.
Therefore, Airbnb, of course, did not spend unnecessary time
on building their own maps service.
Instead, they enriched this existing service
with their own business model and data.
That's why we typically use such paid or free
third-party services and APIs because then as a developer,
we can focus on the core logic that makes up our website
and we can then build up on those existing services
to build the final product and website that we wanna build.
Of course, as mentioned before,
this also means that your business model
could be to offer a brand new or better service
than currently exists out there.
You could not build a website, which is the end product,
but maybe a service.
If Google Maps didn't exist already,
you could of course found a startup
that offers something like Google Maps.
Even without the main Google app and website,
a service like Google Maps where other websites and projects
can use your map data would probably
already be pretty profitable.
And therefore, that is also how you can think about this.
That's why we have services and APIs
and why you as a web developer
should be aware of this concept
to build the products you wanna build.