Skip to main content

How to Export Scraped Data to Excel and Google Sheets (Apify, Octoparse, Crawlee)

· 4 min read
Yassine El Haddad
Software Developer & Automation Specialist

I build production AI agents, web scrapers, and automation pipelines. Most of what I publish here comes from the actual problems they run into: proxies that get banned, anti-bot stacks that fingerprint your client, RAG that drifts when the underlying data moves. Stack: Python, TypeScript, Go, FastAPI, LangChain, Crawlee, Playwright, deployed on AWS, GCP, and Cloudflare.

Every major scraping tool — Apify, Octoparse, and Crawlee — supports direct export to CSV, Excel, and Google Sheets. This guide shows the fastest path for each tool.

Export from Apify

Option 1: Download from Console

  1. Run your Actor or open a completed run
  2. Click the Dataset tab
  3. Click Export → Choose format: CSV, Excel, JSON, JSON-L
  4. Download the file

Option 2: Direct URL Download (No Login Required)

# CSV
curl "https://api.apify.com/v2/datasets/YOUR_DATASET_ID/items?format=csv&clean=true&fpr=use-apify" \
-o results.csv

# Excel
curl "https://api.apify.com/v2/datasets/YOUR_DATASET_ID/items?format=xlsx&fpr=use-apify" \
-o results.xlsx

Replace YOUR_DATASET_ID with the dataset ID from your run (visible in the run URL or API response).

Option 3: Export to Google Sheets (Built-in Integration)

  1. Open a completed run in Apify Console
  2. Click ExportGoogle Sheets
  3. Authenticate your Google account
  4. Select a spreadsheet or create new

Apify writes data row by row during or after the run.

Option 4: Live Google Sheets Sync via API

For dashboards that auto-refresh, use Google Apps Script to pull Apify data:

// Google Apps Script — run as a time-based trigger
function syncApifyData() {
const datasetId = 'YOUR_DATASET_ID';
const token = 'YOUR_APIFY_TOKEN';
const url = `https://api.apify.com/v2/datasets/$%7BdatasetId%7D/items?format=json&clean=true&fpr=use-apify`;

const response = UrlFetchApp.fetch(url, {
headers: { Authorization: `Bearer ${token}` },
});

const items = JSON.parse(response.getContentText());
const sheet = SpreadsheetApp.getActiveSheet();

// Write headers
const headers = Object.keys(items[0]);
sheet.getRange(1, 1, 1, headers.length).setValues([headers]);

// Write data rows
const rows = items.map((item) => headers.map((h) => item[h] ?? ''));
sheet.getRange(2, 1, rows.length, headers.length).setValues(rows);
}

Set a time-based trigger (e.g., hourly) to keep the sheet fresh.


Export from Octoparse

Direct Export in Octoparse Desktop App:

  1. Complete a task run
  2. Click Export Data in the task panel
  3. Choose format: Excel, CSV, HTML, TXT, JSON, MySQL/SQL Server
  4. Download

Cloud Export (Octoparse Cloud Plan):

  1. Log into Octoparse cloud
  2. Open the task → Run History
  3. Select a run → Click Export
  4. Choose destination: local file, Google Drive, or Dropbox

Scheduled Export via API:

import requests

# Get Octoparse token
token_resp = requests.post(
"https://dataapi.octoparse.com/token",
data={"username": "YOUR_USER", "password": "YOUR_PASS"}
)
token = token_resp.json()["data"]["access_token"]

# Export task data as Excel
export_resp = requests.get(
f"https://dataapi.octoparse.com/api/allData?taskId=YOUR_TASK_ID&returnFields=&keyword=",
headers={"Authorization": f"bearer {token}"}
)
# Parse export_resp.json()["data"] rows

Export from Crawlee (Node.js)

Crawlee stores data in ./storage/datasets/default/ as JSON files. Export to CSV:

import { Dataset } from 'crawlee';
import { writeFileSync } from 'fs';
import { stringify } from 'csv-stringify/sync';

const dataset = await Dataset.open();
const { items } = await dataset.getData();

const csv = stringify(items, { header: true });
writeFileSync('output.csv', csv);
console.log(`Exported ${items.length} rows to output.csv`);

Install csv-stringify: npm install csv-stringify


Comparison: Export Options

ToolCSVExcelGoogle SheetsJSONAPI
ApifyYesYesYes (native)YesYes
OctoparseYesYesVia cloud planYesYes
CrawleeVia codeVia codeVia Google APINativeBuild yourself

Recommendation: For non-technical users needing quick exports, Apify or Octoparse both offer one-click exports. Apify's Google Sheets integration is the most seamless for live data sync.


FAQ

Frequently Asked Questions

After an Apify Actor run, go to the Dataset tab in Apify Console and click 'Export to Google Sheets'. You will be prompted to authorize Google Sheets access and provide a spreadsheet URL or create a new sheet. Apify writes the data automatically. For ongoing sync, use the webhook option to trigger export after each Actor run.

Yes. Apify, Octoparse, and most scraping tools support direct CSV or XLSX export. In Apify, click the Dataset tab and select 'Download XLSX' or 'Download CSV'. In Crawlee or custom scrapers, use the csv-stringify (Node.js) or pandas (Python) library to write results to a file.

In Apify, set up a webhook that fires on Actor run success and calls an integration (Make.com, n8n, or Zapier) to write data to Google Sheets. Alternatively, enable 'Auto-push to Google Drive' in your Actor's output configuration. For Crawlee scrapers, add a postStop hook that exports the dataset to CSV using the KeyValueStore API.

Common mistakes and fixes

Apify CSV export has encoding issues in Excel.

When opening the CSV in Excel, use Data → From Text/CSV and set encoding to UTF-8. Alternatively, use the Excel format option in Apify's dataset export.

Google Sheets integration hits API quota limits.

Google Sheets API has a 100 write operations/100 seconds limit. For large datasets, export to CSV first and then import to Sheets, or batch writes via Google Apps Script.

Octoparse export shows only partial data.

Check if your Octoparse task was paused mid-run. Partial exports contain only the data collected before the pause. Re-run the full task to get complete results.