There's been 115 justices in history, only a fraction of them are recorded and they change infrequently after a long confirmation process. So path of least resistance is to hardcode them into scripts.
It appears that they are readily available in digital form only for cases since 1968, available on microfiche in some library collections for 1953 and later, and not consistently available in any form prior to 1953[1].