# Download PDF files from a list of links

**Use case:** 

Downloads PDF documents from direct links, keeps only documents with 'File types', and returns each file's link, size and SHA-256, plus one ZIP of all files. This example downloads three public IRS forms.

## Input

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "https://www.irs.gov/pub/irs-pdf/fw4.pdf",
    "https://www.irs.gov/pub/irs-pdf/f1040.pdf"
  ],
  "urlFields": [
    "url"
  ],
  "fileTypes": "documents",
  "maxFiles": 1000,
  "maxFileSizeMb": 100,
  "skipDuplicateFiles": true,
  "fileTimeoutSecs": 120,
  "maxConcurrency": 8,
  "respectRobotsTxt": false
}
```

## Output

```json
{
  "fileIndex": {
    "label": "#",
    "format": "number"
  },
  "url": {
    "label": "Link",
    "format": "link"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "fileUrl": {
    "label": "File",
    "format": "link"
  },
  "fileName": {
    "label": "File name",
    "format": "text"
  },
  "contentType": {
    "label": "Type",
    "format": "text"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "httpStatus": {
    "label": "HTTP",
    "format": "number"
  },
  "duplicateOf": {
    "label": "Same file as",
    "format": "link"
  },
  "charged": {
    "label": "Charged",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Bulk File Downloader: URLs or Dataset Fields to Files & ZIP Actor is ready to run with the inputs already set for "Download PDF files from a list of links". [Sign up or log in](https://console.apify.com/create-task-from-example/XegbSc7Dvfzl4x2eO) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Download PDF files from a list of links" task

The Bulk File Downloader: URLs or Dataset Fields to Files & ZIP Actor will start running based on the input automatically. You can also change all the input fields, like URLs, link fields, and more, to match your specific use case.

### 3. Receive the "Download PDF files from a list of links" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as #, link, status, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Download PDF files from a list of links" task via API](https://apify.com/klarto/bulk-file-downloader.md).

## FAQ

### What happens to links that are not documents?

With File types set to documents, the PDF download task skips other files after reading only their headers. They get status 'skipped' and are free.

### Can I download PDFs that need a login?

No. The PDF download task sends no cookies and signs in nowhere; links that need a login fail with HTTP 401 or 403 and are free.

### How long are the downloaded PDFs kept?

The PDF download task saves files in the run's key-value store, which follows Apify data retention. Copy the files if you need permanent links.

## About this Actor

This example demonstrates how to use [Bulk File Downloader: URLs or Dataset Fields to Files & ZIP](https://apify.com/klarto/bulk-file-downloader.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/klarto/bulk-file-downloader.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/klarto/bulk-file-downloader.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
