Yes, Twilio offers a Lookups API for discovering the type of number and the carrier the phone number is associated with. You can learn how to use our Lookup API through our Quickstarts here.
You can also visit the article Using the API to search for and buy Twilio phone numbers if you want purchase a Twilio number.