Tell me about APIs ... please

I know very little about API’s… my next step in my coding learning journey is to dive into API’s…

Can I build and host an API similar as hosting a website?

Do I need to have a domain name? Can the domain name be a sub-domain?

Can the main domain and sub-domain communicate with each other as any other API communication?