By definition, it is exactly a law. It's known as business law. The ToS is a business contract which you must agree to if you wish to use the service. Violating terms of service is literally a breach of contract.
People (or company? not sure) don't make any requests to Anthropic themselves. They just publish code that can make such requests.
I don't think that there is a legal precedent that would make publishing code that can do scraping illegal.