I plan to use some code licensed under Apache License 2.0 in some API. How shall I include the license notice that is required by Apache License 2.0? The API is a RESTful API, which is documented on a webpage. Shall I simply add the license notice somewhere on the same webpage?

  • Are you distributing this code to others? Or are you running a single instance of it on your own server, and allowing others to interact with it?
    – MadHatter
    Mar 10, 2021 at 6:48
  • @MadHatter planning to run a single instance of it on my own server, and allowing others to interact with it via API. Mar 10, 2021 at 6:49

1 Answer 1


You have taken some code licensed to you under Apache2 and made a derivative work implementing an API. You intend to run a single instance of this work on your own server so that others can interact with it. You wish to know what your licence obligations are.

Basically, as I read it, you have nearly none. All the obligations of Apache2, including preservation of the licence text and inclusion of any provided NOTICE file, are in s4, which begins:

You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions

You aren't distributing copies of your derivative work. You have reproduced a single copy, but as long as the server-side code contains, somewhere, text that satisfies the requirements of s4, you have met your obligations.

Most free software licences only impose obligations when code is transferred to another party. The desire to extend the benefits of these obligations to people who were merely interacting with the software over a network was a major factor in developing the AGPL, and the AGPL remains unusual among free licences in extending your obligations to people who merely interact with covered code running on your server.

  • 2
    Note that things might get more complicated if the response your server sends contains (for example) a boilerplate/template response that was part of the third-party code. That could be seen as distributing a portion of the code. Some libraries avoid this problem by using a separate license for these types of content, but not all do.
    – bta
    Mar 10, 2021 at 17:10
  • @bta that's a very fair point, though in this case we have no particular reason to think that it's so.
    – MadHatter
    Mar 10, 2021 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.