Check if a URL Is Indexed

Is there a way to check if a URL that isn’t from my site (so no access to Google Search Console) is indexed or not?

I tried searching for the full URL in Google, and it works somewhat—sometimes the URL shows up in the first result, sometimes it doesn’t. I’m aware of the site: operator, but if the site has many pages, it’s not easy to check a specific URL.

As a bonus, if there’s a way to check this programmatically, that would be great since I could write a script to check a list of URLs all at once.