API Background of Google v. Oracle

Decentralizing Data Governance Summer Privacy Institute, 2023

Understanding APIs (“application programming interfaces”) is important for understanding the Google v Oracle litigation, and its implications for interoperability.

An API is a general concept:  It refers to the way that two programs talk to each other, or how a programmer might use other software in their own applications.

For example:  the Facebook mobile app communicates with Facebook’s servers via an API.  This is a private” API, in that Facebook does not allow third-party Facebook apps.  You often hear about private” vs. public APIs in the interoperability context.  For example, when a software program from Apple can do things on the iPhone that third parties cannot, it is often because Apple is using a private API.

Twitter used to have an API that it used for its own apps, and allowed third parties to use.  Then (long before Musk) Twitter started putting new functions only in its private API, and limiting the use of the public API, until early this year it cut off third-party Twitter apps entirely.

An API is in essence a protocol, or a method of communication.  A sort of call-and-response. One way that APIs are useful is in allowing programmers to use pre-built building blocks in software instead of having to re-invent everything from scratch. For example, a Mac app does not need to devise from scratch how to create a text-editing field or display an image. There are pre-written building blocks for this, and they are called” via an API.

An API can provide fairly basic functionality as well.

The API at issue in the Google v Oracle litigation relates to how programmers use basic features of the Java programming language.  Different programming languages make different choices about what features are built in to a language, versus what features are part of a library.”  Very basic functions will be built-in, but others rely on pre-built building blocks that combine those basic functions.

Let’s take a simplified programming language where addition is built in, but not multiplication.

In this pseudo-code, a program to add two numbers could be:

NUMBER-ADDER.app

sum = 5 + 3
print sum

This program would print out 8” for us.  Very handy.

But, this programming language for some reason does not have multiplication. Multiplication is just repeated addition, so we can use the building block we already have—addition—to define a function.  Computer programmers define functions all the time. A basic function like this would be set out in a different computer program called a library” that defines many functions. The programmer would then indicate Hey, I am going to use the functions defined over here.” A computer program that defines a bunch of functions is called a library.”


MULTIPLICATION FUNCTION.library

# Declaring code tells other programs how to interact with the function. It defines how the function is used:  the programmer would use the command “multiply” followed by two values in parentheses. 

function multiply(a, b)

# This is the implementing code, which performs multiplication via repeated addition.

function multiply(a, b) {
    result = 0
    for i in 1 to b {
        result = result + a
    }
    return result
}

To make use of this function in a program, a developer would import” the library that defines it. The function can then be used like other commands can.

MULTIPLICATION FUNCTION-USING APP.app

# First, we have to tell our app that we will be using the function defined elsewhere.  

import MULTIPLICATION FUNCTION.library

# Now, our app knows about the “multiply” function.  So, we can use it.

product = multiply(5, 3)
print product 

We now have a program that prints out 15.” Cool!

Obviously the software at issue in the Google v Oracle case is much more complex. But the distinction between declaring and implementing code, and why Google would want to copy the declaring code, can be seen with these examples.

First, the case is not about the copyrightability of the Java language per se. There are complex issues to think about when it comes to the copyrightability of a programming language considered in the abstract. But generally speaking, merely writing a program in a programming language is not considered to infringe on any IP rights. Similarly, writing a new compiler” for a language is not considered to be infringing. A compiler is the software program that translates human-written code into machine code. There are analogies here to how facts, sequences of instructions such as recipes or rules for a game, etc, are not protected by copyright.

Rather, the litigation was about Google’s copying of declaring code.” In our examples above, let’s say that Google want to create its own version of my fake programming language. It would like it so that existing programs written in that language can run on its implementation. The copyright issue arises because to make sure that this can happen, it’s not enough to make sure that building block” stuff like addition works the same way. You want to make sure that programs that call functions like multiply” don’t need to be rewritten.

To do this, it’s necessary for Google to copy my declaring code. That’s the code that actually defines the API—how the function is called. But how the function works under the hood can be different.

NEW MULTIPLICATION FUNCTION.library

# Declaring code tells other programs how to interact with the function. It defines how the function is used:  the programmer would use the command “multiply” followed by two values in parentheses. This declaring code has to be identical to create a compatible function.  

function multiply(a, b)

# By contrast, implementing code can be very different.  All that matters is that it provides the same result.  Here is declaring code that performs addition a different way:  through doubling and halving.

function multiply(a, b) {
    result = 0
    while (a > 0) {
        if (a is odd) {
            result = result + b
        }
        a = a / 2
        b = b * 2
    }
    return result
}
YET ANOTHER NEW MULTIPLICATION FUNCTION.library

# Here's the same declaring code yet again.

function multiply(a, b)

# Here the function is defined yet another way:  repeated addition using recursion, rather than looping.  This shows that while there is room for more creativity and variation in implementing code, declaring code always has to be the same for compatability.

function multiply(a, b) {
    // Base case: if b is 0, the result is 0
    if b equals 0 then
        return 0
    // Recursive case: add a to the result of multiply(a, b-1)
    else
        return a + multiply(a, b-1)
}

Copyright nerd aside: In the toy example here, the way the function is defined is so straightforward that there are obvious arguments to make about copyrightability from an originality standpoint (or merger doctrine, or scène à faire), as unprotectable short names or titles, or under some of the theories discussed in Judge Alsup’s original opinion about functionality and methods of operation. I still think those approachs are better than having to jump to fair use, but due to how the Federal Circuit handled the case those issues never made it to SCOTUS.

Code that calls the multiply function will work the same way whether it is using the first, second, or third function. (Ideally the import” command would be the same too, and these functions would be defined in big libraries called things like math.”)

The dispute in the Google v. Oracle case boiled down to whether copying declaring code like function multiply(a, b)” was allowed. There was litigation about whether this code should be protectable by copyright at all, and then, if it was, whether copying it was fair use. Ultimately, the Supreme Court decided that copying this kind of declaring code was a fair use, in part because of how it enabled competition and interoperability.


Tags
Posts

Date
June 5, 2023