Skip to main content
Version: 3.11

Export entire dataset to one file

This Dataset example uses the exportToValue function to export the entire default dataset to a single CSV file into the default key-value store.

Run on
import { Dataset } from 'crawlee';

// Retrieve or generate two items to be pushed
const data = [
{
id: 123,
name: 'foo',
},
{
id: 456,
name: 'bar',
},
];

// Push the two items to the default dataset
await Dataset.pushData(data);

// Export the entirety of the dataset to a single file in
// the default key-value store under the key "OUTPUT"
await Dataset.exportToCSV('OUTPUT');