Paperfuldocs

Quickstart

In this guide, you will learn how to use Paperful to upload a document, process it into structured content, and search across your Papers.

This guide describes the workflow without assuming specific SDKs or API endpoints. Use the API or SDK version available in your project for the exact request shapes.

Before You Start

You need:

  • A Paperful account
  • An API Key
  • A document to upload, such as a PDF or image-based document

Upload a Paper

Send your document to Paperful using the API or an official SDK.

When the upload succeeds, Paperful creates a Paper. A Paper is the persistent record for a document and its processed output.

index.ts
const paper = await paperful.papers.upload(file, {
  wait: true, // Wait for processing to complete before returning
});

console.log(paper.id);

Save the Paper ID in your application. You will use it to retrieve the Paper and its processed content later.

Treat the Paper ID as the stable reference to a document in Paperful. Store it alongside the corresponding record in your application.

For more details, see Upload a paper.

Read the Paper Graph

Once uploaded and processed, retrieve the Paper's structured representation.

The Paper Graph describes the document as connected elements instead of a single unstructured text value. The graph elements are called Paper Nodes.

A Paper can contain nodes such as:

  • Titles and headings
  • Paragraphs and text blocks
  • Tables
  • Images
  • Other document structures
const graph = await paperful.papers.nodes.list("paper_...");

for (const node of graph.nodes) {
  console.log(node);
}

Use the graph when your application needs document-aware behavior, such as:

  • Rendering extracted document content
  • Finding a table or image
  • Preserving heading structure
  • Sending selected document sections to an AI model
  • Building citations back to document elements

Learn more in Paper Graph.

Get document content

For many use cases, you only need readable extracted content rather than the full graph.

Retrieve the Paper content and use it in your application, agent, or downstream workflow.

const content = await paperful.papers.content.get("paper_...", {format: "markdown"});

// Use extracted text or structured content in your application.
console.log(content);

Search your Papers

After Papers are processed, search across your document collection.

Paperful supports document search for workflows such as:

  • Finding relevant source material for an AI assistant
  • Looking up content across uploaded files
  • Retrieving supporting passages before generating a response
  • Building document search into an internal tool
const results = await paperful.search({
  query: "What are the payment terms?",
});

for (const result of results) {
  console.log(result);
}

Search results can point your application to relevant Papers and document content. Use them as the retrieval step before displaying results or passing context to an AI model.

On this page