Migrate from Apify (Meta and Yelp ads actors)

Move Apify Facebook Ads Library and Yelp actor runs to /v1/ads/meta and /v1/ads/yelp, with input and output field mapping.
Open as Markdown
On this page

POST /v1/ads/meta and POST /v1/ads/yelp take an Apify actor's input JSON as the request body and return the dataset items as a JSON array, like Apify's run-sync-get-dataset-items call. There's no run to start, poll or fetch a dataset from.

Note:

Beta: both parsers were written from public documentation and haven't been checked against a live response yet.

1. Change the call

ApifyDataForGAIO
URLhttps://api.apify.com/v2/acts/<actor>/run-sync-get-dataset-itemshttps://api.dataforgaio.com/v1/ads/meta or /v1/ads/yelp
AuthApify tokenYour dg_ key: Bearer, X-API-Key or Basic
BodyActor input JSONThe same input JSON
ResponseJSON array of dataset itemsJSON array of dataset items, each with receipt_id

2. Meta ads

Input

Field names from the popular Facebook Ads Library actors are accepted:

FieldAliasesNotes
startUrlsurls[{"url": ...}] or strings. Ad Library URLs (facebook.com/ads/library/?q=...&country=..&ad_type=..&active_status=.., view_all_page_id=..., id=...), or a Facebook Page URL, which is searched by the page name.
searchTermssearchTerm, search_termsA keyword or a list of keywords.
countrycountryCode, scrapePageAds.countryCodeISO-2 code or ALL (default).
adTypead_typeALL (default) or POLITICAL_AND_ISSUE_ADS.
activeStatusscrapePageAds.activeStatusactive, inactive or all (default).
resultsLimitcount, maxItemsTotal ads, 1 to 5,000, default 100.
limitPerSourceAds per URL or search term.

Send at least one startUrls entry or search term.

cURL
curl -X POST "https://api.dataforgaio.com/v1/ads/meta" \
  -H "Authorization: Bearer $DATAFORGAIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "searchTerms": ["trail running shoes"],
    "country": "DE",
    "activeStatus": "active",
    "resultsLimit": 50
  }'

Output

Items follow the apify/facebook-ads-scraper item shape:

FieldNotes
adArchiveID / adArchiveIdThe Ad Library id (both spellings).
pageID / pageId, pageNameThe advertiser's page.
isActive, startDate, endDate, startDateFormatted, endDateFormattedDelivery dates as Unix seconds and formatted strings.
publisherPlatform["FACEBOOK", "INSTAGRAM", ...]
currency, spend, impressionsWithIndex.range, reachEstimateFilled where the Ad Library publishes them (EU-delivered and political or issue ads).
snapshotpageName, byline, body.text, title, caption, linkDescription, plus images, videos, cards, ctaText, which may be empty.
categories["POLITICAL"] for political and issue ads.
targetedOrReachedCountries, inputUrl, url
receipt_idOurs, on every item.

adId, collationCount and collationId are null.

Coverage: every ad delivered in the EU, and political or issue ads anywhere, come from the Ad Library's full records. Other ads come from the first page of public Ad Library results for each source, with fewer fields filled.

3. Yelp ads

Input

FieldAliasesNotes
searchTermssearch_terms, searchTermEach term runs in each location.
locationslocationRequired with searchTerms, e.g. "Austin, TX".
directUrlsstartUrlsYelp search URLs (yelp.com/search?find_desc=...&find_loc=...). Business pages aren't accepted.
searchLimitResults per search, 1 to 240, default 10.

Up to 50 searches (terms × locations, plus direct URLs) per request.

curl -X POST "https://api.dataforgaio.com/v1/ads/yelp" \
  -H "Authorization: Bearer $DATAFORGAIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["plumber"], "locations": ["Austin, TX"], "searchLimit": 20}'

Output

Items follow the common Yelp actor item: name, bizId, directUrl, address (addressLine1 filled; the rest null), neighborhoods, phone, aggregatedRating, reviewCount, priceRange, categories, primaryPhoto, plus:

FieldMeaning
isAd, sponsored, advertisertrue for paid placements.
positionOrder on the results page, ads included.
searchTerm, locationThe search that produced the row.
scrapeStartedAt, scrapeFinishedAtISO 8601 times for that search.
receipt_idOurs.

website, type, cuisine, claimed, verified, images and alternateNames are empty or null.

4. Pricing and errors

RoutePriceCache
/v1/ads/meta$0.00018 per ad returned ($0.18 per 1,000)6 hours
/v1/ads/yelp$0.00045 per result returned ($0.45 per 1,000), ads and organic rows alike6 hours
  • max_cost caps the number of items: "max_cost": 0.009 on Yelp returns at most 20 results.
  • auto_upgrade, max_level and max_age work as on other routes. Yelp usually needs a higher fetch level; the price per result doesn't change with the level.
  • The response has no cost field. The charge is on the receipt_id (each item, and the X-Receipt-Id header) in Dashboard → Billing.
  • Errors use Apify's body, {"error": {"type", "message", "receipt_id"}}, with HTTP 400 invalid-input (bad input, or no ads found), 401 user-or-token-not-found, 402 not-enough-usage-to-run-paid-actor, 429 rate-limit-exceeded, 500 internal-error. None are billed.

See POSTMeta Ad Library and POSTYelp Search Ads for every field.