# Kynth Documents → JSON (`kyisaiah47/kynth-documents-to-json`) Actor

Turn invoices, receipts, statements, contracts, resumes, and any document (PDF or image) into clean, schema-valid JSON. Powered by the Kynth Core API. Bring your own key — 500 free credits monthly, no card.

- **URL**: https://apify.com/kyisaiah47/kynth-documents-to-json.md
- **Developed by:** [Isaiah Kim](https://apify.com/kyisaiah47) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 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/platform/actors/running/actors-in-store#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

## Kynth Documents → JSON (Apify actor)

Turn invoices, receipts, statements, contracts, resumes, tables, and any document
(PDF or image) into clean, **schema-valid JSON** — powered by the
[Kynth Core](https://api.kynth.studio) document engines.

You bring your own Kynth API key (free at
[api.kynth.studio/dashboard](https://api.kynth.studio/dashboard) — 500 credits
every month, no card). The actor calls the real Kynth Core API directly; nothing
is proxied.

### Input

| Field           | Type            | Notes                                                                 |
| --------------- | --------------- | --------------------------------------------------------------------- |
| `endpoint`      | enum (required) | `parse`, `invoice`, `receipt`, `statement`, `contract`, `tables`, `resume`, `split`, `compare` |
| `documentUrls`  | string\[]        | Public URLs of the documents to process — one dataset row each        |
| `documentTexts` | string\[]        | Pre-extracted text, when you don't have a URL                         |
| `apiKey`        | string (secret) | Your `ksk_live_…` key. Falls back to the `KYNTH_API_KEY` env var       |

Provide at least one of `documentUrls` / `documentTexts`.

### Output

One dataset item per document:

```json
{ "endpoint": "invoice", "source": "https://…/invoice.pdf", "ok": true,
  "result": { "vendor": { "name": "Acme Supplies Inc." }, "total": 1255.5, "...": "..." },
  "requestId": "req_…" }
```

Failures are recorded too (`ok:false` + `error`) so a batch never silently drops rows.

### Pricing (pay-per-event)

The actor is monetized **pay-per-event**: it emits one `document-processed`
event for each document it successfully turns into JSON. Set the price for that
event in the actor's **Monetization → Pay per event** settings on the Apify
console. Your Kynth credits are billed separately, on your own key, at the
task-named per-document rate (e.g. `$0.08/invoice`) — and only on success.

### Local run

```bash
npm install
KYNTH_API_KEY=ksk_live_… apify run --input='{"endpoint":"invoice","documentUrls":["https://…/invoice.pdf"]}'
```

### Publish

Not published from this repo. To publish: `apify push` from this directory with
an authenticated Apify CLI (an approval-gated action for the maintainer).

# Actor input Schema

## `endpoint` (type: `string`):

Which Kynth Core document engine to run each document through.

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

Public URLs of the documents (PDF/PNG/JPG/WebP) to process — one dataset row per document.

## `documentTexts` (type: `array`):

Pre-extracted document text, one entry per document (used when you don't have a URL).

## `apiKey` (type: `string`):

Your Kynth Core key (ksk\_live\_…). Leave blank to read KYNTH\_API\_KEY from the environment / a secret. Free at api.kynth.studio/dashboard.

## Actor input object example

```json
{
  "endpoint": "parse",
  "documentUrls": [
    "https://example.com/invoice.pdf"
  ]
}
```

# 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 = {
    "documentUrls": [
        "https://example.com/invoice.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kyisaiah47/kynth-documents-to-json").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 = { "documentUrls": ["https://example.com/invoice.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("kyisaiah47/kynth-documents-to-json").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "documentUrls": [
    "https://example.com/invoice.pdf"
  ]
}' |
apify call kyisaiah47/kynth-documents-to-json --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kyisaiah47/kynth-documents-to-json",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/btHsOzcaglZiJHQoJ/builds/9MnctnVbatcM6Cxo8/openapi.json
