Paperful Icon

Paperfuldocs

Search

Search papers

Search the content of every paper in your workspace.

Search looks through the content of all processed papers in your workspace and returns the passages that match.

const { items } = await paperful.search.query("quarterly revenue growth");

for (const result of items) {
  console.log(result.paper.fileName, result.score);
  console.log(result.content);
}

Each result includes:

FieldDescription
contentThe matching passage.
scoreHow relevant the result is.
paperThe paper the passage belongs to.
nodesThe nodes the passage came from, with their pages.
matchesThe matched terms and where they appear in the passage.

To expand a result into the content around it, see Search to context.

Choose a search mode

const { items } = await paperful.search.query("revenue",
  {
    mode: "fulltext",
  }
);
ModeDescription
hybridCombines keyword and semantic search. The default.
fulltextMatches the exact words in your query.
semanticMatches by meaning, even when the words differ.

On this page