Wash Sale Checker - Cost Basis & Safe Rebuy Date Calculator avatar

Wash Sale Checker - Cost Basis & Safe Rebuy Date Calculator

Pricing

$50.00 / 1,000 query answereds

Go to Apify Store
Wash Sale Checker - Cost Basis & Safe Rebuy Date Calculator

Wash Sale Checker - Cost Basis & Safe Rebuy Date Calculator

Wash sale checker for US stock trades: send your buys and sells across taxable, IRA and spouse accounts and ask whether buying or selling a ticker on a date would disallow a loss (IRC 1091). Disallowed amount, adjusted cost basis, safe rebuy date, yearly gains. JSON/CSV, pay per query.

Pricing

$50.00 / 1,000 query answereds

Rating

0.0

(0)

Developer

DV1 321

DV1 321

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

Wash sale checker for US stock trades as plain JSON or CSV rows: would buying or selling a ticker on a date disallow a loss under the US wash-sale rule (IRC section 1091)? You send your own trades, across every account at once (taxable, traditional and Roth IRA, spouse), and the service replays them under the rule: which losses are disallowed and by which purchase, what cost basis and holding date the replacement shares now carry, the first day a repurchase no longer washes a loss, and the year's realized gains split short and long term. It uses no outside data at all; the only input is your trades, and the output is a rule calculation on them, never a recommendation and never tax advice.

The Actor is a thin client: it sends each query you give it to the wash-sale service, charges one event per query the service answers, and writes the answer to the dataset as one summary row plus one row per open window, replacement purchase, determination, sale and open lot. A run takes seconds and uses 256 MB. You need no API key or account with any broker; the Actor carries its own credential.

Why a broker's 1099-B is not enough

A broker reports wash sales only inside one account, for the identical security. Everything that crosses accounts, crosses brokers, lands in an IRA, or happens in a spouse's account is the taxpayer's own job on Form 8949, and the IRA case is the expensive one: a loss washed by an IRA purchase gets no basis adjustment, so it is gone for good. The service applies the rule across all the accounts you send, and answers the question before the trade, when it can still change what you do.

The buy question: would buying this ticker on this date wash a loss?

A query is your trades plus a question. With check = buy, symbol and on (the date of the proposed purchase), the summary row answers in a sentence (check_statement, for example "Buying PLTR before Oct 4, 2026 disallows $200.00 from your Sep 3, 2026 sale in fid. Safe to rebuy Oct 4, 2026."), with the fields behind it: check_safe (true when no loss sale of that ticker in the 30 days before has unwashed shares), check_safe_date (the first day a purchase washes nothing), check_max_disallowed (the most the purchase could disallow over every open window) and check_permanent (true when the purchase would be in an IRA, set with account_type, so the loss would be lost for good rather than added to the new shares' basis). One window row per loss sale the purchase would wash gives sale_id, sale_date, account, shares_washable, loss_per_share, max_disallowed and safe_date.

The sell question: is this sale already washed?

With check = sell, symbol, on, account (the account the shares would be sold from, as named in trades) and quantity, the summary row says how many of the shares' loss is already washed by purchases in the 30 days before (check_washable_shares) and by which ones: one replacement row each with trade_id, date, account, shares and permanent. check_safe is true when no purchase in the 30 days before would wash the sale; a purchase in the 30 days after would still wash it, which the statement says.

The ledger: every determination, sale and open lot

Leave check empty and the query is the ledger alone, which every answer also carries. One determination row per disallowance: loss_sale_id, replacement_trade_id, replacement_account, shares_washed, disallowed, permanent, basis_adjusted_qty, window_start and window_end. One sale row per sale, in replay order: date, account, symbol, quantity, realized (gain, negative for a loss, net of fees), disallowed, allowed, short_term, long_term and in_ira (a sale inside an IRA is not a taxable event and stays out of the year's totals). One lot row per lot still open after the replay: acquisition_id, account, symbol, quantity, basis_per_share (six decimals, fees and any disallowed loss included), holding_date (after any tacking) and adjusted. The summary row totals the year you name (default: the year of the proposed trade, else of the latest trade): year_realized, year_short_term, year_long_term, year_disallowed_total, year_disallowed_permanent and year_allowed. Rows the rule could not apply to (a sale of more than the account held, an unsupported kind) are listed in errors, never dropped silently.

How to write the trades

One trade per row, account,account_type,date,symbol,kind,quantity,price[,fees], rows separated by ; or new lines: the account is any name you choose (fid, schwab, roth); account_type is taxable, trad_ira, roth_ira, spouse_taxable or spouse_ira; the date is YYYY-MM-DD; kind is buy, sell, reinvest (a dividend reinvestment) or stock_plan_acquire (an RSU vest or ESPP purchase); quantity and price are plain numbers; fees are optional. A JSON array of objects with those field names, and an optional id, also works. Rows are named t1, t2, ... in the order sent unless the JSON names them, and every answer refers to trades by those ids. At most 500 rows per query; one ticker's trades for the period that matters is usually a few dozen.

Several questions in one run

The top-level fields are the first query. Add queries as a list of objects using the same field names to ask more questions about the same trades: a query that names its own question (check, symbol, account_type, account, quantity) does not inherit the top-level question, but does inherit the trades, so you give the trades once; a query with only on asks the top-level question on another date; a query with its own trades runs on those instead. A run may hold at most 25 queries, and each query the service answers is one billable event.

Example input

{
"trades": "fid,taxable,2026-08-01,PLTR,buy,100,10;fid,taxable,2026-09-03,PLTR,sell,100,8",
"check": "buy",
"symbol": "PLTR",
"on": "2026-09-20",
"queries": [
{ "check": "buy", "symbol": "PLTR", "on": "2026-10-04" },
{ "check": "sell", "symbol": "PLTR", "on": "2026-09-20", "account": "fid", "quantity": 100 }
]
}

That run is three queries on the same two trades: would buying PLTR on 2026-09-20 wash the 2026-09-03 loss (yes, $200.00, safe to rebuy 2026-10-04), would buying on 2026-10-04 (no open window), and would selling 100 PLTR from fid at a loss on 2026-09-20 already be washed (no purchase in the 30 days before). Field names are the service's own, so a queries object is exactly the question it sends.

Output: example rows, CSV views and the OUTPUT record

Every row starts with the same eight columns: scout, row_type (summary, window, replacement, determination, sale or lot), query_index (1-based position in the run), query (the normalised question as sent, with the trades echoed as a row count, never verbatim), as_of (the date the question was asked about), receipt, source (the rule applied) and disclaimer. Then the row's own fields. A sale row looks like this:

{
"scout": "basis",
"row_type": "sale",
"query_index": 1,
"query": { "check": "buy", "on": "2026-09-20", "symbol": "PLTR", "trades": "2 rows" },
"as_of": "2026-09-20",
"receipt": "",
"source": "Rule: Internal Revenue Code section 1091 and IRS Publication 550, Investment Income and Expenses (Wash Sales). The calculation is BasisScout's own.",
"disclaimer": "BasisScout is a record-keeping calculation, not tax advice. ...",
"rank": 1,
"sale_id": "t2",
"date": "2026-09-03",
"account": "fid",
"symbol": "PLTR",
"quantity": "100",
"realized": "-200.00",
"disallowed": "0.00",
"allowed": "-200.00",
"short_term": "-200.00",
"long_term": "0.00",
"in_ira": false
}

The dataset has two table views: summary (one line per query: the answer and the year's totals) and ledger (one line per window, replacement, determination, sale and lot). Filter on row_type when you export both as one CSV. The run's OUTPUT key-value record holds the service's response for every query verbatim, keyed q1, q2, ..., each with the question it answered, plus an errors map for any query that failed.

Privacy: where your trades go

Your trades are in this run's INPUT record, in your own Apify storage, like any Actor input. The service receives them for the duration of one request, processes them in memory and keeps nothing: they are not stored, not logged and not shared, and the service's edge drops them from its access log. The dataset rows and the OUTPUT record carry the answer and a row count, not the trades.

Pricing: pay per query answered

One query-answered event per query the service answered, whatever the size of the ledger: one question is one event, ten questions is ten events. Rows are never billed individually, so a long trade list changes the size of the dataset, not the price. A query the service refuses (a malformed trade row, a question about a ticker that is not in the trades, the service warming up) is not charged, and the run still succeeds with the queries that worked; only a run where every query failed ends as failed. A question whose answer is "no open window" is answered, charged once and writes its summary row with check_safe true. If you set a maximum cost for the run, the Actor keeps to it: a query the limit does not cover is not sent to the service and not charged, the run still ends as succeeded with the queries that fit, and the status message says how many were left out and why. Price: $0.05 per check answered, on every Apify plan. Example: three checks a day is about 90 checks a month, $4.50.

Use cases: before the trade, at year end, and for the records

  • Before a repurchase: you sold at a loss and want back in. One check says whether buying today washes the loss, by how much, and the first day it would not.
  • Before a sale: you hold shares bought at different times in different accounts and want to know whether a loss on the ones you would sell is already washed by a recent purchase, including one in an IRA, where the loss would be gone for good.
  • Across brokers and spouses: the trades from two brokerages, an IRA and a spouse's account in one list, which no single 1099-B can do.
  • Year-end review: the ledger alone, with every determination and the year's realized, short-term, long-term, disallowed and allowed figures, as rows for the file or the spreadsheet.
  • Spreadsheets and dashboards: export the ledger view as CSV or attach Apify's Google Sheets integration so every run appends its rows.
  • AI agents and automations: like any public Actor it can be called through the Apify API, a webhook or Apify's MCP server, with the same input and the same dataset.

Data source and attribution

The service uses no outside data. The rule it applies is Internal Revenue Code section 1091 as IRS Publication 550, Investment Income and Expenses (Wash Sales), describes it, a US Government work in the public domain; the calculation is the service's own, and the service is not affiliated with or endorsed by the IRS or by any broker. The scope, in the service's words: US federal wash-sale rule only, matched on the same ticker across every account sent; not modelled are options on the same underlying, short sales, stock splits, "substantially identical" pairs (share classes, similar ETFs) and digital assets; FIFO lot matching; trade dates, not settlement dates. Every summary row carries that in scope, the rule in source and the service's disclaimer verbatim:

BasisScout is a record-keeping calculation, not tax advice. It applies the US wash-sale rule (IRC section 1091) to the trades you send, using same-ticker matching only. It cannot see trades you did not send, cannot decide whether two different securities are "substantially identical", and does not know your full tax situation. Confirm results with a tax professional before relying on them. BasisScout is not affiliated with any broker or with the IRS.

FAQ

Does it tell me whether to make the trade? No. It states what the rule does to the trades you sent: the disallowed amount, the safe date, the basis the replacement shares would carry. The decision, and any question of what you owe, is yours and your tax professional's.

Is it a wash sale calculator for tax-loss harvesting? It answers the question tax loss harvesting turns on: whether a sale at a loss is already washed by a purchase in any of your accounts, how much of the loss is disallowed, and the first date a repurchase no longer washes it. It does not choose which positions to harvest.

Does it calculate capital gains? It reports each sale's realized gain or loss, split short term and long term by holding period, and the year's totals with the disallowed amounts taken out. It does not compute capital gains tax: no rates, brackets or state rules.

Does it know about trades I did not send? No. "No open window" means none among the trades given. Send every account's trades in the ticker for the 61 days around the date you are asking about, and for the whole year when you want the year's totals.

What about ETFs that track the same index, or options on the stock? Not matched. The rule's "substantially identical" test is a judgment the service does not make; it matches the same ticker only and says so in scope. Options on the same underlying, short sales, stock splits and digital assets are not modelled either.

Why does an IRA purchase matter so much? A loss washed by a purchase in a taxable account is deferred: it is added to the replacement shares' basis and comes back when they are sold. A loss washed by a purchase in an IRA gets no basis adjustment, so it is lost for good. check_permanent, permanent and year_disallowed_permanent mark that case.

How are lots matched? First in, first out within an account, on trade dates. Dividend reinvestments and stock-plan acquisitions count as purchases, and a replacement purchase on the same day as the sale is matched before the sale.

Can I ask several questions in one run? Yes: queries is a list of question objects, each one more event, all on the trades given once at the top level unless an object brings its own. At most 25 queries per run.

Do I need an API key? No. The Actor carries its own credential for the wash-sale service; you only give it the trades and the question.

Why did one query fail while the others worked? The service answers each query on its own; one it cannot answer (a malformed trade row, a ticker that is not in the trades, the service warming up) is recorded in the status message and the OUTPUT record's errors map, skipped without charge, and the rest continue. A query the service never answers (unreachable, or a gateway error) is retried once; after two such queries in a row the remaining ones are skipped rather than waited for.

What happens with an empty input? The run succeeds with one unbilled status row (status: needs_input) that names the missing field, gives a hint and repeats the example input. Nothing is sent to the service and nothing is charged. Any field that is present must still be valid.