Home
Softono
tiktok-to-pinterest

tiktok-to-pinterest

Open source MIT
16
Stars
3
Forks
0
Issues
1
Watchers
2 weeks
Last Commit

About tiktok-to-pinterest

Auto-discover viral TikToks β†’ AI-generate Pinterest pin copy β†’ queue in Google Sheets. Built with n8n. Free tier only.

Platforms

Web Self-hosted

Links

🎬 TikTok β†’ Pinterest Automation

License: MIT n8n [Cost]() [Made with AI]()

Auto-discover viral TikToks β†’ AI-generate Pinterest pin copy β†’ queue in Google Sheets for review. Built with n8n. Free tier only β€” $0/month. Workflow architecture A single n8n workflow that scrapes TikTok by keyword, filters for viral content, downloads watermark-free HD videos, uploads them to Google Drive, generates SEO-optimized Pinterest titles + descriptions with AI, and writes everything to a Google Sheet for manual review.


✨ What it does

flowchart LR
    A["Chat / Schedule Trigger"]
        --> B["Apify TikTok Scraper"]

    B --> C["Normalize + Filter Slideshows"]

    C --> D{"Views β‰₯ 100k<br>Shares β‰₯ 100?"}

    D -- Yes --> E["Dedup vs Sheet"]
    D -- No --> X["Skip"]

    E --> F["Limit Top 3"]
    F --> G["tikwm.com HD Download"]
    G --> H["Upload to Google Drive"]
    H --> I["AI Agent: Generate Pin Copy"]
    I --> J["Append to Google Sheet"]
    J --> K["You review + post manually"]
  • πŸ” Keyword-driven discovery β€” type slow living or anime amv and the workflow finds top-performing TikToks
  • πŸ“₯ Watermark-free HD downloads β€” uses tikwm.com to fetch the original-quality video without TikTok logos
  • 🎨 Photo slideshow filter β€” automatically rejects TikTok carousels (image-only posts) so you only get real video
  • πŸ€– AI-generated pin copy β€” Pinterest-optimized titles + descriptions with SEO hashtags
  • πŸ“Š Google Sheets review queue β€” manual approval before posting (Pinterest API integration optional)
  • 🌐 Two entry points β€” run on a schedule OR trigger manually via chat with a custom keyword

πŸ› οΈ Tech stack

Tool Purpose Cost
n8n Workflow orchestrator Free (self-host or Cloud trial)
Apify TikTok scraper Free credits (~$5/mo)
tikwm.com HD video download Free, no key
Google Drive Video storage Free 15 GB
Google Sheets Review queue Free
Groq AI title/description (recommended) Free tier (generous)
OpenRouter AI fallback Free models available

πŸš€ Quick start

  1. Clone this repo git clone https://github.com/mehdreaming/tiktok-to-pinterest.git
  2. Install n8n (Docker) docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n docker.n8n.io/n8nio/n8n
  3. Open http://localhost:5678 β†’ import "TikTok β†’ Pinterest.json"
  4. Add credentials (see API setup below)
  5. Hit "Execute Workflow" β†’ type a keyword in chat β†’ check your Google Sheet

πŸ“‹ Prerequisites

You need accounts on 5 services (all free):

  1. n8n β€” n8n Cloud (14-day trial) or self-host via Docker
  2. Apify β€” for TikTok scraping
  3. Google Cloud project β€” for Drive + Sheets OAuth
  4. Groq β€” for AI text generation (recommended)
  5. OpenRouter β€” alternative AI provider (optional)

πŸ”‘ How to get each API key

1️⃣ Apify (TikTok Scraper)

Click to expand step-by-step
  1. Go to apify.com β†’ Sign up (free)
  2. Once logged in, click your profile (top right) β†’ Settings
  3. Click Integrations in the sidebar
  4. Under Personal API tokens, click Create new token
  5. Name it n8n β†’ click Create
  6. Copy the token β€” it looks like apify_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  7. ⚠️ Save it now β€” you can't view it again

Also set up the TikTok scraper actor:

  1. Go to apify.com/clockworks/tiktok-scraper
  2. Click Try for free to add it to your account
  3. Free tier gives you ~$5/month in credits = ~500 free scrapes

2️⃣ Google Cloud (Drive + Sheets OAuth)

Click to expand step-by-step

Create a Google Cloud project

  1. Go to console.cloud.google.com
  2. Click Select a project (top bar) β†’ New Project
  3. Name it tiktok-pinterest-n8n β†’ Create

Enable the APIs

  1. With the project selected, go to APIs & Services β†’ Library
  2. Search and enable each of these:
    • Google Drive API β†’ click β†’ Enable
    • Google Sheets API β†’ click β†’ Enable

Configure OAuth consent screen

  1. Go to APIs & Services β†’ OAuth consent screen
  2. Select External β†’ Create
  3. Fill in:
    • App name: n8n-tiktok-pinterest
    • User support email: your email
    • Developer contact: your email
  4. Save and Continue through Scopes, Test Users, Summary
  5. Add your own Google email as a Test User
  6. Back to Dashboard

Create OAuth credentials

  1. Go to APIs & Services β†’ Credentials
  2. Click + Create Credentials β†’ OAuth client ID
  3. Application type: Web application
  4. Name: n8n-oauth
  5. Authorized redirect URIs: add this exact URL (for n8n Cloud): https://YOUR-N8N-SUBDOMAIN.app.n8n.cloud/rest/oauth2-credential/callback (For self-hosted: http://localhost:5678/rest/oauth2-credential/callback)
  6. Create β†’ copy the Client ID and Client Secret

Create your Google Sheet

  1. Go to sheets.google.com β†’ create a new sheet
  2. Name it Pinterest Queue
  3. Add these column headers in Row 1:
    timestamp | keyword | tiktok_url | views | shares | duration | drive_file_id | drive_url | pin_title | pin_description | status
  4. Copy the Sheet ID from the URL: docs.google.com/spreadsheets/d/SHEET_ID_HERE/edit

Create your Google Drive folder

  1. Go to drive.google.com β†’ New β†’ Folder
  2. Name it TikTok Pins
  3. Open the folder β†’ Copy the Folder ID from the URL: drive.google.com/drive/folders/FOLDER_ID_HERE

3️⃣ Groq (AI text generation β€” recommended)

Click to expand step-by-step

Groq has the most generous free tier β€” way more requests/day than OpenRouter's free tier.

  1. Go to console.groq.com β†’ Sign up (Google login works)
  2. Once in, click API Keys in the left sidebar
  3. Click Create API Key
  4. Name it n8n β†’ Submit
  5. Copy the key β€” looks like gsk_xxxxxxxxxxxxxxxxxxxxxxxxxx
  6. ⚠️ Save it now β€” you can't view it again

Recommended model: llama-3.3-70b-versatile (best quality, free tier handles ~14,400 requests/day).

4️⃣ OpenRouter (alternative AI provider)

Click to expand step-by-step

Use this if Groq runs out or you want DeepSeek instead of Llama.

  1. Go to openrouter.ai β†’ Sign in with Google
  2. Click your profile (top right) β†’ Keys
  3. Click + Create Key
  4. Name it n8n β†’ Create
  5. Copy the key β€” looks like sk-or-v1-xxxxxxxxxxxxxxxxx

Free models available:

  • deepseek/deepseek-chat-v3.1:free
  • meta-llama/llama-3.1-8b-instruct:free
  • google/gemini-2.0-flash-exp:free

βš™οΈ n8n setup

Step 1: Install n8n

Option A β€” Docker (recommended for self-host): docker run -it --rm \ --name n8n \ -p 5678:5678 \ -v ~/.n8n:/home/node/.n8n \ docker.n8n.io/n8nio/n8n Open http://localhost:5678.

Option B β€” n8n Cloud:

  1. Go to n8n.io β†’ start free trial
  2. Note your subdomain: https://YOUR-SUBDOMAIN.app.n8n.cloud

Step 2: Import the workflow

  1. In n8n, click Workflows (left sidebar)
  2. Click Add workflow β†’ Import from file
  3. Select TikTok β†’ Pinterest.json from this repo
  4. Click Import

Step 3: Add credentials in n8n

Go to Credentials β†’ New and create each one:

A. Apify (HTTP Header Auth)

  • Credential type: HTTP Header Auth
  • Name: Apify
  • Header Name: Authorization
  • Header Value: Bearer YOUR_APIFY_TOKEN

B. Google Drive (OAuth2)

  • Credential type: Google Drive OAuth2 API
  • Client ID: paste from Google Cloud
  • Client Secret: paste from Google Cloud
  • Click Sign in with Google β†’ authorize your test user account

C. Google Sheets (OAuth2)

  • Credential type: Google Sheets OAuth2 API
  • Use the same Client ID + Secret as above
  • Click Sign in with Google β†’ authorize

D. Groq (AI)

  • Credential type: Groq API
  • API Key: paste your Groq key

E. OpenRouter (AI, optional)

  • Credential type: OpenAI API (compatible)
  • API Key: paste your OpenRouter key
  • Base URL: https://openrouter.ai/api/v1

Step 4: Wire credentials into the workflow

Open the imported workflow and update these nodes:

Node What to set
Apify HTTP node Credential: Apify
Get Existing URLs (Sheets) Credential: Google Sheets Β· Document: paste your Sheet ID
Drive Upload Credential: Google Drive Β· Parent Folder: paste your Folder ID
AI Agent β†’ Chat Model Credential: Groq Β· Model: llama-3.3-70b-versatile
Append row in sheet Credential: Google Sheets Β· Document: paste your Sheet ID

Step 5: Test it

  1. Click Open Chat (or Execute Workflow with the chat trigger)
  2. Type a keyword: slow living routine or anime amv
  3. Wait ~30-60 seconds
  4. Check your Google Sheet β€” you should see 3 new rows with AI-generated copy 🎬

πŸŽ›οΈ Configuration

Customize these values in the workflow nodes:

Filter thresholds (Filter node)

$json.views >= 100000 // minimum views $json.shares >= 100 // minimum shares $json.duration between 7 and 60 // seconds Tweak these per niche. Anime content typically has lower share counts than lifestyle.

Scheduled keyword rotation (Set Schedule Keyword node)

= ['anime amv','studio ghibli','anime aesthetic','anime edit','manga panel','anime scenery','anime soundtrack'][$now.weekday - 1] Map any 7 keywords to days of the week for automated daily runs.

AI tone (AI Agent system prompt)

Customize the system message to match your brand voice:

  • Lifestyle: warm, slow, intentional
  • Anime: cinematic, poetic, film-critic
  • Recipes: hook-driven, hashtag-heavy

πŸ”₯ Common errors & fixes

TikTok CDN 403 Forbidden

Add these headers to the HTTP Request1 node: Referer: https://www.tiktok.com/ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Workflow returns audio-only (no video)

The keyword is matching TikTok photo slideshows. The Normalize node has a built-in filter that skips slideshows β€” make sure you're using the latest version of the Code node. Use video-heavy keywords like anime amv, studio ghibli, cozy routine. Avoid manga panel, anime quote (mostly slideshows).

AI returns markdown-wrapped JSON

The "Clean JSON" code node strips ```json fences automatically. Also add "respond with pure JSON only β€” no markdown, no code fences" to the system prompt.

OpenRouter "Data limit reached"

Free models have daily token caps. Switch to Groq (much higher free tier) or rotate between providers. Recommended: llama-3.3-70b-versatile on Groq.

Drive upload "File not found"

The HTTP Request1 node must have Response Format = File and Binary Property Name = data. Both must match the Drive Upload's input field name.

Google OAuth "redirect_uri_mismatch"

The redirect URI in Google Cloud Console must EXACTLY match n8n's callback URL. For n8n Cloud: https://YOUR-SUBDOMAIN.app.n8n.cloud/rest/oauth2-credential/callback. No trailing slash.


πŸ—ΊοΈ Roadmap

  • πŸ”œ Pinterest API integration β€” auto-post approved rows
  • πŸ”œ yt-dlp fallback β€” for blocked downloads
  • πŸ’‘ AI cover thumbnail generation β€” better Pinterest CTR
  • πŸ’‘ Telegram/Slack error alerts β€” notify on workflow failures
  • πŸ’‘ Local Ollama integration β€” truly $0 AI cost
  • πŸ’‘ Semantic deduplication β€” similar-video detection (not just exact URL match)

πŸ”œ = next up Β· πŸ’‘ = future ideas Β· PRs welcome on any of these


πŸ“‚ Repo structure

.
β”œβ”€β”€ TikTok-to-Pinterest.json   # Importable n8n workflow
β”œβ”€β”€ workflow.png               # Workflow architecture screenshot
β”œβ”€β”€ LICENSE                    # MIT License
β”œβ”€β”€ README.md                  # Project documentation
└── .gitignore                 # Ignore unnecessary files

🀝 Contributing

PRs welcome! Particularly interested in:

  • New niche-specific AI prompts
  • Cover image generation nodes
  • Pinterest API auto-post implementation
  • yt-dlp Docker integration

Open an issue first if you're building anything substantial β€” let's chat about it.


πŸ“œ License

MIT β€” do whatever you want with this. Attribution appreciated but not required.


🌐 Connect

Built by @mehdreaming

  • 🐦 X / Twitter: @mehdreaming β€” automation builds + dev logs
  • πŸ€– Reddit: u/mehdreaming β€” n8n + creator tools discussion
  • πŸ’Ό Open to collabs on automation + creator tools

If this saved you time, drop a ⭐ on the repo β€” it really helps.


Built with n8n, Apify, Groq, and a lot of coffee β˜•