There are APIs out there that are web based only, yes, they depend on internet connectivity but it's the developer's responsibility to incorporate an error control routine into the library to notify the user about any communication issue.
There' s no risk using an online API, the only thing to keep in mind is that the provider should be a reputable source to assure that the API won't suddenly disappear.