In Google v. Oracle, the US Supreme Court avoided deciding whether the Java API is subject to copyright:
We shall assume, but purely for argument’s sake, that the entire Sun Java API falls within the definition of that which can be copyrighted. We shall ask instead whether Google’s use of part of that API was a “fair use.” Unlike the Federal Circuit, we conclude that it was.
It then went on to find that this particular reproduction would be a fair use. The fair use analysis is case-by-case, so that finding will not necessarily apply to other API reproductions. The factors are:
(1) the purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes;
(2) the nature of the copyrighted work;
(3) the amount and substantiality of the portion used in relation to the copyrighted work as a whole; and
(4) the effect of the use upon the potential market for or value of the copyrighted work.
You can see how the Supreme Court applied these in Google v. Oracle:
- the nature of the work is somewhat functional
- the purpose of the taking was to allow for interoperability
- the code taken was a very small proportion of the original, in quantum and significance
- there was little market effect on the original work