Every night, a small robot writes a blog draft for me while I sleep. It costs me nothing. It runs on no server. And it was built with two free tools that come with any Google account: Google Apps Script and the Gemini API.
In this tutorial I will show you the exact pipeline, with copy-paste code. But I will also tell you the one design decision that matters more than the code: my robot is only allowed to create drafts, never to publish. If you skip that part, this same automation can get your blog rejected by AdSense instead of approved. I will explain why at the end.
What This Automation Actually Does
The pipeline is simple on purpose:
- A time-based trigger wakes up my Apps Script (for example, every morning at 6 AM).
- The script sends a topic prompt to the Gemini API and gets back a structured article draft.
- The script saves that draft to my Blogger account using the Blogger API — as a draft, sitting quietly in my dashboard.
- Later, I open the draft, fact-check it, rewrite it in my own voice, add my own examples, and only then publish.
Think of it as hiring a free junior writer who prepares raw material every day. The thinking, checking, and final writing is still yours.
What You Need (Everything Is Free)
- A Google account and a Blogger blog
- A free Gemini API key from Google AI Studio (click "Get API key" — no credit card needed on the free tier)
- Google Apps Script, at script.google.com — free with every Google account, no hosting, no server
That is the whole stack. No Zapier, no Make, no monthly subscription. When I searched this topic before writing, almost every guide pushed a paid no-code tool. You genuinely do not need one for Blogger.
Step 1: Get Your Free Gemini API Key
Go to Google AI Studio, sign in, and click Get API key. Copy the key somewhere safe and treat it like a password. The free tier has daily request limits, but a personal blog pipeline uses a tiny fraction of them — check the current limits on the official Gemini pricing page, because Google adjusts them from time to time.
Step 2: Create the Apps Script Project
Open script.google.com, create a new project, and paste this. Replace the three values at the top.
const GEMINI_API_KEY = 'YOUR_API_KEY';
const BLOG_ID = 'YOUR_BLOG_ID'; // from your Blogger dashboard URL
const TOPIC = 'Write a beginner-friendly outline and draft about: ';
function createDailyDraft() {
const topic = pickTopic(); // your topic list below
const article = askGemini(TOPIC + topic);
saveBloggerDraft(topic, article);
}
function askGemini(prompt) {
const url = 'https://generativelanguage.googleapis.com/v1beta/models/'
+ 'gemini-2.5-flash:generateContent?key=' + GEMINI_API_KEY;
const payload = { contents: [{ parts: [{ text: prompt }] }] };
const res = UrlFetchApp.fetch(url, {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(payload)
});
const data = JSON.parse(res.getContentText());
return data.candidates[0].content.parts[0].text;
}
function saveBloggerDraft(title, htmlContent) {
const url = 'https://www.googleapis.com/blogger/v3/blogs/'
+ BLOG_ID + '/posts/?isDraft=true';
UrlFetchApp.fetch(url, {
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + ScriptApp.getOAuthToken() },
payload: JSON.stringify({ title: title, content: htmlContent })
});
}
function pickTopic() {
const topics = [
'free AI tools for students',
'automating boring tasks with Apps Script',
'how the Gemini API free tier works'
];
return topics[Math.floor(Math.random() * topics.length)];
}
One extra step makes the Blogger part work: in the Apps Script editor open Project Settings, tick Show "appsscript.json" manifest file, and add the Blogger scope so the script is allowed to touch your blog:
{
"timeZone": "Asia/Kathmandu",
"oauthScopes": [
"https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/script.external_request"
]
}
Run createDailyDraft once manually. Google will show a permission screen — approve it (it is your own script touching your own blog). Then check your Blogger dashboard: a new draft should be waiting.
Step 3: Make It Run Automatically
In the left sidebar of Apps Script, open Triggers (the clock icon) → Add Trigger. Choose the function createDailyDraft, event source Time-driven, and pick a daily time window. Done. From tomorrow, drafts appear on their own.
The Rule That Protects Your Blog: Drafts, Never Auto-Publish
Here is the part most automation tutorials will not tell you, because they are selling the automation.
Google's spam policies explicitly target "scaled content abuse" — publishing many pages of unreviewed, mass-generated content whose main purpose is ranking, not helping readers. A pipeline that auto-publishes raw Gemini output every day is a textbook example. It can sink your search rankings and it is one of the most common reasons AdSense reviewers reject a blog as "low-value content."
The same pipeline that saves drafts is completely different. Google's position on AI content is that it is judged by quality, not by how it was made — I covered this in detail in Day 1 of this series. The draft is raw material; the published page is your reviewed, corrected, personalized work. Here is a simple comparison:
| Auto-publish pipeline | Auto-draft pipeline (mine) |
|---|---|
| Raw AI text goes live untouched | Human reviews, edits, adds real experience |
| Errors and hallucinations get published | Errors are caught before readers see them |
| Every post sounds the same | Your voice and examples stay in |
| High risk: spam policies, AdSense rejection | Compliant: AI-assisted, human-published |
My honest experience: the drafts are a starting point, not a finished product. Some days I keep the structure and rewrite most sentences. That editing time is the price of a blog that can actually be approved and trusted.
Practical Takeaway
Set up the pipeline this weekend — it takes under an hour. Let it feed you one draft per day. Then spend your writing time where it counts: checking facts, adding what only you know, and cutting the generic filler AI loves to produce. Automation should remove the blank page, not remove you. And if you are still choosing which AI tools to build your workflow around, my roundup of 10 free AI tools that actually save time in 2026 is a good place to start.
FAQ
Is the Gemini API really free to use?
Yes — Google AI Studio gives every account a free API key with daily usage limits, and no credit card is required for the free tier. A once-a-day blog pipeline stays far below those limits. Always confirm current quotas on Google's official pricing page, since they change.
Can Google Apps Script post to Blogger automatically?
Yes. Apps Script can call the official Blogger API v3 with your own account's permission (the OAuth scope shown above). You can create posts as drafts or published — this tutorial deliberately uses isDraft=true.
Will Google penalize AI-generated blog posts?
Not for being AI-generated — Google says it rewards high-quality content however it is produced. What gets penalized is scaled, unreviewed, low-value content. Review and edit every draft before publishing, and disclose AI assistance like I do in the footer below.
Do I need a server or hosting to run this?
No. Apps Script runs entirely on Google's infrastructure and time-driven triggers fire on their own. There is nothing to deploy, host, or pay for.

Join the conversation
Post a Comment