Yes you can - programmatically. Here is an AppleScript that gets the synchronized blocked phone numbers, allows you to enter a contiguous number string +n…n for the number, and then it will look that number up in a list of all blocked numbers. If there is a match or not, you will be informed with a dialog.
Copy and paste the following into Apple's Script Editor, click the hammer icon to compile, and then the ▶︎ button to run it.
Code:
# blocked_numbers.applescript
# Prompt user for a contiguous +n…n phone number to check against
# all blocked phone numbers. Report result in dialog.
# Tested: macOS 13.3.1 (a)
# VikingOSX, 2023-05-07, Apple Support Communities, No warranties expressed or implied.
use framework "Foundation"
use scripting additions
property ca : current application
property nil : a reference to missing value
property blockedKey : "values.__kCMFBlockListStoreTopLevelKey.value.__kCMFBlockListStoreArrayKey.__kCMFItemPhoneNumberUnformattedKey"
property blocked_plist : "~/Library/SyncedPreferences/com.apple.communicationsfilter.plist"
set locateNumber to text returned of (display dialog "Enter blocked number to look up as +numberstring" default answer "" with title "Check Number in Blocked List") as list
set mutArray to ca's NSMutableArray's array()
set matched to ca's NSArray's array()
set predBlocked to ca's NSPredicate's predicateWithFormat:"SELF IN[c] %@" argumentArray:locateNumber
set blockedPath to (ca's NSString's stringWithString:blocked_plist)'s stringByExpandingTildeInPath()
set theBlocked to ca's NSData's dataWithContentsOfFile:blockedPath
set {pdict, theError} to ca's NSPropertyListSerialization's propertyListWithData:theBlocked options:0 format:nil |error|:(reference)
if pdict is nil then
error theError's localizedDescription() as text
return
end if
mutArray's addObjectsFromArray:(pdict's valueForKeyPath:blockedKey)
if (count of mutArray) = 0 then
return
end if
-- sort blocked numbers in numeric order
mutArray's sortUsingSelector:"caseInsensitiveCompare:"
set matched to mutArray's filteredArrayUsingPredicate:predBlocked
if (count of matched) > 0 then
display dialog "Matched Number in Blocked list: " & matched as text with title "Blocked Phone Number Lookup"
else
display dialog "Number is not among blocked numbers." with title "Blocked Phone Number Lookup"
end if
return