You'll need either access to an SS7 routing system or, more likely, an HTTP API that exposes 10-digit number routing info. Google for '10 digit OCN lookup' or 'realtime CNAM lookup API' and you'll be on the right track. You need one that handles mobile number portability. Most APIs charge a small per-query fee because it's not static data. Any one number can be ported at any time and the only way to know is to see where (in SS7) it's actually routed.
And be aware that there's a fair number of gotchas. I have a lot of experience in the telco world[1]. The two big gotchas are:
1. Inbound and outbound carriers can be and often are different, and outbound caller ID can be spoofed. The source number on an SMS from a 10-digit number (a "10DLC" SMS) is much, much less likely to be spoofed than the caller ID on a robocall. You can fairly reliably report source numbers on SMSes.
To keep it simple, consider starting by reporting SMSes.
For robocalls, expect that many robocall CIDs are spoofed, and the most interesting robocalls are the ones that ask the recipient to contact them at the same number. Or, where both the CID and the callback/contact number are DIDs from the same carrier.
2. Number portability means that all the old static databases (LERG and NPA-NXX-Y Number Pooling[2] databases) aren't enough. One phone number might be routed to one carrier and the sequentially-next number might be routed to a completely different carrier, and either of them might change the next day.
This is just the start - there are other gotchas and a pretty significant learning curve. Stay polite and professional, assume good intentions, and assume you're wrong about something.
[1]: Back in 2010, I made the first free, public REST API for looking up phone data: https://www.slideshare.net/troyd/cloudvox-digits-phone-api-l..., https://www.prnewswire.com/news-releases/cloudvox-launches-f...
[2]: https://nationalnanpa.com/ and for thousands-block reports, https://www.nationalpooling.com/ -> Reports -> Block Report by Region