Who it is for
Teams that run scrapers on Apify but work in Google Sheets: sales teams with lead lists, marketers with price or rank trackers, analysts who build Looker Studio reports. Also developers who want a reliable last step after a scraper run instead of their own Sheets API code.
What you can do with the data
A lead list that only grows
Connect it to a scheduled scraper and pick appendNew with keyField set to url. Each run adds only leads the sheet has not seen, so the sales team works one list without the same lead twice.
A fresh price table for charts
Use replace to clear the tab and write the newest results after every run. Keep your charts and formulas on another tab that reads from it, since a replace overwrites edits in the target tab.
Only the columns your team reads
List fields in fields to set the columns and their order, with dot paths such as address.city for nested data. Fields you leave out of the list are not written.
A source for Looker Studio or Apps Script
The sheet becomes the data source for a dashboard or a script. Values are written as raw text by default, so a scraped string that starts with = stays text and cannot run as a formula.
Tutorial
How to send new scraper results to a sheet after every run
- Get a free Apify account and click the Run it on Apify button on this page to open the Actor.
- Create a Google spreadsheet and share it as Editor with the built-in service account,
sheets-export@apify-514417.iam.gserviceaccount.com, or paste your own key intoserviceAccountJson. - Open the scraper you want to export, go to its Integrations tab and add Google Sheets Export.
- Set
datasetIdto{{resource.defaultDatasetId}}and paste the sheet URL intospreadsheet. Choose a tab insheetName, such asLeads. - Set
modetoappendNewandkeyFieldto a unique field of your data, such asurlorid. - Run the scraper. When it finishes, the export runs and the status message says how many rows were added.
Examples
Export a dataset to Google Sheets
Copies every item of an Apify dataset into a tab of your Google Sheet, with a header row and nested data flattened into columns. Replaces the tab on each run, so it is always a fresh copy. Replace the example dataset and spreadsheet with your own.
{
"datasetId": "MYsSEJZcfvwhcDzhC",
"spreadsheet": "https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit",
"sheetName": "Sheet1",
"mode": "replace"
}Run this input from the Apify API (curl)
curl -X POST 'https://api.apify.com/v2/acts/carabain-digital~google-sheets-export/run-sync-get-dataset-items' \
-H "Authorization: Bearer $APIFY_TOKEN" -H 'Content-Type: application/json' \
-d '{"datasetId": "MYsSEJZcfvwhcDzhC", "spreadsheet": "https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit", "sheetName": "Sheet1", "mode": "replace"}'Run it from Python
# pip install apify-client
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("carabain-digital/google-sheets-export").call(run_input={'datasetId': 'MYsSEJZcfvwhcDzhC', 'spreadsheet': 'https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit', 'sheetName': 'Sheet1', 'mode': 'replace'})
items = client.dataset(run["defaultDatasetId"]).list_items().itemsAppend only new items to a Google Sheet
Adds only the dataset items whose url is not in your Google Sheet yet, so a scheduled scraper builds up a list without duplicates. Change the key field to any unique field of your data. Replace the example dataset and spreadsheet with your own.
{
"datasetId": "MYsSEJZcfvwhcDzhC",
"spreadsheet": "https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit",
"sheetName": "Items",
"mode": "appendNew",
"keyField": "url"
}Run this input from the Apify API (curl)
curl -X POST 'https://api.apify.com/v2/acts/carabain-digital~google-sheets-export/run-sync-get-dataset-items' \
-H "Authorization: Bearer $APIFY_TOKEN" -H 'Content-Type: application/json' \
-d '{"datasetId": "MYsSEJZcfvwhcDzhC", "spreadsheet": "https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit", "sheetName": "Items", "mode": "appendNew", "keyField": "url"}'Run it from Python
# pip install apify-client
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("carabain-digital/google-sheets-export").call(run_input={'datasetId': 'MYsSEJZcfvwhcDzhC', 'spreadsheet': 'https://docs.google.com/spreadsheets/d/1dHj8fy3dQYtPf37NiTl1qj-YqwCzb3jcNLrkpzqIYRI/edit', 'sheetName': 'Items', 'mode': 'appendNew', 'keyField': 'url'})
items = client.dataset(run["defaultDatasetId"]).list_items().itemsSet APIFY_TOKEN to your token from Apify Console, Settings, Integrations. The curl call waits up to 5 minutes; for bigger runs see running from the API and Python. AI agents can call it through the Apify MCP server: https://mcp.apify.com/?actors=carabain-digital/google-sheets-export.