Bloomberg reported that the judges also questioned Google's claim that it could not have created code to do the same function as the APIs without forcing developers to learn a new language.
The highest court in the US agreed to hear the case in November last year in order to decide whether Oracle should receive damages from Google for copyright infringement.
Hearings were scheduled for March but were put off due to the coronavirus pandemic.
Chief justice John Roberts expressed doubts about Google's actions, likening them to someone who broke into a safe.
“Cracking the safe may be the only way to get the money that you want, but that doesn’t mean that you can do it,” he told Goldstein. “If it’s the only way, the way for you to get it is to get a licence.”
Court filings by Oracle show Google has earned US$42 billion (A$58.8 billion) in revenue from Android between 2007 and 2016.
A number of technology companies, among them Mozilla, Microsoft and IBM are backing Google in the case. Media and entertainment companies are also behind the search behemoth. A ruling by the court is due in July next year.
The Trump administration has backed Oracle, saying that though the appeals court's ruling was not entirely "free from doubt", on balance the Federal Circuit Court had gotten it right.
Solicitor-General Noel Francisco wrote at the time: “Google copied 11,500 lines of computer code verbatim, as well as the complex structure and organisation inherent in that code, in order to help its competing commercial product.
He added: "Unauthorised copying harmed the market for respondent’s Java platform.”
The case has been around since 2010 when Oracle sued Google shortly after it purchased Sun Microsystems and became the owner of Java, claiming that Google had violated its copyright and patents. Google was accused of taking more than 11,000 lines of code from Java APIs and using it in Android without any commercial agreement.
But an appeal gave Oracle what it wanted: a ruling that APIs could be copyrighted.
In a second trial that ended in May 2016, a jury found that Google's use of the Java APIs in Android was covered under fair use. As expected, Oracle was not happy with the verdict.
Oracle initiated an appeal in February 2017 having indicated after the May 2016 verdict that it would not take a backward step. In August 2016, Oracle tried to get the verdict set aside, but was this was refused by Justice Alsup. Later the same year, the database giant filed the necessary papers to prolong the battle.
Finally, on 28 March, the US Court of Appeals for the Federal Circuit came to the conclusion that Google's use of the Java APIs was "not fair as a matter of law".
In August 2018, the US Federal Circuit Court of Appeals rejected Google's bid to have the case reheard. This meant that the decision — that Google's use of the Java APIs was "not fair as a matter of law" — would stand, and the search giant would have to fork out US$8.8 to billion to Oracle or else try to take the case to the Supreme Court – as it did.
Google then went to the Supreme Court in 2019, seeking to have the highest court in the US again rule on the dispute.