API for getting List of country and their states

Is there any API for getting all countries and passing country get all States/Region and again passing State/Region get all cities in it

something like that:


Just wanted to let you and any other people who read this know that restcountries.eu was discontinued so I’ve switched to https://countryapi.io which works as good as the other API.