<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moriarty Data Tools</title>
    <description>The latest articles on DEV Community by Moriarty Data Tools (@moriarty_ag).</description>
    <link>https://dev.to/moriarty_ag</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4268791%2F879a05de-6d32-4faf-bdfb-8e89e0ac04de.png</url>
      <title>DEV Community: Moriarty Data Tools</title>
      <link>https://dev.to/moriarty_ag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moriarty_ag"/>
    <language>en</language>
    <item>
      <title>How to send Apify scraper results to Google Sheets automatically (no OAuth, no Zapier)</title>
      <dc:creator>Moriarty Data Tools</dc:creator>
      <pubDate>Fri, 27 Nov 2026 13:02:50 +0000</pubDate>
      <link>https://dev.to/moriarty_ag/how-to-send-apify-scraper-results-to-google-sheets-automatically-no-oauth-no-zapier-3lc8</link>
      <guid>https://dev.to/moriarty_ag/how-to-send-apify-scraper-results-to-google-sheets-automatically-no-oauth-no-zapier-3lc8</guid>
      <description>&lt;p&gt;If you scrape with Apify, sooner or later you want the results in a Google Sheet: every day, below yesterday's rows, without copying CSVs by hand. This guide shows how to set that up in about 10 minutes, with a connection that never expires and works from schedules and AI agents.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I built the two Actors used here (Google Sheets Export and Google Sheets Import). The Google setup in Step 1 works with any service-account based tool.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Three things usually go wrong when people try this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;"App blocked by Google"&lt;/strong&gt;: tools that log in with "Sign in with Google" (OAuth) get blocked or their tokens expire, so scheduled runs fail at 3 a.m.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Append that overwrites&lt;/strong&gt;: the second run replaces the first instead of adding rows below it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unreadable sheets&lt;/strong&gt;: nested scraper data turns into hundreds of columns like &lt;code&gt;metadata.openGraph.7.content&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The fix for the first one is a &lt;strong&gt;Google service account&lt;/strong&gt;: a robot Google account that you create once and share your sheet with. No browser login, nothing to renew. The other two are handled by the Actor.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An Apify account (the free plan is enough to follow along)&lt;/li&gt;
&lt;li&gt;A Google account&lt;/li&gt;
&lt;li&gt;A Google Sheet you want to fill&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Create a Google service account (3 minutes, once)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Console&lt;/a&gt; and create a project (any name).&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;APIs &amp;amp; Services → Library&lt;/strong&gt;, search &lt;strong&gt;Google Sheets API&lt;/strong&gt; and click &lt;strong&gt;Enable&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;IAM &amp;amp; Admin → Service Accounts → Create service account&lt;/strong&gt;. Give it a name like &lt;code&gt;apify-sheets&lt;/code&gt;. It needs &lt;strong&gt;no roles&lt;/strong&gt;, so skip that step.&lt;/li&gt;
&lt;li&gt;Open the new account → &lt;strong&gt;Keys → Add key → Create new key → JSON&lt;/strong&gt;. A small &lt;code&gt;.json&lt;/code&gt; file downloads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That file is the key. Treat it like a password: never paste it in a chat, a public task or a repo. It only works on sheets you explicitly share with it, and you can delete it in one click from the same &lt;strong&gt;Keys&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;Copy the account's email. It looks like &lt;code&gt;apify-sheets@your-project.iam.gserviceaccount.com&lt;/code&gt;. You need it in the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Share your sheet with the service account
&lt;/h2&gt;

&lt;p&gt;Open your Google Sheet → &lt;strong&gt;Share&lt;/strong&gt; → paste the service account email → role &lt;strong&gt;Editor&lt;/strong&gt; → &lt;strong&gt;Send&lt;/strong&gt;. Google may warn that the address can't receive email. That's fine.&lt;/p&gt;

&lt;p&gt;The sheet stays private: only you, the people you already shared it with, and the robot can open it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Preview, then export
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://apify.com/moriarty_ag/google-sheets-export" rel="noopener noreferrer"&gt;Google Sheets Export&lt;/a&gt; on Apify and click &lt;strong&gt;Try for free&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preview first (no Google needed).&lt;/strong&gt; Pick a dataset from one of your scraper runs in &lt;strong&gt;Dataset ID to export&lt;/strong&gt; and tick &lt;strong&gt;Preview only&lt;/strong&gt;. The run writes nothing to Google; its Output shows exactly the rows and columns your sheet will get. Nested objects become columns like &lt;code&gt;address.city&lt;/code&gt;; lists stay in one cell as JSON, so a crawler's output gives you ~50 columns instead of ~400.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then the real export.&lt;/strong&gt; Untick Preview and fill in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spreadsheet URL or ID&lt;/strong&gt;: the whole address bar of your sheet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google service account key&lt;/strong&gt;: the full content of the &lt;code&gt;.json&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tab name&lt;/strong&gt;: e.g. &lt;code&gt;Leads&lt;/code&gt; (created if it doesn't exist)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mode&lt;/strong&gt;: &lt;strong&gt;Append&lt;/strong&gt; (keeps existing rows)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Columns (optional)&lt;/strong&gt;: only the fields you want, in order, e.g. &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;address.city&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Start&lt;/strong&gt;. Run it twice and you'll see the point of real append: the second run's rows land &lt;strong&gt;below&lt;/strong&gt; the first ones, with a single header row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Make it automatic after every scraper run
&lt;/h2&gt;

&lt;p&gt;Apify can start one Actor when another finishes. Set it up once and every successful scrape lands in your sheet.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your scraper (or its saved task) → &lt;strong&gt;Integrations&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add integration → Apify Actor&lt;/strong&gt; and choose &lt;strong&gt;Google Sheets Export&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Trigger: &lt;strong&gt;Run succeeded&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the input, set &lt;strong&gt;Dataset ID to export&lt;/strong&gt; to &lt;code&gt;{{resource.defaultDatasetId}}&lt;/code&gt;. Apify replaces it with the dataset of the run that just finished.&lt;/li&gt;
&lt;li&gt;Fill in the spreadsheet, key, tab and &lt;code&gt;append&lt;/code&gt; as in Step 3. &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole input as JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"spreadsheet"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"serviceAccountJson"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PASTE_THE_FULL_JSON_KEY_HERE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"datasetId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"{{resource.defaultDatasetId}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"sheetName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Leads"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"append"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now schedule the scraper (&lt;strong&gt;Schedules → Create new&lt;/strong&gt;, e.g. every morning) and the sheet grows by itself. Want a fresh snapshot each time instead of a growing log? Use &lt;code&gt;"mode": "replace"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From an AI agent.&lt;/strong&gt; The Actor has nothing interactive, so Claude, ChatGPT or Cursor can call it through Apify's MCP server and write rows straight to a sheet: add &lt;code&gt;https://mcp.apify.com?tools=moriarty_ag/google-sheets-export&lt;/code&gt; to your MCP client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: the other direction, a private sheet as scraper input
&lt;/h2&gt;

&lt;p&gt;Many teams keep their scraping targets in a sheet: a list of URLs, keywords or products that non-technical colleagues edit. &lt;a href="https://apify.com/moriarty_ag/google-sheets-import" rel="noopener noreferrer"&gt;Google Sheets Import&lt;/a&gt; reads any tab (&lt;strong&gt;including private sheets&lt;/strong&gt;, with no public link) into an Apify dataset, using the same service account (as &lt;strong&gt;Viewer&lt;/strong&gt; is enough).&lt;/p&gt;

&lt;p&gt;A tab with the header URL | Priority in row 1 and two shops in rows 2 and 3 becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"_row"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"URL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://shop-a.example"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"high"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"_row"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"URL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://shop-b.example"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"low"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;_row&lt;/code&gt; is the real row number, so every result can be traced back to the row it came from. That gives you a full loop with no code: &lt;strong&gt;sheet → Import → scraper → Export → sheet&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Both Actors charge per row and include the platform usage: &lt;strong&gt;$0.20 per 1,000 rows&lt;/strong&gt; plus &lt;strong&gt;$0.0005 per run&lt;/strong&gt; (cheaper on paid Apify plans). A daily scraper that adds 200 rows costs about &lt;strong&gt;$1.20 a month&lt;/strong&gt;. Preview runs and failed runs don't pay for rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternatives, honestly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Download CSV from Apify and import by hand&lt;/strong&gt;: fine for one-off exports, but manual every time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make, Zapier or n8n with their Google Sheets module&lt;/strong&gt;: good if you already pay for one of them; it's one more tool and plan, with its own Google login.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An Apify Actor with a service account (this guide)&lt;/strong&gt;: best for scheduled scrapers, integrations and AI agents; you create the Google key once (Step 1).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No access to the spreadsheet&lt;/strong&gt;: share the sheet with the service account email (Step 2).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Sheets API is not enabled&lt;/strong&gt;: APIs &amp;amp; Services → Library → Google Sheets API → Enable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not valid JSON / not a service-account key&lt;/strong&gt;: paste the &lt;strong&gt;whole&lt;/strong&gt; &lt;code&gt;.json&lt;/code&gt; file, from &lt;code&gt;{&lt;/code&gt; to &lt;code&gt;}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Could not open dataset&lt;/strong&gt;: pick the dataset with the picker, or use &lt;code&gt;{{resource.defaultDatasetId}}&lt;/code&gt; in an integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs about N cells&lt;/strong&gt;: Google allows 10 million cells per spreadsheet; export fewer columns or use a new sheet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Questions or a bug? Open an issue on the Actor's &lt;strong&gt;Issues&lt;/strong&gt; tab. I read every one.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure again: I'm the developer of Google Sheets Export and Google Sheets Import.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>apify</category>
      <category>webscraping</category>
      <category>automation</category>
      <category>googlecloud</category>
    </item>
  </channel>
</rss>
