# SDS/MSDS PDF Parser — 16 Sections & Changes (`invincible_nova/sds-msds-pdf-parser`) Actor

Convert English or German SDS/MSDS PDFs into 16-section JSON with page evidence, identifiers, warnings, OCR fallback, and optional revision comparison.

- **URL**: https://apify.com/invincible\_nova/sds-msds-pdf-parser.md
- **Developed by:** [Sergei Pechenov](https://apify.com/invincible_nova) (community)
- **Categories:** Developer tools
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## SDS/MSDS PDF Parser — 16 Sections, Evidence & Changes

Convert English or German safety data sheet PDFs into deterministic JSON: all detected SDS sections, source pages, product and chemical identifiers, extraction warnings, and optional revision differences.

Use this Actor for EHS document intake, supplier onboarding, SDS inventories, release monitoring, n8n/Make workflows, and machine-readable evidence for agents. It runs locally inside the Actor container and does not send documents to an AI provider.

### What you get

- Sections 1–16 with heading, full normalized text, start/end page, and evidence excerpt.
- Product name, revision date, CAS/EC numbers, H/P statements, and UN numbers with page evidence.
- Text extraction from normal PDFs and English/German OCR fallback for scanned PDFs.
- Warnings for missing, duplicate, or out-of-order sections, sparse OCR, and missing revision dates.
- Optional section-by-section comparison with a previous SDS revision.
- A failed Dataset item for a bad document without losing successful documents in the same batch.
- A failed run if no document can be parsed. Mixed batches preserve successful documents and report `status: "partial"` in SUMMARY; check each Dataset item's status.
- Up to three download attempts for temporary HTTP errors (408, 429, 500, 502, 503, 504), with short bounded waits. Persistent failures are reported, never replaced with an unrelated PDF.

This is automated document extraction. It does **not** determine chemical correctness, legal validity, or regulatory compliance.

### Try it

```json
{
  "documentUrls": ["https://example.com/safety-data-sheet.pdf"],
  "language": "auto",
  "ocrMode": "auto"
}
```

To compare revisions, provide one current document and `previousDocumentUrl` or `previousDocument`.

### Output example

```json
{
  "status": "ok",
  "sourceUrl": "https://example.com/sds.pdf",
  "extractionMethod": "text",
  "pageCount": 14,
  "sectionCount": 16,
  "identifiers": {
    "productName": { "value": "Example solvent", "page": 1 },
    "casNumbers": [{ "value": "67-64-1", "page": 3 }]
  },
  "sections": [{
    "number": 1,
    "title": "Identification",
    "evidence": { "heading": "SECTION 1: Identification", "startPage": 1, "endPage": 1 }
  }],
  "warnings": [],
  "changes": [{ "section": 1, "status": "unchanged" }]
}
```

### Limits and privacy

- Up to 5 PDFs per run, 15 MB and 50 pages per document.
- Public HTTPS URLs or an uploaded PDF; private/reserved network targets and URL credentials are blocked.
- OCR supports English and German in the MVP.
- Password-protected/corrupt PDFs may fail explicitly.
- Temporary processing files are deleted after each document. Normalized results remain in the run's Apify storage according to your storage settings.
- Do not upload documents you are not allowed to process.

### Method

The Actor uses Poppler `pdftotext -layout` for embedded text. If that text is missing or sparse, `pdftoppm` renders at bounded resolution and Tesseract performs local OCR. Section boundaries use English and German SDS headings; identifiers use deterministic patterns. Every claim in the Dataset is tied to a source page or extraction warning.

### Support

Open a GitHub Issue with a public sample URL, expected section, actual warning, and run ID. Never attach confidential SDS files to a public issue.

# Actor input Schema

## `documentUrls` (type: `array`):

Up to 5 public HTTPS PDF URLs.

## `document` (type: `string`):

Optional PDF upload. Do not upload restricted or confidential data unless your Apify storage policy permits it.

## `previousDocumentUrl` (type: `string`):

Optional previous revision for section-by-section comparison; use with exactly one current document.

## `previousDocument` (type: `string`):

Optional previous revision upload.

## `language` (type: `string`):

Used only for OCR. Auto tries English and German.

## `ocrMode` (type: `string`):

Auto uses OCR only when embedded PDF text is missing or sparse.

## `maxDocuments` (type: `integer`):

Safety cap for this run.

## Actor input object example

```json
{
  "documentUrls": [
    "https://www.fishersci.com/store/msds?countryCode=US&language=en&partNumber=A181&productDescription=ACETONE+CERTIFIED+ACS+1L&vendorId=VN00033897"
  ],
  "language": "auto",
  "ocrMode": "auto",
  "maxDocuments": 5
}
```

# Actor output Schema

## `documents` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("invincible_nova/sds-msds-pdf-parser").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("invincible_nova/sds-msds-pdf-parser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call invincible_nova/sds-msds-pdf-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,invincible_nova/sds-msds-pdf-parser"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Z2eB13PcAeEHLncan/builds/gA3hLNmi2u5LTEgHo/openapi.json
