In AP Computer Science Principles, a library is a collection of pre-written procedures that programmers can use when creating new programs, simplifying complex tasks. You interact with a library through its API and documentation, which explain what each procedure does and how to call it (Topic 3.14).
A library is a collection of procedures someone already wrote, tested, and packaged so you can use them in your own programs without rebuilding them from scratch. Think of it like a toolbox. You don't forge your own hammer every time you need to hang a picture; you grab the one that already exists. Need to generate random numbers, do complex math, or draw graphics? There's almost certainly a library procedure for that.
The CED makes two points you should lock in. First, existing code can come from internal sources (code you or your team wrote earlier) or external sources (libraries other people published). Second, you can't use a library blindly. An application program interface (API) is the specification for how a library's procedures behave and how you're supposed to use them, and the documentation is what tells you what each procedure expects as input and what it gives back. Library, API, and documentation travel together as a package on the exam.
Libraries live in Topic 3.14 (Libraries) in Unit 3: Algorithms and Programming, under learning objective AP Comp Sci P 3.14.A: select appropriate libraries or existing code segments to use in creating new programs. The big idea is that the use of libraries simplifies the task of creating complex programs. This connects directly to procedural abstraction. A library is abstraction at scale, because you call a procedure by name and trust the documented behavior without ever reading the code inside it. The exam cares less about memorizing specific libraries and more about whether you can judge when reusing existing code is the smart move and what you need (documentation, an API) to use it correctly.
API (application program interface) (Unit 3)
The API is the instruction manual for the library. The library contains the procedures; the API specifies how those procedures behave and how to call them. The exam expects you to know that you need the API spec, not the library's internal code, to use it correctly.
Documentation (Unit 3)
The CED says documentation is necessary to understand what an API or library actually does. In practice this means reading what inputs a procedure expects and what it returns before you call it, which is exactly the judgment MCQs test.
Procedural abstraction (Unit 3)
Libraries are procedural abstraction taken one step further. When you write your own procedure, you abstract away your own details. When you import a library, you abstract away someone else's details and trust the documented behavior.
Simulations and randomness (Unit 3)
Random number generation is the classic library use case in AP CSP. Simulations need randomness, and calling a random library procedure beats writing your own generator. Practice questions frequently frame library selection around exactly this scenario.
Libraries show up almost entirely in multiple-choice questions, and they test judgment, not memorization. A typical stem describes a programmer with a task (running a simulation that needs random numbers, performing complex math) and asks which approach is the most efficient use of existing code. The right answer usually involves calling a library procedure instead of writing equivalent code from scratch. Other stems flip it around and ask about valid concerns when using a third-party library (will it behave as documented, is it maintained, does it fit the task) or which consideration matters LEAST when picking one. The skill being tested is AP Comp Sci P 3.14.A, selecting appropriate libraries or existing code segments. The Create performance task is gone, but on the written exam you should be ready to explain why a library call simplifies a program and why documentation is required to use one correctly.
A library is the actual collection of pre-written procedures. An API is the specification that describes how those procedures behave and how you're allowed to use them. The library is the toolbox; the API is the labeled diagram telling you what each tool does. The exam treats them as related but distinct: you use a library, and you read its API (via documentation) to use it correctly.
A library is a collection of pre-written procedures you can use in new programs instead of writing that code yourself.
Existing code segments can come from internal sources (code you wrote before) or external sources (published libraries).
The use of libraries simplifies the task of creating complex programs, which is the exact CED phrasing worth remembering.
An API is the specification for how a library's procedures behave; you need documentation to understand and use a library correctly.
Exam questions test whether you can select the appropriate library for a task (like random number generation) and recognize valid concerns about third-party code.
A library is a collection of pre-written procedures that programmers can use when creating new programs. It's covered in Topic 3.14 and exists so you don't have to rebuild common functionality, like random number generation, from scratch.
The library is the actual code (the procedures themselves), while the API is the specification describing how those procedures behave and how to use them. On the exam, remember that you need the API and its documentation, not the library's source code, to use a library correctly.
No. The exam tests the concept, not specific library names. You need to recognize when using a library is the most efficient choice, why libraries simplify complex programs, and why documentation matters.
They're related but not identical. A module is a chunk of a program, a library is a collection of reusable procedures you call when you want, and a framework is a larger structure that calls your code. For AP CSP, 'library' is the term the CED uses, so stick with that on the exam.
Because you can't see (or shouldn't need to see) the code inside a library's procedures. Documentation tells you what each procedure does, what inputs it expects, and what it returns, which is the only way to use it correctly.
Connect this key term to the AP exam workflow: review the course, practice questions, and check related study tools.
Review units, study guides, and course resources.
Check this vocabulary in multiple-choice context.
Apply key concepts in written AP responses.
Estimate the exam score you are working toward.
Review the highest-yield facts before practice.
Put the full course together before test day.