# CA Crypto CSV Normalizer | Newton Kraken Shakepay (`dimmed_feldspar/ca-crypto-csv-normalizer`) Actor

Merge Canadian exchange CSV exports into one unified ledger. Pay per normalized row. Cloud twin of the Gumroad DIY kit — not tax advice.

- **URL**: https://apify.com/dimmed\_feldspar/ca-crypto-csv-normalizer.md
- **Developed by:** [Phil King](https://apify.com/dimmed_feldspar) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## CA Crypto CSV Normalizer | Newton Kraken Shakepay Coinbase Binance

**What it does:** Merges Newton, Kraken, Shakepay, Coinbase, and Binance CSV exports into one sorted, unified ledger.

**Try it now:** Click **Try for free** on this Store page — sample Newton + Kraken CSVs are preloaded (~4 rows, ~$0.09 USD).

#### Sample output (proof run `B1J6CnLyzKrqMo3lV`)

| ts | exchange | asset | tx_type | amount |
|----|----------|-------|---------|-------:|
| 2024-03-15T10:30:00 | newton | BTC | buy | 0.0015 |
| 2024-03-20T08:15:00 | kraken | BTC | trade | 0.002 |
| 2024-04-02T14:00:00 | newton | ETH | sell | 0.05 |
| 2024-05-01T16:45:00 | kraken | ETH | trade | -0.03 |

#### 30-second walkthrough (no run required)

![Step 1 — prefilled Newton + Kraken input](assets/walkthrough_1_input.png)

![Step 2 — successful run (~$0.09 on sample)](assets/walkthrough_2_success.png)

![Step 3 — unified 4-row dataset](assets/walkthrough_3_output.png)

**Prefer offline?** [CA Crypto CSV Starter (PWYW)](https://juliusrex53.gumroad.com/l/ca-crypto-csv-starter) — includes a Koinly-shaped export helper (not affiliated with Koinly). Same normalizer as the Try demo above.

**Cloud twin of the [Gumroad CA Crypto CSV Starter](https://juliusrex53.gumroad.com/l/ca-crypto-csv-starter) DIY kit.** Paste exchange CSV exports; get one sorted, unified ledger. **Not tax advice** — organizational tooling only. Verify all output against your exchange records before filing with CRA.

Built by **Phil King** — IBM Db2 Genius Hub AI Engineer (Ontario, Canada). Same philosophy as the local CLI: reliable transforms, clear I/O, pay for what you use.

---

### What it does

Canadian crypto holders often trade on **Newton**, **Kraken**, **Shakepay**, **Coinbase**, and **Binance**. Each export uses different column names. This Actor:

1. Accepts one or more CSV file contents (paste into input)
2. Auto-detects the exchange format
3. Normalizes every row into a **unified schema**
4. Returns a sorted dataset + a downloadable unified CSV blob

Use the output for Koinly import prep, CoinTracker, Excel review, or handing off to an accountant.

---

### Input

```json
{
  "csvTexts": [
    "Date,Transaction Type,Currency,Amount,CAD Value,Fee,Description\n2024-03-15 10:30:00,buy,BTC,0.001500,112.50,0.25,Market buy\n2024-04-02 14:00:00,sell,ETH,0.050000,180.00,0.50,Market sell",
    "time,type,asset,amount,fee,txid,refid\n2024-03-20T08:15:00,trade,BTC,0.002000,0.00001000,TXK001,REF001\n2024-05-01T16:45:00,trade,ETH,-0.030000,0.00005000,TXK002,REF002"
  ],
  "fileNames": ["newton.csv", "kraken.csv"]
}
````

Copy-paste ready: see `tests/fixtures/example_store_input.json` (same fixtures used for the verified Store proof run).

| Field | Required | Description |
|-------|----------|-------------|
| `csvTexts` | Yes | Array of raw CSV strings — one per exchange export |
| `fileNames` | No | Labels aligned to `csvTexts` (defaults to `upload_1.csv`, â€¦) |

***

### Output

#### Dataset (one row per transaction)

| Column | Description |
|--------|-------------|
| `ts` | Timestamp (ISO when parseable) |
| `exchange` | `newton`, `kraken`, `shakepay`, `coinbase`, or `binance` |
| `tx_type` | buy, sell, deposit, withdrawal, etc. |
| `asset` | BTC, ETH, CAD, â€¦ |
| `amount` | Quantity |
| `amount_cad` | CAD value when available |
| `fee_asset` / `fee_amount` | Fee fields when present |
| `note` | Reference ID or description |
| `source_file` | Which upload this row came from |

#### Key-value store `OUTPUT`

```json
{
  "row_count": 42,
  "exchanges": ["kraken", "newton"],
  "unified_csv": "ts,exchange,tx_type,asset,amount,...\n..."
}
```

Copy `unified_csv` to a `.csv` file or pipe into downstream tools.

***

### Supported exchanges

| Exchange | Detection | Notes |
|----------|-----------|-------|
| **Newton** | `Transaction Type`, `Currency`, `CAD Value` columns | Primary CA on-ramp |
| **Kraken** | `txid`, `refid`, `asset`, `amount` columns | Ledger export |
| **Shakepay** | `Type`, `Amount (CAD)` columns | Mobile-friendly exports |
| **Coinbase** | `Quantity Transacted`, `Spot Price` columns | CAD total only when Price Currency = CAD |
| **Binance** | `UTC_Time`, `Operation`, `Coin` columns | No CAD field (Binance doesn't report fiat) |
| Other | Generic fallback | Best-effort; verify output |

***

### Pricing (pay per event)

| Event | Price (USD) | When charged |
|-------|------------:|--------------|
| `apify-default-dataset-item` (result) | $0.01 | Each normalized row in the dataset |
| `run-complete` | $0.05 | Once per successful run |
| `apify-actor-start` | ~$0.00005 | Actor start (platform minimum) |

Example: 200 rows â‰ˆ **$2.05 USD** ($2.00 rows + $0.05 run). Typical tax-year export (500–2,000 rows) â‰ˆ **$5–20 USD** — cheaper than manual spreadsheet work, no subscription.

***

### Example use cases

- **Multi-exchange trader** — merge Newton buys + Kraken trades before Koinly import
- **Accountant handoff** — one CSV instead of three incompatible exports
- **Automation / agents** — call from a workflow; pay only for rows processed
- **Try before DIY** — run once here, then buy the [local CLI starter](https://juliusrex53.gumroad.com/l/ca-crypto-csv-starter) for offline use

***

### Limitations & disclaimer

- **Not tax advice.** Does not compute ACB, capital gains, or CRA forms.
- **Best-effort parsing.** Exchange CSV layouts change; always spot-check a sample of rows.
- **No exchange login.** You paste CSV text only — no API keys required.
- **CAD fields** depend on what the source export includes (Kraken often has no CAD column).

***

### Related products

| Product | Channel | Best for |
|---------|---------|----------|
| [CA Crypto CSV Starter (PWYW)](https://juliusrex53.gumroad.com/l/ca-crypto-csv-starter) | Gumroad | Free/local CLI, privacy-first |
| [CA Crypto Tax Prep Kit ($27)](https://juliusrex53.gumroad.com/l/ca-crypto-tax-prep-kit) | Gumroad | Multi-exchange bundle + Koinly formatter |
| **This Actor** | Apify Store | One-off cloud runs, no install |

***

### Keywords

`koinly`, `crypto tax`, `csv normalize`, `newton`, `kraken`, `shakepay`, `coinbase`, `binance`, `CRA`, `ACB`, `canadian crypto`, `exchange export`, `ledger merge`

# Actor input Schema

## `csvTexts` (type: `array`):

Paste one or more exchange CSV file contents (Newton, Kraken, Shakepay).

## `fileNames` (type: `array`):

Optional labels aligned to csvTexts entries.

## Actor input object example

```json
{
  "csvTexts": [
    "Date,Transaction Type,Currency,Amount,CAD Value,Fee,Description\n2024-03-15 10:30:00,buy,BTC,0.001500,112.50,0.25,Market buy\n2024-04-02 14:00:00,sell,ETH,0.050000,180.00,0.50,Market sell",
    "time,type,asset,amount,fee,txid,refid\n2024-03-20T08:15:00,trade,BTC,0.002000,0.00001000,TXK001,REF001\n2024-05-01T16:45:00,trade,ETH,-0.030000,0.00005000,TXK002,REF002"
  ],
  "fileNames": [
    "newton.csv",
    "kraken.csv"
  ]
}
```

# Actor output Schema

## `ledgerRows` (type: `string`):

One row per normalized transaction — ts, exchange, asset, amount, fees

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

Row count, exchanges detected, and full unified CSV string

# 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 = {
    "csvTexts": [
        "Date,Transaction Type,Currency,Amount,CAD Value,Fee,Description\n2024-03-15 10:30:00,buy,BTC,0.001500,112.50,0.25,Market buy\n2024-04-02 14:00:00,sell,ETH,0.050000,180.00,0.50,Market sell",
        "time,type,asset,amount,fee,txid,refid\n2024-03-20T08:15:00,trade,BTC,0.002000,0.00001000,TXK001,REF001\n2024-05-01T16:45:00,trade,ETH,-0.030000,0.00005000,TXK002,REF002"
    ],
    "fileNames": [
        "newton.csv",
        "kraken.csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dimmed_feldspar/ca-crypto-csv-normalizer").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 = {
    "csvTexts": [
        """Date,Transaction Type,Currency,Amount,CAD Value,Fee,Description
2024-03-15 10:30:00,buy,BTC,0.001500,112.50,0.25,Market buy
2024-04-02 14:00:00,sell,ETH,0.050000,180.00,0.50,Market sell""",
        """time,type,asset,amount,fee,txid,refid
2024-03-20T08:15:00,trade,BTC,0.002000,0.00001000,TXK001,REF001
2024-05-01T16:45:00,trade,ETH,-0.030000,0.00005000,TXK002,REF002""",
    ],
    "fileNames": [
        "newton.csv",
        "kraken.csv",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("dimmed_feldspar/ca-crypto-csv-normalizer").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 '{
  "csvTexts": [
    "Date,Transaction Type,Currency,Amount,CAD Value,Fee,Description\\n2024-03-15 10:30:00,buy,BTC,0.001500,112.50,0.25,Market buy\\n2024-04-02 14:00:00,sell,ETH,0.050000,180.00,0.50,Market sell",
    "time,type,asset,amount,fee,txid,refid\\n2024-03-20T08:15:00,trade,BTC,0.002000,0.00001000,TXK001,REF001\\n2024-05-01T16:45:00,trade,ETH,-0.030000,0.00005000,TXK002,REF002"
  ],
  "fileNames": [
    "newton.csv",
    "kraken.csv"
  ]
}' |
apify call dimmed_feldspar/ca-crypto-csv-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dimmed_feldspar/ca-crypto-csv-normalizer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CA Crypto CSV Normalizer | Newton Kraken Shakepay",
        "description": "Merge Canadian exchange CSV exports into one unified ledger. Pay per normalized row. Cloud twin of the Gumroad DIY kit — not tax advice.",
        "version": "0.2",
        "x-build-id": "arpf1emkhN4c6CKmt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dimmed_feldspar~ca-crypto-csv-normalizer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dimmed_feldspar-ca-crypto-csv-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dimmed_feldspar~ca-crypto-csv-normalizer/runs": {
            "post": {
                "operationId": "runs-sync-dimmed_feldspar-ca-crypto-csv-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dimmed_feldspar~ca-crypto-csv-normalizer/run-sync": {
            "post": {
                "operationId": "run-sync-dimmed_feldspar-ca-crypto-csv-normalizer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "csvTexts"
                ],
                "properties": {
                    "csvTexts": {
                        "title": "CSV file contents",
                        "type": "array",
                        "description": "Paste one or more exchange CSV file contents (Newton, Kraken, Shakepay).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "fileNames": {
                        "title": "Source file names (optional)",
                        "type": "array",
                        "description": "Optional labels aligned to csvTexts entries.",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
