Facebook Search Scraper avatar

Facebook Search Scraper

Pricing

from $5.00 / 1,000 result founds

Go to Apify Store
Facebook Search Scraper

Facebook Search Scraper

Search Facebook by keyword across Events, Marketplace and the Ad Library (ads and advertisers) in one Actor. No login or cookies needed.

Pricing

from $5.00 / 1,000 result founds

Rating

0.0

(0)

Developer

Khadin Akbar

Khadin Akbar

Maintained by Community

Actor stats

0

Bookmarked

6

Total users

3

Monthly active users

8 days ago

Last modified

Share

What is Facebook Search Scraper?

Facebook Search Scraper is an Apify Actor for keyword search across Facebook Events, Marketplace, and the Ad Library, including ads and advertisers, from one run. It accepts a plain-text keyword in query, plus optional surface-specific filters, and returns one normalized record per result. Each record can include a title, URL, image, dates, location, pricing, page details, ad creative data, and provider metadata so you can route the output into analysis, enrichment, or follow-up scraping. It is usable through Apify MCP and works without Facebook login or cookies.

Best fit and connected workflows

Use this actor when a workflow starts with a keyword and ends with a structured set of Facebook records:

  • Keyword-based ad discovery in the public Ad Library, then deeper detail work with Facebook Ads Library Scraper.
  • Event discovery by topic and place, then engagement review with Facebook Post Comments Scraper when a returned public URL or ID suits a comment-focused follow-up.
  • Marketplace discovery anchored to a city or place, then manual review of price, delivery, and location fields.
  • AI-agent workflows that need one Apify tool call to search multiple Facebook surfaces without login or cookies.

This Actor is a strong routing step when you want discovery first and detail extraction second. The output keeps the surface type explicit, which makes downstream branching straightforward.

Example scenario

Maya, a marketing analyst, starts with the keyword electric bike. She sets searchType to ads and country to US to focus the Ad Library search. The actor returns records with fields such as title, pageName, adArchiveId, isActive, startDate, ctaText, linkUrl, adText, and displayFormat.

From those fields, Maya can quickly identify which advertiser pages are active, which ad creatives mention a relevant offer, and which landing pages are tied to the ads. Her next action is to open the most relevant result in a follow-up workflow, then pass the returned URL or ID into a detail scraper.

Input fields

FieldTypeRequiredDefaultPurpose
querystringYes-Plain keyword to search Facebook for. Use text such as coffee festival, Nike, or electric bike.
searchTypestringNoadsChooses the Facebook surface: ads, advertisers, events, or marketplace.
maxResultsintegerNo50Maximum number of results to return and charge for. Range: 1 to 500.
locationstringNoAustin, TXMarketplace anchor place. Used only when searchType is marketplace.
countrystringNo-Two-letter country code for Ad Library results. Used only for ads and advertisers.
adStatusstringNoACTIVEAd Library ad status filter: ACTIVE, INACTIVE, or ALL. Used only for ads.
adTypestringNoALLAd Library ad type filter: ALL or POLITICAL_AND_ISSUE_ADS. Used only for ads.
fallbackProviderstringNoautoProvider routing: the routing options listed in the input schema.

Focused input example

{
"query": "electric bike",
"searchType": "ads",
"country": "US",
"adStatus": "ACTIVE",
"adType": "ALL",
"maxResults": 25,
"fallbackProvider": "auto"
}

Output fields

Each dataset item is one search result. Fields are populated according to the surface that produced the record.

FieldTypeMeaning
searchTypestringSurface that produced the result.
resultTypestringRecord kind such as event, marketplaceListing, ad, or advertiser.
querystringKeyword used in the search.
positioninteger1-based rank in the run.
idstring or nullFacebook object ID.
urlstring or nullCanonical Facebook URL.
titlestring or nullDisplay name for the result.
imageUrlstring or nullPrimary image or cover photo.
startTimestring or nullEvent start time in ISO 8601 format.
startTimestampinteger or nullEvent start timestamp in seconds.
dateTextstring or nullHuman-readable event date text.
placeNamestring or nullEvent venue or place.
isOnlineboolean or nullWhether the event is online.
isPastboolean or nullWhether the event has already happened.
interestedCountinteger or nullEvent interest count.
goingCountinteger or nullEvent going count.
priceTextstring or nullMarketplace price or event ticket price text.
pricenumber or nullMarketplace numeric price.
citystring or nullMarketplace city.
statestring or nullMarketplace state or region.
locationNamestring or nullMarketplace display location.
isSoldboolean or nullMarketplace sold status.
deliveryTypesarrayMarketplace delivery or pickup options.
pageNamestring or nullAd or advertiser page name.
pageIdstring or nullAd or advertiser page ID.
adArchiveIdstring or nullAd Library archive ID.
isActiveboolean or nullWhether the ad is currently running.
startDatestring or nullAd start date in ISO 8601 format.
endDatestring or nullAd end date in ISO 8601 format.
ctaTextstring or nullAd call-to-action label.
ctaTypestring or nullAd call-to-action type code.
linkUrlstring or nullAd landing page URL.
adTextstring or nullPrimary ad copy.
displayFormatstring or nullAd creative format.
pageCategoriesarrayAd page categories.
categorystring or nullAdvertiser page category.
likesinteger or nullAdvertiser page like count.
verificationstring or nullAdvertiser verification status.
igUsernamestring or nullLinked Instagram username.
igFollowersinteger or nullLinked Instagram follower count.
pageAliasstring or nullPage vanity handle.
countrystring or nullAdvertiser page country.
scrapeSourcestringManaged provider that returned the record.
scrapedAtstringISO 8601 timestamp when the record was emitted.

Illustrative output record

{
"searchType": "ads",
"resultType": "ad",
"query": "electric bike",
"position": 1,
"id": "1378176106734781",
"adArchiveId": "1378176106734781",
"url": "https://www.facebook.com/ads/library/?id=1378176106734781",
"title": "Summer Sale - 40% Off E-Bikes",
"imageUrl": "https://scontent.xx.fbcdn.net/example.jpg",
"pageName": "VoltRide",
"pageId": "119749581219299",
"isActive": true,
"startDate": "2026-05-01T00:00:00.000Z",
"ctaText": "Shop now",
"ctaType": "SHOP_NOW",
"linkUrl": "https://voltride.com/summer",
"adText": "Ride further for less...",
"displayFormat": "IMAGE",
"pageCategories": ["Sporting goods"],
"scrapedAt": "2026-07-01T12:00:00.000Z"
}

How it works

The actor is provider-backed and cookieless. It routes each searchType to the correct managed data provider:

  • ads and advertisers use the public Ad Library.
  • events finds public events.
  • marketplace finds for-sale listings and resolves the supplied location to coordinates.

The actor paginates until it reaches maxResults or the provider returns no more results. Output is normalized into a flat dataset schema so different surfaces can be processed together. The live contract also defines soft-fail validation, honest-fail behavior on provider outage, and safe dataset writes. Provider routing is controlled with fallbackProvider, where auto tries a primary data provider first, then a fallback provider; Events search uses the primary data provider.

Pricing

This actor uses Pay per event with Apify platform usage on top. The charging model includes a small run-start event and a per-result event for each returned search result. Open the live Pricing tab on the actor page to review the current rates before running.

As an example, a run that returns fifty results is charged as fifty result events plus the run-start event. A shorter run with ten returned results is charged for ten result events plus the run-start event.

Use with AI agents (MCP)

This Actor is usable through Apify MCP as a tool for keyword-based Facebook search. The precise tool behavior is: accept a keyword plus a Facebook surface selector, return normalized records, and preserve scrapeSource, scrapedAt, and the surface-specific fields so the agent can inspect, rank, and route results into follow-up steps.

Actor identity: khadinakbar/facebook-search-scraper

Search Facebook for the keyword "coffee festival" on the Events surface. Return up to 10 records. Summarize the most relevant fields for each result and note which returned URL or ID could be used in a follow-up workflow.

Output interpretation:

  • resultType tells the agent whether the record is an event, marketplace listing, ad, or advertiser.
  • scrapeSource shows which managed provider returned the item.
  • position reflects rank within the run.
  • url and id are the safest references for downstream steps.
  • Event fields such as startTime, placeName, interestedCount, and goingCount are event-specific.
  • Ad fields such as pageName, adArchiveId, ctaText, linkUrl, and displayFormat are ad-specific.
  • maxResults controls how many records are paged and charged.
  • If the configured route starts with the primary data provider and a different provider is needed for ads or advertisers, fallbackProvider: "auto" can route through the available managed providers. Events search uses the primary data provider.
  • The normalized dataset format makes it straightforward for an agent to pick a returned url or id and continue with a downstream workflow.

Apify API example

import { ApifyClient } from "apify-client";
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
const input = {
query: "electric bike",
searchType: "ads",
country: "US",
maxResults: 10,
fallbackProvider: "auto",
};
const run = await client.actor("khadinakbar/facebook-search-scraper").call(input);
const dataset = await client.dataset(run.defaultDatasetId).listItems({ clean: true });
console.log(dataset.items);

Best results and outcome guidance

Use a plain keyword that matches the Facebook surface you want to inspect.

  • For ads, pair query with country, adStatus, and adType when you want a narrower Ad Library slice.
  • For events, keep the keyword close to the event topic and read startTime, dateText, placeName, and attendance counts together.
  • For Marketplace, supply a real place in location so the listing search can anchor results geographically.
  • For advertisers, treat pageName, category, likes, verification, igUsername, and country as the main summary fields.
  • Keep maxResults aligned with the size of the workflow stage. Use a smaller number for quick discovery and a larger number when you plan to review more returned records.
  • Use url or id as the handoff to downstream scrapers or manual review.

Continue the workflow

Design note

I found that the dataset contract keeps searchType, resultType, query, position, scrapeSource, and scrapedAt as required fields. That means every emitted record carries the surface, ranking, source, and emission time even when optional surface-specific fields stay empty.

FAQ

It searches Events, Marketplace, Ad Library ads, and Ad Library advertisers by keyword.

When should I use searchType: "ads" versus searchType: "advertisers"?

Use ads when you want individual ad creatives with copy, CTA, landing URL, and run dates. Use advertisers when you want advertiser pages with page-level metadata such as category, likes, verification, and Instagram linkage.

What should I pass in location?

Pass a city or place name such as Austin, TX or London, UK. The actor uses it to anchor Marketplace listings.

How do I route from discovery to detail scraping?

Use the returned url or id from this actor, then pass that record into a downstream workflow such as Facebook Ads Library Scraper or Facebook Post Comments Scraper when the follow-up actor accepts the returned Facebook reference.

How does fallbackProvider affect routing?

auto tries a primary data provider first, then a fallback provider for supported surfaces. You can also select one provider directly. Events search uses the primary data provider.

Responsible use

Use the actor in line with Facebook's public surface access, Apify's terms, and applicable laws. This actor works without login and targets public keyword-searchable surfaces only. Review the live Pricing tab before running larger searches, and keep maxResults sized to the actual workflow need.