There is no American law which prevents America from spying on non-Americans. We've signed no treaty that says we won;t spy on foreign countries. That means it is by definition legal for us to do so.
The laws in the article you linked to are all non-American, mostly from the Commonwealth Realms.
So? That's the whole point. American exceptionalism is thinking that Americans can break laws in other countries and get away with it because they're special. That's why the world hates Americans. They have double standards. They can break laws in other countries but if others come to America, woe betides them is they break the law.