# Kindle Clippings Parser (`punctual_alghoza/kindle-clippings-parser`) Actor

- **URL**: https://apify.com/punctual_alghoza/kindle-clippings-parser.md
- **Developed by:** [Andrew](https://apify.com/punctual_alghoza) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$200.00 / 1,000 kindle clippings parseds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Kindle Clippings Parser

**Turn your Kindle's `My Clippings.txt` into clean, deduplicated JSON — no
account, no subscription, pay only for what you parse.**

Your Kindle quietly logs every highlight, note, and bookmark into a single
`My Clippings.txt` file. That file is a mess: duplicate entries, locale-dependent
headers, titles that contain parentheses, books merged together. This Actor
parses it and returns one structured record per book.

### What you get

- **Books grouped** — title + author extracted correctly, even when titles
  contain parentheses (`Vol. 2 (Series) (Real Author)`).
- **Highlights, notes, and bookmarks separated** — with location, page, and
  `added_on` date per entry.
- **Deduplication** — Kindle's sync duplicates are removed.
- **Encoding and locale handled** — UTF-8 BOM, CRLF, German/Spanish metadata
  lines (`Position`/`posición`), files that would crash a naive parser.
- **Deterministic** — no AI involved, no hallucination risk, instant results.

### Example input

```json
{ "content": "Book One (Jane Author)\n- Your Highlight at location 123-125 | Added on Monday, January 1, 2024 10:00:00 AM\n\nThe quoted passage.\n==========\n" }
```

Or pass a `url` to a publicly hosted copy of the file.

### Example output (dataset row)

```json
{ "rowType": "book", "title": "Book One", "author": "Jane Author",
  "highlights": [{ "kind": "highlight", "text": "The quoted passage.",
    "location": "123-125", "location_start": 123,
    "added_on": "Monday, January 1, 2024 10:00:00 AM" }],
  "notes": [], "bookmarks": [] }
```

A final `report` row summarizes counts for the whole file.

### Pricing

- **$0.20 per parsed file** (event `file-parsed`, charged once per successful run).
- Platform usage is not passed through — the price is the price.
- No subscription. Typical run: under 2 seconds.

### Limits

- Max input 15 MB (or 20 MB via URL). Larger files are rejected with a clear error.
- URL fetching: public http(s) only; private addresses are blocked for your safety.
- Output format: JSON only (v1). Markdown/CSV export is on the roadmap.
- Real files only — this is a parser, not a scraper. Nothing is stored after your
  run: the parsed JSON lives in your own Apify storage, and nothing is retained
  by the developer.

### Use it

- **Console**: paste your file contents and hit Run.
- **API**: POST a run with the JSON input above; read the dataset when finished.
- **AI agents / MCP**: call it as a tool and get structured highlights for your
  own second-brain automations.

### Support

Questions or a file it didn't parse right? Use the **Messaging** button on the
Actor page — edge-case reports with a sample file are welcome (that's how the
parser got this good).

***

*This tool processes your own files. You are responsible for ensuring you have
the right to process the content. No guarantee of fitness for any particular
purpose is provided.*

# Actor input Schema

## `content` (type: `string`):

Paste the raw contents of your Kindle's My Clippings.txt here (found on the Kindle device when connected via USB, in the documents folder).

## `url` (type: `string`):

Public http(s) URL to the My Clippings.txt file. Use this instead of pasting content. The URL must be publicly reachable.

## `format` (type: `string`):

Output format. JSON only in v1.

## `dedupe` (type: `boolean`):

Remove duplicate highlight/note entries (Kindle often writes the same entry twice).

## `maxInputMb` (type: `number`):

Maximum accepted file size in MB. Files above this are rejected with TOO_LARGE.

## Actor input object example

```json
{
  "format": "json",
  "dedupe": true,
  "maxInputMb": 15
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items: one summary row plus per-book rows with entries (type, text, location, added_on).

# 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("punctual_alghoza/kindle-clippings-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("punctual_alghoza/kindle-clippings-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 punctual_alghoza/kindle-clippings-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,punctual_alghoza/kindle-clippings-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/11IZlFTa7qOx5n4iA/builds/PYLKFTmkywFkPq0yc/openapi.json
