Skip to main content
Send the public URL of a document, and Scrape returns its text as Markdown, the same way it reads a page. To read a file from your own disk, use Parse documents.

Make a request

Get an API key in the Quickstart. This request reads the first two pages of a research paper and marks where each page starts.

Read the response

The text is in data.markdown. Page 2 starts after a --- line and a <!-- page 2 --> marker. This real response is cut. Each page’s text is shortened.
contentType says what the file is. totalPages is the pages in the file, and ocrPages appears when some pages were read from their picture. A PDF always comes back as Markdown.

Options

Send the PDF options in parsers, as "pdf" or as an object. Stophy reads the picture of at most 20 pages per call, in auto or ocr mode. Without an API key, only the text layer is read.

Other documents

  • A CSV file comes back as a Markdown table, and so does each sheet of an Excel .xlsx file. The first row becomes the table header.
  • A Word .docx or PowerPoint .pptx file comes back as Markdown text.
  • The older .doc, .xls and .ppt formats cannot be read.
A NASA temperature CSV at https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv, read with "maxChars": 500, returned a table. This real response is cut to the fields that matter. The file’s first line is a title, so the title is the table header.

Limits and errors

  • A file larger than 20 MB, or one that is too large once unpacked, returns 400 invalidRequest and says so.
  • A password-protected file, a file that cannot be opened, and a URL that is an image or another download return 400 invalidRequest and name the problem.
  • A PDF that takes too long to read returns 400 invalidRequest and suggests a smaller maxPages.
  • Combine maxChars and offset to read a long document part by part. See Content filtering.

Price

$1 per 1,000 pages for the read, plus $0.50 per 1,000 pages of PDF text from its text layer and $2.50 per 1,000 pages of text read from its picture, that come back. The example above read 2 pages of a PDF from their text layer and cost $0.002. A PDF read with maxChars, offset or query is charged for the share of its pages that it returns, at least 1 page. A file that cannot be read costs nothing.