Skip to main content

Scrape & analyse Meta Ad Library image ads with Apify and OpenAI

Workflow preview

Workflow preview
100%
Scrape & analyse Meta Ad Library image ads with Apify and OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Meta Image Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of image a...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.sort, n8n-nodes-base.filter, n8n-nodes-base.limit, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Daniel Setzermann.

Original n8n.io source

1.1 Workflow description

Title
Scrape & analyse Meta Ad Library image ads with Apify and OpenAI
Workflow name
Scrape & analyse Meta Ad Library image ads with Apify and OpenAI

Meta Image Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of image ads and organize the results in a structured format.

How it works

  • The workflow connects to Facebook's Ad Library to scrape image ads based on a specified page ID.
  • Images are filtered by reach and days running, then processed through OpenAI's GPT-4o to analyze their content.
  • Each image ad is systematically analyzed to extract key components: visual description, hook elements, main offer, call-to-action, and psychological triggers.
  • Results are processed through an AI agent that structures the data into standardized fields.
  • Original images are saved to Google Drive for reference.
  • All analysis and metadata are saved to a Google Sheet for easy access and further processing.

How to use Once you've set up your credentials and configured the output:

  • Enter the Meta Ad Library URL you want to analyze in the Settings node.
  • Adjust the maximum number of ads to scrape and analyze based on your needs (defaults: 300 to scrape, 10 to analyze).
  • Configure the Google Drive folder to save the original ad images.
  • Ensure your Google Sheets connection is set up to receive the structured analysis.
  • Click "Test Workflow" to start the analysis process.

Requirements

  • Apify account (for Meta Ad Library scraping)
  • OpenAI API key (for image analysis)
  • Google Drive and Google Sheets access

Customizing this workflow

  • Modify the AI prompts in the "Analyze Image Contents" node to extract different information from the images.
  • Adjust the output formats in the Structured Output Parser node.
  • Change the Google Sheets mapping to match your desired output structure.
  • Increase the number of ads analyzed for more comprehensive research.
  • Filter ads based on different criteria by modifying the "Filter only Image Ads" node.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Settings

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Clean Prompt

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Scrape Meta Ad Library with Apify

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Pass relevant Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Calculate Runtime in Days

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Sort by Reach or Days Running

Type / Role
n8n-nodes-base.sort - sort
Config choices
Version 1

Block 8 - Filter only Image Ads

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 9 - Limit Images to Analyze

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 10 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 11 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 12 - Download Image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Analyze Image Contents

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 14 - Save Image to Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 15 - Merge Data

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 16 - Store Data in Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 17 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Scrape & analyse Meta Ad Library image ads with Apify and OpenAI
Complexity advanced
Nodes 18
Categories Market Research, AI Summarization
Author Daniel Setzermann
Published 12 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4003/4003.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Scrape & analyse Meta Ad Library image ads with Apify and OpenAI do?

Meta Image Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of image a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI Summarization use case.