From library website: Non-Resident Library Card (Outside of California) For applicants whose permanent address is outside of California, there is a non-resident fee of $50.00. Non-resident cards are issued and renewed in person only, at the time of payment. Cards are not issued through the mail.
I'm not sure about all foreigners. But the library does allow recognize a few countries. With I.D., you may purchase a out-of-state library card for $50.00. It is good for 1 year, you can repurchase every year if you like. Chk out their website. lapl.org
Thanks! Your answer is awaiting moderation.