API: Google v. Oracle

BACKGROUND

Google was initially sued by Oracle in 2010 for copyright infringement after Google used Oracle’s application programming interface (“API,” to be defined and discussed in this article) in its Android platform. What is most interesting, and the crux of the lawsuit, is Google’s particular use of the API –  Google did not simply copy and paste all of Oracle’s API code. Rather, Google copied verbatim a portion of the API, which the Court refers to as  “declaring code,” but rewrote the other portion, the “implementing code,” from scratch. Combined, the declaring code and the rewritten implementing code result in an API for Google’s Android that is virtually identical to Oracle’s API; the implementing code is different, but carries out the same function. Therefore, the case heavily concerns whether the declaring code is copyrightable, and, if so, whether Google’s infringement is excused due to a Fair Use affirmative defense. The Supreme Court, in its 2021 decision, ultimately ruled that Google’s usage of Oracle’s API constituted Fair Use, and so even if Google did commit copyright infringement, Google is protected – no ruling was made as to whether there was a copyright to infringe upon.  First, let’s examine what an API is and what the difference is between declaring code and implemented code.

An API is an interface which allows a programmer to interact with outside code that can perform calculations and return a result. The programmer may call upon the interface and use its various results in the programmer’s own application without explicitly writing the code which calculates the result.  For instance, if one were to press the Menu button on a TV remote, one expects the Menu to pop up on the TV, but does not necessarily know how the remote or TV work at a technical level; the TV remote is an interface for the TV.  Likewise, to sort a list of random numbers, a programmer can write an algorithm in Java from scratch, or the programmer can rely upon a package called “java.util.Arrays.sort” which contains related java utilities including an Arrays class with a sort method – in short, the programmer can sort an array with a single line of code (the declaring code) by relying on a Java package which ultimately executes implementing code the programmer himself did not write in his or her program, or he can instead write the implementing code from scratch and use no declaring code. 

The Court focuses heavily solely on one relatively example in its analysis,  the declaring code “java.lang.Math.max.” One can type this in order to essentially unlock the ability to calculate the greater of two numbers.  Java.lang.Math is a class in Oracle’s java.lang package that contains methods for performing basic operations, and one such method within that class is “max” – invoked by Java.lang.Math.max. The declaring code is the organizational structure of the API and also determines the type of parameters the API will understand; in this case, the Math class expects two parameters that must be primitive type integers or “int.” One can view Oracle’s documentation for the Math class here:

https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html

And one can view the entire API, which contains java.lang as well as java.util here:

https://docs.oracle.com/javase/8/docs/api/

All of this documentation shows Oracle’s declaring code.

Pretend a programmer is trained to make use of java.lang.Math, including the java.lang.Math.max method; now, the programmer switches to Android mobile app development. Google knows that developers are trained to and rely on Oracle’s API; therefore, they rebuilt the API using the exact same naming conventions, nomenclature, and parameters; so if a developer imports “java.lang.Math.max” into his Android program, he can use the max method of the Math class just as he would  outside the Android platform and his familiarity with the API would not evaporate.

Pretend, hypothetically, that java.lang.Math does not exist in Android mobile app development even when coding in java. In order to calculate the max, the developer may use Java code without the Math class.  He would write something similar to

if (x >y{return x} else {return y}

instead of  something like

Import java.lang.Math;

return Math.max(x, y);

The Court actually represents the API process with an image in its brief, showing what the API does when the programmer uses the max method. Note that they do not use an import statement in the Method call, which is atypical but essentially the same. 

https://www.supremecourt.gov/opinions/20pdf/18-956_d18f.pdf

COPYRIGHT

To be afforded copyright protection, a work must be both original and fixed in a tangible medium of expression from which it can  “…be perceived, reproduced, or otherwise communicated.”17 U.S. Code § 102. That the work must be fixed means an idea is not copyrightable. If one has a copyright, one has obtained the exclusive legal right to reproduce, publish, sell, or distribute the matter and form and prepare derivative works. 17 U.S. Code § 106.  A translation is an example of a “derivative work”; it would be a breach of copyright to create just a translation of someone else’s copyrighted work. Computer programs are literary works, listed under the in the Copyright Act, 17 U.S.C § 101. There, Congress defines a computer program as “a set of statements or instructions to be used directly or indirectly in a computer in order to bring about a certain result.” According to the United States Court of Appeals for the Second Circuit, copyright for computer programs also prohibits the copying of “nonliteral elements,” such as program’s organization insofar as the structure is an original idea. Computer Associates vs Altai

In 2018, prior to the 2021 Supreme Court decision, the Federal Circuit found that the API declaring code was subject to copyright. It ruled that a set of commands to instruct a computer to carry out desired operations may contain expressions that are eligible for copyright protection. The court reasoned that declaring code could have been written and organized in a number of ways. Further, the API package was not just an idea because it was fixed and had functionality. Additionally, the Federal Circuit did not believe that Google was protected by Fair Use.

As we know, the Supreme Court has overruled this decision, finding the opposite concerning Fair use and making no determination on whether copyright protection extends to the API interface. As stated by Justice Breyer,

…given the rapidly changing technological, economic, and business-related circumstances, we believe we should not answer more than is necessary to resolve the parties’ dispute. 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.

FAIR USE

An affirmative defense works like this: the defendant introduces evidence, which, if found to be credible, will negate liability, even if it is proven that the defendant committed the alleged acts. One well known affirmative defense is self-defense:  if someone is found to have committed murder, but can prove the affirmative defense of self-defense successfully, one is not liable. Likewise, in this case, if defendant Oracle’s usage constitutes Fair Use, even if Oracle is found to have committed copyright infringement, Oracle will not be held liable. 

The fair use doctrine 17 U.S.C. §107 lists four factors the court should consider in determining whether use of a work is fair use (note that the statute only lists the four elements, and the italicized descriptions below are provided by me, from what I know about case law, but are not part of the statute. Also note that congress does not suggest any way to measure which element is most important but explicitly states that they are not listed in order of importance):

(1) the purpose and character of the use; 

The courts generally favor uses that are “transformative.”  A new work based on a copyrighted work is “transformative” if it uses the source work in completely new or unexpected ways;  Courts tend to really hone in on whether a work is transformative. A transformative work may be seen as furthering the goal of the original work.

(2) the nature of the copyrighted work;  

Greater protection is generally afforded to creative works, ie fair use applies greater protection to fiction than nonfiction.  

(3) the amount and substantiality of the portion  used in relation to the copyrighted work as a whole; and 

Generally the more you use, the less likely you are within fair use. Generally, a small amount of copying is outside fair use if the copied part consists of the heart of expression.

(4) the effect of the use upon the potential market for or value of the copyrighted work

If you could have realistically purchased or licensed the copyrighted work, fair use is less likely.

THE COURT’S APPLICATION: FAIR USE

(1) the purpose and character of the use 

Oracle argued that it alone has the right to create or license derivatives and that Google merely created a non-transformative derivative. It argued that the organization of the copied code itself was an expression, not a non-copyrightable idea. Google argued that because the new work is on the Android platform, Google had furthered the purpose of Oracle’s work and it is transformative..

Because the copied declaring code performed mainly organizational rather than creative purposes, the Court found it is “further from the core of copyright than most computer programs.”  Google’s API  seeks to expand the use and usefulness of the Oracle API to Android-based smartphones. In a way, the court actually decided that the copying of just the declaring code  was consistent with  creative progress in that it moved programmers to a new and different platform seamlessly. Google copied, “… only insofar as needed to include tasks that would be useful in smartphone programs.”

(2) the nature of the copyrighted work

The court viewed the nature of the declarative code in the  Oracle API as a “user interface” through which programmers may “manipulate and control task-performing computer programs.”  Again, this, they ruled, is further  from the core of copyright than other programs.

The court reasoned that the value of the declaring code actually derives from the programmers’ ability to use it rather than the declaring code itself. 

(3) the amount and substantiality of the portion  used in relation to the copyrighted work as a whole

The court explained that if one considers the declaring code in isolation, the amount copied is large.  However, the entire Sun Java API computer code amounted to a much larger 2.86 million lines, of which the large amount of  declaring code was only .4%. 

The court concentrated on “substantiality” over “amount” because of the complexity of the analyzing what “amount” means in this scenario,  saying that the portion was not substantial: 

Google copied those lines not because of their creativity, their beauty, or even (in a sense) because of their purpose. It copied them because programmers had already learned to work with the Sun Java API’s system.  The amount of copying was tethered to a valid, and transformative, purpose. We consequently believe that this “substantiality” factor weighs in favor of fair use. 

(4) the effect of the use upon the potential market for or value of the copyrighted work.

The court emphasized the importance of this element. In fact, we will see that the  dissenting Judge actually agrees that, according to case law, this is indeed the most important element, although it is difficult to gauge exactly how important each element is.  The court claims it is met because programmers’ ability to port their skills between platforms is a significant interest to be protected. 

Oracle argued it was unfair that Google be rewarded for having the resources to develop an API for a device more quickly than Oracle could and avoid paying Oracle for a license. But the court reasoned that rather than just repurposing “..code from larger com­puters to smaller computers, Google’s Android platform was part of a distinct (and more advanced) market than Java software.” 

The Court also took into account the  public benefits copying will likely produce and whether it outweighs the dollar amount Oracle,  the possible copyright holder, may lose. The Court concluded the difficulty of Google trying to recreate the declaring code would, “… lock… not further, cop­yright’s basic creativity objectives.”

THE DISSENT

Justice Thomas wrote the dissent, which does not have the power of law, but can still be looked at by the Court in a future analysis. He believes that the Court was doomed to make the wrong decision from the start, because of its initial decision not to make a ruling on copyright; he argues that copyright is inextricably linked to a fair use analysis. 

First, Justice Thomas argues that if one were to apply the statutes as they were written by congress, Oracle must have a copyright. And to apply the statutes as written  is not so farfetched, because  the statute specifically mentions computer programs, as we have discussed.  Justice Thomas therefore argues both implementing and declaring code  can be interpreted only one way here; they are programs. Justice Thomas analyzes expression versus idea. He draws a parallel between the API and  the fact that a “method of book-keeping,” an idea, is not protected by copyright, but the expression describing that accounting method is. Here, he says the expression must be protected.

Furthermore, the Copyright Act protects code that “operates in a computer in order to bring about a certain result.” The result can be  brought “directly” (implementing code) and “indirectly” (declaring code). (Parenthesis added by Justice Thomas). Justice Thomas reasons the declaring code must be designed and organized in a way that is intuitive and understandable to developers so that they can invoke it. 

In terms of the fourth factor, the effect of the use upon the potential market for or value of the copyrighted work, Justice Thomas highlights how Oracle was wronged; Oracle spent years developing a programming library that successfully attracted software developers, enhancing the value of its own products. Google then sought a license but Oracle and Google could not agree on terms. So then Google “copied verbatim 11,500 lines of code from the library” making tens of billions of dollars.  “Despite this, the majority holds that this copying was fair use.,” writes Justice Thomas. By copying Oracle’s work, Google decimated Oracle’s market and created a mobile operating system now in over 2.5 billion actively used devices, earning tens of billions of dollars every year.  He also points out that Apple and Microsoft creates operating systems without using Oracle’s declaring code –they wrote their own.  Extending the Justice’s argument, let’s play devil’s advocate –  since when do courts care about programmers not needing to learn how to use new tools? Part of the trade of programming is learning new tools and APIs; the tools we use change rapidly. Android development, regardless of API, is a completely separate ballgame from web development. 

CLOSING THOUGHTS

The Court said, “It copied the API (which [Oracle] created for use in desktop and laptop computers) only insofar as needed to include tasks that would be useful in smartphone programs.”

But how is it that the API code used by Apple and Microsoft has different declaring code than Oracle’s, but Google claims its own API could not? Well, Oracle’s API could have used unique declaring code, but I’d argue it makes no difference in the analysis. Pretend Google rewrote the API declaring code and for instance “java.lang.Math.max(4, 6)” was instead “java.lang.Arithmetic.larger(4,5)” and the implementing code was Google’s own. Where is the creative transformation? There is none in addition to  the transformations we have already discussed.

In reality, the creation of the API is an extraordinarily difficult endeavor, yet at the end of the day, all programmers striving to create such an API would come up with an API that is virtually indistinguishable, if it is a good API made by good programmers. And truth be told, by looking at and copying Oracle’s declaring code, it must have helped Google figure out how to write the implementing code.  If we are comparing two integers, there should obviously be two parameters, number x and number y. The Microsoft API, for instance, is extremely similar, but with some caveats that may cause programmers the need to read the API documentation when they accidentally utilize the API as if it is the Oracle API. There are more complicated components of the Java API than Math.max. For instance, in Java, generics can be used to allow a type, like Integer or String, to be a parameter to a method or class and the API can take advantage of this for more complicated but more organized methods. But any transformative work would ultimately either be similar and worse/less efficient or similar and better/more efficient yet virtually the same. Justice Thomas, remember, argued that like book-keeping, here, the API is an expression not an idea and must be protected. But is it really an expression if there is only one way, with inferior or superior variants? I would say no, API is an idea or maybe an invention, and the idea/invention can only be expressed in similar, non-creative ways.  It would be silly to have the programmers memorize a new API that is the same, but disguised for the sole purpose of navigating the law.  I also would like to add that not only is Android a different platform, it does not even use Java Virtual Machine – in other words, the way Java code is eventually converted to binary code (first being converted to Java bytcode), including the code from the API, is largely different on both platforms. 

While API does not seem, to me, to belong  under Copyright, it also does not seem to fit under patent law, which is generally for inventions. Generally,  Congress does not intend for code to be patentable. Note that there are exceptions; sometimes code can be patentable but we will not discuss that in this article in depth. Code that could be patentable would be unique code, like algorithmic code, which could be contained in the implementing code of an API, but would not be the API itself. Of course, if such code was part of an API, and was patented, a company like Google would have been unable to copy and transform it. Similarly, if the implementing code was not patented, but copyrighted, it has copyright protection; but remember, Google wrote the implementing code on its own. 

In terms of the fourth factor for Fair Use, it should be noted that many programmers were anxious and even furious with the lower courts  while awaiting the result of the Supreme Court, because the Java API is considered to be open source. A distinction needs to be drawn. The API can be used by programmers without Oracle having the rights to the programmers’ program. The difference here is that Google is not using Oracle’s API; they are reimplementing the API and then having programmers use their reimplemented API. In terms of backwards consequences that would arise if companies could not use each others API, I will give one example : the company Azure could  not provide the same implementation to AWS API’, meaning one could not switch easily between Azure and AWS depending on price but instead would need to use AWS cloud services. The inability to reuse an API would create stagnancy, as discussed by the majority. It does seem unjust that after Oracle’s labor, they cannot protect their API but I believe the Court’s decision is less destructive. Remember, Google wrote the implementing code from scratch so did not infringe a copyright there.

What is strange about API, is it require creatives  endeavor to organize all the libraries, but good programmers planning to create an API for a programming language would always, eventually, create API with similar functionality. On the other hand, if one is to write a fiction novel, which is more clearly intended to be covered by copyright and at the heart of copyright, it does not matter how good or bad the book is; the book is a creative endeavor protected as the words are written.  At a deeper level, the implementing code alone is like any code, and is afforded copyright protection and is considered creative; remember, Google wrote its own implementing code, and I am sure it looks vastly different than Oracle’s for some of the more elaborate functions – and there are vastly more ways to write that code than there is to write the declaring code. Recall, the declaring code was thousands of lines but was .4% of the total code. I do not personally believe an API should have Copyright protection but under the law, as Justice Thomas suggests, it does seem to meet the criterium  of Copyright protection, so I would rule that there is Copyright protection but Fair Use applies.

Leave a comment