Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APIWeb

    web.document

    Read a public PDF: its text page by page in reading order, Markdown, tables as rows and columns, and its metadata.

    Id
    web.document
    Version
    1
    Billed per
    request — 1 unit for a charged run
    Runs
    within one request

    Start it with POST /v1/scrapers/web.document/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.

    Inputs

    The fields of input. A field that is not listed here is refused.

    Inputs of web.document
    FieldTypeDescription
    urlrequiredstringThe PDF's address: http or https, on a public host name.Limit: at most 2048 characters.
    max_pagesintegerRead the first this many pages. A longer document is read that far and truncated says so.Limit: 1 to 500. Default: 100.
    ocrbooleanRead scanned pages that have no text layer with OCR (English; the first ten such pages of the document). False lists them in unread_scans without reading them, which is faster.Default: true.
    timeout_snumberSeconds for the whole run: fetching the file and reading it.Limit: 15 to 120. Default: 60.

    Record fields

    Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.

    Record fields of web.document
    FieldTypeNotes
    urlstringThe address that was asked for.
    final_urlstringThe address that answered, after redirects.
    statusintegerThe HTTP status of the answer.
    content_typestring or nullThe media type the server named, e.g. application/pdf; servers also send PDFs as application/octet-stream.
    bytesintegerThe file's size in bytes.
    sha256stringThe SHA-256 of the file, to tell whether it changed since a previous read.
    titlestring or nullThe title in the file's metadata.
    authorstring or nullThe author in the file's metadata.
    subjectstring or nullThe subject in the file's metadata.
    keywordsstring or nullThe keywords in the file's metadata, as written.
    creatorstring or nullThe program the document was made with, from the metadata (e.g. Microsoft Word).
    producerstring or nullThe program that wrote the PDF, from the metadata.
    created_atstring (date-time) or nullWhen the file says it was created.
    modified_atstring (date-time) or nullWhen the file says it was last changed.
    pdf_versionstring or nullThe PDF version the file declares, e.g. 1.7.
    page_countintegerPages in the document.
    pages_readintegerPages read: all of them, or the first max_pages.
    encryptedbooleanTrue when the file is encrypted but opens without a password (an owner password that restricts printing or copying). A file that needs a password to open is not read.Default: false.
    taggedbooleanTrue when the file declares itself tagged (structured for screen readers).Default: false.
    restrictionsarray of stringWhat the file's owner does not allow, as its permission flags say: print, modify, copy_text, annotate, fill_forms, accessibility, assemble, print_high_quality. Empty when everything is allowed (a file that is not encrypted). Reported, not acted on: the file is read either way.
    markdownstringThe pages read, as Markdown: headings, paragraphs, lists and tables.
    text_lengthintegerCharacters of text in the pages read (each page has its own word_count).
    pagesarray of objectEach page read, with its text in reading order.
    number (in pages[])integerThe page number, from 1.
    width (in pages[])numberThe page's width in points (1/72 inch).
    height (in pages[])numberThe page's height in points.
    text (in pages[])stringThe page's text in reading order, one line of the page per line.
    text_source (in pages[])"text" | "ocr_layer" | "ocr" | "none"Where the text comes from. text: the page's own text (on a scan that was not read, only what is printed over it, such as a stamp). ocr_layer: a scanned page whose file carries a hidden text layer made by OCR, read as it is. ocr: a scanned page we read with OCR. none: no text (a blank page, or a scan that was not read).
    scanned (in pages[])booleanTrue when the page is an image of a page (a scan): images cover at least half of it and it shows almost no text of its own, or its text is a hidden OCR layer.
    ocr_confidence (in pages[])number or nullFor a page we read with OCR: the engine's mean confidence in its words, 0 to 100.
    image_cover (in pages[])numberThe share of the page covered by images, 0 to 1.
    word_count (in pages[])integerWords in text.
    tablesarray of objectThe tables read from the pages, in page order, each with its confidence (high only when every label, heading and figure was placed without a guess) and its issues.
    page (in tables[])integerThe page it is on, from 1.
    header (in tables[])array of string or nullThe column headings, one per column (null for a column without one); null when the table shows none. Headings written on several lines are joined.
    rows (in tables[])array of array of stringThe rows, top to bottom, one cell per column as the page writes it ("$ 36,034", "(1,984)", "—"); null for an empty cell. A row with only its first cell is a section label, such as "Assets:".
    bbox (in tables[])array of numberIts box on the page in points, [x0, y0, x1, y1], measured from the bottom left corner.
    confidence (in tables[])"high" | "low"high when every row's label, every heading and every figure was placed without a guess. low when one was not, or when no heading was found (issues says which): check a low table against the page before using its numbers.Default: "high".
    issues (in tables[])array of stringWhat could not be placed with certainty, each making the table low: figures_joined (two figures in one cell), signs_apart (signs not joined to their figures), figures_in_labels, words_in_figures (words among the figures, such as a form's lines read across its boxes), labels_missing (no column of labels was found), labels_uncertain (a label alone on its line could head the rows below or go on in the next), heading_unplaced (which columns a heading stands over could not be told, or two columns came out under one heading), header_incomplete and no_header (no column headings were found). And one that is only said: heading_spans_columns (a heading over several columns, written over each).
    outlinearray of objectThe document's outline (its bookmarks), when it has one; the first 500 entries.
    level (in outline[])integerIts depth in the outline, from 1.
    title (in outline[])stringThe entry's title.
    page (in outline[])integer or nullThe page it leads to, from 1; null when it leads nowhere in the file.
    unread_scansarray of integerScanned pages without a text layer that were not read: OCR was not asked for, the limit of pages read with OCR was reached, or OCR found no text.
    unreadable_pagesarray of integerPages the document lists but that cannot be loaded (a damaged page tree); they have no entry in pages.
    truncatedbooleanTrue when not every page was read (max_pages, or the text limit).Default: false.
    fetched_atstring (date-time)When the file was fetched, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    curl -X POST "https://api.enrichednow.com/v1/scrapers/web.document/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"url":"https://www.federalreserve.gov/releases/h41/current/h41.pdf","max_pages":1}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("web.document", {
        "url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
        "max_pages": 1,
    })
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("web.document", {
      url: "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
      max_pages: 1,
    });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "web.document", map[string]any{"url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf", "max_pages": 1})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("web.document", Map.of("url", "https://www.federalreserve.gov/releases/h41/current/h41.pdf", "max_pages", 1));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run web.document --input url=https://www.federalreserve.gov/releases/h41/current/h41.pdf --input max_pages=1

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "input": {
        "url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
        "max_pages": 1
      }
    }

    Example response

    The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.

    JSON
    {
      "id": "run_841742f37553189ff9c27ba1",
      "scraper_id": "web.document",
      "scraper_version": 1,
      "status": "ok",
      "reason": null,
      "input": {
        "url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
        "max_pages": 1
      },
      "record_count": 1,
      "units": 1,
      "units_per_request": 1,
      "units_per_record": null,
      "units_per_page": null,
      "diagnostics": {
        "requests": 1,
        "bytes": 259214,
        "wall_ms": 885,
        "facts": {}
      },
      "created_at": "2026-11-16T22:37:50.170950Z",
      "started_at": "2026-11-16T22:37:50.178331Z",
      "finished_at": "2026-11-16T22:37:51.066313Z"
    }

    Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.

    JSON
    {
      "records": [
        {
          "url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
          "final_url": "https://www.federalreserve.gov/releases/h41/current/h41.pdf",
          "status": 200,
          "content_type": "application/pdf",
          "bytes": 190004,
          "sha256": "02b69213c7e62b96d49913bb7372da7b23de10e427eaabb5118652781226b439",
          "title": null,
          "author": null,
          "subject": null,
          "keywords": null,
          "creator": "Microsoft Office Word",
          "producer": "Aspose.Words for .NET 21.3.0",
          "created_at": "2023-03-16T13:38:00Z",
          "modified_at": "2026-10-21T16:04:00Z",
          "pdf_version": "1.7",
          "page_count": 11,
          "pages_read": 1,
          "encrypted": false,
          "tagged": false,
          "restrictions": [],
          "markdown": "# FEDERAL RESERVE statistical release\n\nH.4.1\n\n## Factors Affecting Reserve Balances of Depository Institutions and Condition Statement of Federal Reserve Banks November 19, 2026\n\n1. Factors Affecting Reserve Balances of Depository … [truncated]",
          "text_length": 2085,
          "pages": [
            {
              "number": 1,
              "width": 612,
              "height": 792,
              "text": "FEDERAL RESERVE statistical release\nH.4.1\nFactors Affecting Reserve Balances of Depository Institutions and\nCondition Statement of Federal Reserve Banks November 19, 2026\n1. Factors Affecting Reserve Balances of Depository Institutions … [truncated]",
              "text_source": "text",
              "scanned": false,
              "ocr_confidence": null,
              "image_cover": 0.012,
              "word_count": 344
            }
          ],
          "tables": [
            {
              "page": 1,
              "header": [
                "Reserve Bank credit, related items, and reserve balances of depository institutions at Federal Reserve Banks",
                "Averages of daily figures Week ended Nov 18, 2026",
                "Averages of daily figures Change from week ended Nov 11, 2026"
              ],
              "rows": [
                [
                  "Reserve Bank credit",
                  "6,705,670",
                  "-1,792"
                ],
                [
                  "Securities held outright1",
                  "6,472,783",
                  "+3,620"
                ],
                [
                  "U.S. Treasury securities",
                  "4,586,939",
                  "+3,645"
                ]
              ],
              "bbox": [
                35.2,
                273.9,
                571.7,
                618.1
              ],
              "confidence": "high",
              "issues": [
                "heading_spans_columns"
              ]
            }
          ],
          "outline": [],
          "unread_scans": [],
          "unreadable_pages": [],
          "truncated": true,
          "fetched_at": "2026-11-25T06:04:10.365601Z"
        }
      ],
      "next_cursor": null
    }

    What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].

    • Shortened: markdown: 2,513 characters, the first 230 shown.
    • Shortened: pages[0].text: 2,085 characters, the first 235 shown.
    • Shortened: tables[0].header: 5 items, the first 3 shown.
    • Shortened: tables[0].rows: 29 items, the first 3 shown.
    • Shortened: tables[0].rows[0]: 5 items, the first 3 shown.
    • Shortened: tables[0].rows[1]: 5 items, the first 3 shown.
    • Shortened: tables[0].rows[2]: 5 items, the first 3 shown.

    A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Web scrapers are in their own section there.