GET /v1/meta_ads/search_companies
Meta Ad Library advertiser search API: find a page id by brand name
Returns the Facebook Pages the Meta Ad Library suggests for a name as Account[], each with its page id as id and its category, Page likes and URL under extra. Send the name as query, then pass a page id to the Meta ads API for its ads.
- Price
- $0.0025 per call
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl 'https://api.virev.ai/v1/meta_ads/search_companies?query=Nike' \
-H "Authorization: Bearer $VIREV_API_KEY"import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/meta_ads/search_companies",
params={
"query": "Nike",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
query required | query | string | The words to search for, up to 500 characters. |
country | query | string | A two-letter country code, or ALL; omitted is US. |
cached | query | auto | cache_only | live | auto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts Meta Ads (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. |
get_raw | query | boolean | true returns the upstream JSON exactly as Meta Ads answered it instead of the normalized Account[]. |
Example response
The example response of the API reference, with lists cut to their first 3 items and long text shortened.
{
"data": [
{
"id": "15087023444",
"username": "nike",
"full_name": "Nike",
"is_verified": null,
"is_private": false,
"avatar_url": "https://scontent.fudi3-1.fna.fbcdn.net/v/t39.30808-1/284964043_10159903868513445_7696353984967674128_n.jpg?stp=dst-jpg_s100x100_tt6&_nc_cat=1&ccb=1-7&_nc_sid=418b77&_nc_ohc=mvC9EoMOIyUQ7kNvwGXxpu6&_nc_oc=AdqVpocJic-lF4TXAP3N9Q62-1oEwfZYsgny…",
"latest_story_at": null,
"extra": {
"category": "Sportswear Store",
"likes": 39494361,
"is_deleted": false,
"url": "https://www.facebook.com/nike"
}
},
{
"id": "51212153078",
"username": "nikefootball",
"full_name": "Nike Football",
"is_verified": null,
"is_private": false,
"avatar_url": "https://scontent.fudi3-1.fna.fbcdn.net/v/t39.30808-1/387181570_863325755161415_3589774989337788111_n.jpg?stp=dst-jpg_s100x100_tt6&_nc_cat=1&ccb=1-7&_nc_sid=418b77&_nc_ohc=YQ90KaPsflsQ7kNvwHgR1d8&_nc_oc=Ado5qwHnzRJ7U-prH4zaJQC8-sLhlujn1Yhdyf…",
"latest_story_at": null,
"extra": {
"category": "Product/service",
"likes": 39987860,
"is_deleted": false,
"url": "https://www.facebook.com/nikefootball"
}
}
],
"meta": {
"source": "live",
"fetched_at": "2026-10-27T22:38:34.492357+00:00",
"cost": "$0.0025",
"balance": "$49.9975",
"request_id": "req_c595979a2cd8f459c5ae9fe9dd104000"
}
}How it works
The Pages the Ad Library typeahead suggests for a name, each with its page_id as id; category, Page likes and the Page URL sit under extra. Returns Account[] under data, read from the Ad Library as a signed-out guest.
An ad answers as a Post: the copy is caption, the start is taken_at, likes, comments and views are null because the Ad Library shows no engagement, and Ad Library facts (the library URL, is_active, end_date, the CTA, the link, publisher_platforms, countries) sit under extra. An advertiser answers as an Account, with Page likes under extra.likes. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.
Billing: $0.0025 per call. A failed read is not charged.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the Meta Ads account or item does not exist (not_found). You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |