Migrate from Apify (Meta and Yelp ads actors)
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.
Beta: both parsers were written from public documentation and haven't been checked against a live response yet.
1. Change the call
| Apify | DataForGAIO | |
|---|---|---|
| URL | https://api.apify.com/v2/acts/<actor>/run-sync-get-dataset-items | https://api.dataforgaio.com/v1/ads/meta or /v1/ads/yelp |
| Auth | Apify token | Your dg_ key: Bearer, X-API-Key or Basic |
| Body | Actor input JSON | The same input JSON |
| Response | JSON array of dataset items | JSON array of dataset items, each with receipt_id |
2. Meta ads
Input
Field names from the popular Facebook Ads Library actors are accepted:
| Field | Aliases | Notes |
|---|---|---|
startUrls | urls | [{"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. |
searchTerms | searchTerm, search_terms | A keyword or a list of keywords. |
country | countryCode, scrapePageAds.countryCode | ISO-2 code or ALL (default). |
adType | ad_type | ALL (default) or POLITICAL_AND_ISSUE_ADS. |
activeStatus | scrapePageAds.activeStatus | active, inactive or all (default). |
resultsLimit | count, maxItems | Total ads, 1 to 5,000, default 100. |
limitPerSource | Ads per URL or search term. |
Send at least one startUrls entry or search term.
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
}'import os
import requests
res = requests.post(
"https://api.dataforgaio.com/v1/ads/meta",
headers={"Authorization": f"Bearer {os.environ['DATAFORGAIO_API_KEY']}"},
json={"searchTerms": ["trail running shoes"], "country": "DE", "activeStatus": "active", "resultsLimit": 50},
timeout=120,
)
ads = res.json()
for ad in ads:
print(ad["adArchiveID"], ad["pageName"], ad["isActive"], ad["snapshot"]["body"]["text"])
print("receipt:", res.headers.get("X-Receipt-Id"))Output
Items follow the apify/facebook-ads-scraper item shape:
| Field | Notes |
|---|---|
adArchiveID / adArchiveId | The Ad Library id (both spellings). |
pageID / pageId, pageName | The advertiser's page. |
isActive, startDate, endDate, startDateFormatted, endDateFormatted | Delivery dates as Unix seconds and formatted strings. |
publisherPlatform | ["FACEBOOK", "INSTAGRAM", ...] |
currency, spend, impressionsWithIndex.range, reachEstimate | Filled where the Ad Library publishes them (EU-delivered and political or issue ads). |
snapshot | pageName, 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_id | Ours, 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
| Field | Aliases | Notes |
|---|---|---|
searchTerms | search_terms, searchTerm | Each term runs in each location. |
locations | location | Required with searchTerms, e.g. "Austin, TX". |
directUrls | startUrls | Yelp search URLs (yelp.com/search?find_desc=...&find_loc=...). Business pages aren't accepted. |
searchLimit | Results 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:
| Field | Meaning |
|---|---|
isAd, sponsored, advertiser | true for paid placements. |
position | Order on the results page, ads included. |
searchTerm, location | The search that produced the row. |
scrapeStartedAt, scrapeFinishedAt | ISO 8601 times for that search. |
receipt_id | Ours. |
website, type, cuisine, claimed, verified, images and alternateNames are empty or null.
4. Pricing and errors
| Route | Price | Cache |
|---|---|---|
/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 alike | 6 hours |
max_costcaps the number of items:"max_cost": 0.009on Yelp returns at most 20 results.auto_upgrade,max_levelandmax_agework 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 theX-Receipt-Idheader) in Dashboard → Billing. - Errors use Apify's body,
{"error": {"type", "message", "receipt_id"}}, with HTTP 400invalid-input(bad input, or no ads found), 401user-or-token-not-found, 402not-enough-usage-to-run-paid-actor, 429rate-limit-exceeded, 500internal-error. None are billed.
See POSTMeta Ad Library and POSTYelp Search Ads for every field.