Skip to content
Search/
CyberMax › Answers

How to filter an Apify dataset and export it to CSV or Excel

Updated 2026-11-13 · Data and API builders · by CyberMax

Short answer

Filter the dataset on the fields you care about, keep and rename only the columns you need, flatten nested objects into columns, then export. Rowmold on Apify does it in one run at $0.0002 per row kept; rows you filter out and the CSV/Excel files are free.

  1. Pick the scraper run's dataset in datasetIds (or pass its ID through the API).
  2. Add filters, e.g. {"field": "rating", "op": "gte", "value": 4} and {"field": "website", "op": "notEmpty"}.
  3. List fields to keep in order; rename with "as" ("title as name", "address.city as city").
  4. Turn on flatten for spreadsheet columns; use unwind to get one row per email or review.
  5. Set exportFormats to ["xlsx"] or ["csv"]: the files are linked in the run's OUTPUT record.

Copy-paste code

Python (pip install apify-client)

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("cybermax/dataset-filter-transform").call(run_input={
    "datasetIds": ["YOUR_DATASET_ID"],
    "filters": [{"field": "rating", "op": "gte", "value": 4}],
    "fields": ["title as name", "phone", "website"],
    "exportFormats": ["xlsx"],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row)

Chain after any scraper (Apify Integrations -> Run Actor)

{
  "datasetIds": ["{{resource.defaultDatasetId}}"],
  "filters": [{"field": "rating", "op": "gte", "value": 4}],
  "monitor": true,
  "monitorKey": "good-leads"
}

No code: n8n, Make or Zapier

n8n: HTTP Request node (or the Apify node, action "Run an Actor and get dataset")
Method:  POST
URL:     https://api.apify.com/v2/acts/cybermax~dataset-filter-transform/run-sync-get-dataset-items
Auth:    Header Auth  ->  Authorization: Bearer <your Apify token>
Body:    JSON  {"datasetIds": ["ID"], "filters": [{"field": "rating", "op": "gte", "value": 4}]}

Make:    Apify app -> "Run an Actor" (Actor: cybermax/dataset-filter-transform, wait for finish = yes) -> "Get Dataset Items"
Zapier:  Apify app -> action "Run Actor" (cybermax/dataset-filter-transform) -> "Fetch Dataset Items" -> your app
Runs longer than 5 minutes: start with POST /v2/acts/cybermax~dataset-filter-transform/runs and read the dataset when the run finishes.

From an AI agent (MCP)

# Any MCP client (Claude Desktop, Claude Code, Cursor, VS Code): Apify's hosted MCP server
{
  "mcpServers": {
    "dataset-filter-transform": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.apify.com/?tools=cybermax/dataset-filter-transform",
               "--header", "Authorization: Bearer ${APIFY_TOKEN}"],
      "env": { "APIFY_TOKEN": "<your Apify token>" }
    }
  }
}
# The agent sees one tool, cybermax--dataset-filter-transform, with the Actor's input schema.
Real run on Apify (10 Nov 2026: rating >= 4 with a website, emails split into rows, flattened, sorted, CSV + Excel exported; 2.0 s)
nameemailratingaddress.cityaddress.state
Blue Bottle Coffeehello@example.com4.6OaklandCA
Blue Bottle Coffeepress@example.com4.6OaklandCA
Intelligentsiainfo@example.org4.5ChicagoIL

Source: Rowmold (Apify Actor cybermax/dataset-filter-transform) README, real Apify run on 10 Nov 2026

Run Rowmold on ApifyRowmeld: merge and dedupe datasets

Filter on numbers and dates, not text

Scrapers often store numbers as text ("4.5", "1,250"). Rowmold compares numbers and ISO dates as numbers and dates, so rating >= 4 and postedAt >= 2026-11-01 work as you expect.

Nested JSON into spreadsheet columns

flatten turns {"address": {"city": "Austin"}} into an address.city column; joinArrays turns ["a", "b"] into "a, b". That is what makes a clean Excel file.

Only new matching rows on a schedule

With monitor on, each run passes on only rows it has never sent before, so a daily scraper plus Rowmold becomes an alert feed you pay for only when something new matches.

Good to know

Sorting and file exports hold rows in memory: about 145,000 rows at the default 512 MB.

To merge several runs and remove duplicates first, use Rowmeld, then Rowmold.

Cartlark icon

Cartlark: Every product, price and stock level

$0.0008 per product, no start fee

Filtering product data? Cartlark scrapes every product, price and stock level of any Shopify or WooCommerce store at $0.0008 per product.

Runs on your own Apify account, pay per result; failed results are not charged.

Questions

Is it free to try?

Yes. Run it with no input for a free demo on sample data.

Which filters are there?

equals, notEquals, contains, notContains, startsWith, endsWith, matches (regex), gt, gte, lt, lte, in, notIn, isEmpty, notEmpty, exists, notExists, with AND or OR.

Does it change my original dataset?

No. It writes a new dataset and files.

Can an AI agent use it?

Yes. Apify's MCP server exposes it as cybermax--dataset-filter-transform.

Free: the Free API Starter Kit

Copy-paste calls for 4 APIs with free daily tiers (CVE priority, VIN recalls, US duty rates, email checks), then 5 short emails on KEV/EPSS, MCP and free data.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.

Related answers

How to merge datasets and remove duplicate rows from many Apify runsCombine the results of many scraper runs into one clean list: dedupe by URL, name or phone, fill blanks, keep How to scrape a Shopify store's products, prices and stockGet every product, price, sale price and stock level from any Shopify or WooCommerce store, plus price-drop al