How to Export Scraped Data to Excel and Google Sheets (Apify, Octoparse, Crawlee)
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
- Run your Actor or open a completed run
- Click the Dataset tab
- Click Export → Choose format: CSV, Excel, JSON, JSON-L
- 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)
- Open a completed run in Apify Console
- Click Export → Google Sheets
- Authenticate your Google account
- 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:
- Complete a task run
- Click Export Data in the task panel
- Choose format: Excel, CSV, HTML, TXT, JSON, MySQL/SQL Server
- Download
Cloud Export (Octoparse Cloud Plan):
- Log into Octoparse cloud
- Open the task → Run History
- Select a run → Click Export
- 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
| Tool | CSV | Excel | Google Sheets | JSON | API |
|---|---|---|---|---|---|
| Apify | Yes | Yes | Yes (native) | Yes | Yes |
| Octoparse | Yes | Yes | Via cloud plan | Yes | Yes |
| Crawlee | Via code | Via code | Via Google API | Native | Build 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
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.
