You need to programmatically find Facebook Pages by keyword and return the page URL, name, image, and whether it’s verified. By the end of this guide, you’ll ship a working integration that searches Facebook Pages (plus optional Events and Videos) using a single API key from Zyla API Hub and copy-pasteable code.
What this API gives you
The Facebook Scraper API exposes keyword search across Facebook content. From the data shown below, you can:
- Search Pages by a text query and get back a list of matching pages with URLs, names, IDs, and verification flags.
- Search Events by keyword and receive event IDs, titles, and URLs, plus an optional cursor string in the response.
- Search Videos by keyword and retrieve video IDs, URLs, metadata (title/description), author, thumbnail, and view/time text.
This is useful for brand monitoring, lead qualification, editorial research, and automated sourcing. It runs under a single Zyla account and API key; the subscription is quota-based (not pay-per-call). For the first API you try, you can start with a 7-day trial or 50 requests—check the API page for current access options and pricing.
Getting started on Zyla API Hub
Zyla API Hub is an API marketplace with more than 10,000 public APIs. One account, one API key, one subscription model. Visit the API listing, click Subscribe (or Start 7-day trial when available), and your API key is ready to use across endpoints.
- Open the listing: Start 7-day trial on Facebook Scraper API
- Click Subscribe or Start Free Trial if shown.
- Copy your key and send it as Authorization: Bearer YOUR_API_KEY.
You can also explore other categories on Zyla API Hub with the same account and key format.
Endpoint: Search Pages
Retrieve Facebook pages matching a search query.
- Method: GET
- URL: https://zylalabs.com/api/11904/facebook-scraper-api/22640/search-pages
- Required query parameter:
- query (string): the search term, e.g., messi
- Auth header: Authorization: Bearer YOUR_API_KEY
cURL you can paste
curl -s -X GET "https://zylalabs.com/api/11904/facebook-scraper-api/22610/profile-details-by-url?url=https%3A%2F%2Fwww.facebook.com%2Fzuck%2F" \
-H "Authorization: Bearer YOUR_API_KEY"
Official example response
{"results":[{"type":"page","profile_url":"https://www.facebook.com/people/Messi/61575483092973/","url":"https://www.facebook.com/people/Messi/61575483092973/","image":{"uri":"https://scontent-los4-1.xx.fbcdn.net/v/t39.30808-1/658173307_122096915972849436_352065376866915770_n.png?stp=dst-png_s120x120&_nc_cat=100&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=Q6GhRcSBlJEQ7kNvwGaGcET&_nc_oc=AdqhrcXMJrRNvPcOqNSazryCVdHytKU23AZJftlymsoAz5L-SLjyIyje1SH1UgAk1ww&_nc_zt=24&_nc_ht=scontent-los4-1.xx&_nc_gid=nONdBaRLdDt8MKTsEq-zFA&_nc_ss=7f180&oh=00_AQD2pz1mHUD7t0Y2DbY5dazGLupDbOuQURnRVV7-FlOWLg&oe=6A5D73A9","width":120,"height":120,"scale":2},"name":"Messi","facebook_id":"61575483092973","is_verified":false},{"type":"page","profile_url":"https://www.facebook.com/people/Messi/61573475127128/","url":"https://www.facebook.com/people/Messi/61573475127128/","image":{"uri":"https://scontent-los4-1.xx.fbcdn.net/v/t39.30808-1/662156613_122095171862782504_7840790257873569794_n.png?stp=dst-png_s120x120&_nc_cat=102&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=fBjMrUIZnSIQ7kNvwEnISn0&_nc_oc=Adp3aMvZds0t7Nkn0ONKaESKkhwLXNJ_Hqi_r2sXdpOodC9UNEGU40F-p_pRlzggoK8&_nc_zt=24&_nc_ht=scontent-los4-1.xx&_nc_gid=nONdBaRLdDt8MKTsEq-zFA&_nc_ss=7f…
What you’ll typically use from each result:
- type: "page" confirms the item type.
- name: the page’s display name.
- url and profile_url: direct links to the Facebook page.
- facebook_id: stable page identifier you can store in your DB for de-duplication and future refreshes.
- is_verified: boolean to prioritize official pages in your workflow.
- image.uri with width/height/scale: a usable avatar/thumbnail for UI.
Python example: extract Page URLs, IDs, and verification
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
url = "https://zylalabs.com/api/11904/facebook-scraper-api/22640/search-pages"
params = {"query": "messi"}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=30)
resp.raise_for_status()
data = resp.json()
pages = []
for item in data.get("results", []):
if item.get("type") == "page":
pages.append({
"name": item.get("name"),
"url": item.get("url"),
"facebook_id": item.get("facebook_id"),
"is_verified": item.get("is_verified", False),
"image_uri": (item.get("image") or {}).get("uri")
})
for p in pages:
print(f"{p['name']} ({'verified' if p['is_verified'] else 'unverified'}) - {p['url']} - id={p['facebook_id']}")
Other available searches you can chain
In the same Facebook Scraper API, you can optionally search Events and Videos by keyword. These are separate endpoints that complement a Page search in many workflows (e.g., show related events or top videos after a page search).
Endpoint: Search Events
- Method: GET
- URL: https://zylalabs.com/api/11904/facebook-scraper-api/22642/search-events
- Required query parameter:
- query (string): the search term, e.g., beer
- Auth header: Authorization: Bearer YOUR_API_KEY
Example response:
{"results":[{"type":"search_event","event_id":"1469174158547978","title":"Beer Fest 2026","url":"https://www.facebook.com/events/1469174158547978/"},{"type":"search_event","event_id":"1390316932482970","title":"Beer Festival ","url":"https://www.facebook.com/events/1390316932482970/"},{"type":"search_event","event_id":"1950990155494535","title":"Beer Con 1","url":"https://www.facebook.com/events/1950990155494535/"},{"type":"search_event","event_id":"1382265020274853","title":"EASTER BEER FEST","url":"https://www.facebook.com/events/1382265020274853/"},{"type":"search_event","event_id":"1157579969421529","title":"Beer21","url":"https://www.facebook.com/events/1157579969421529/"},{"type":"search_event","event_id":"1772093293614143","title":"Wicken Beer Festival","url":"https://www.facebook.com/events/1772093293614143/"},{"type":"search_event","event_id":"1747992505827558","title":"Beer Festival ","url":"https://www.facebook.com/events/1747992505827558/"}],"cursor":"{\"page_number\": 0, \"flow_cursors_serialized\": {\"INTERNAL_DEBUG_MODULE\": \"{}\", \"SEARCH_CONTROLS_INTERCEPT\": \"{}\", \"INTEGRITY\": \"{\\\"has_more_results\\\":false,\\\"processed_unicorn_ids\\\":[],\\\"is_end_of_s…
You’ll primarily use: type, event_id, title, url. A cursor string may be present in the response; store it alongside the results if you intend to maintain continuity between fetches.
Endpoint: Search Videos
- Method: GET
- URL: https://zylalabs.com/api/11904/facebook-scraper-api/22641/search-videos
- Required query parameter:
- query (string): the search term, e.g., football
- Auth header: Authorization: Bearer YOUR_API_KEY
Example response (excerpt):
{"results":[{"type":"search_video","video_id":"791498386713336","video_url":"https://www.facebook.com/reel/791498386713336/","description":"هدف عالمي للموهبة الرجاوية يحيا ايغيز ⭐️🟢🔥\n#الرجاء #الوداد #الماص #بركان #البطولة_المغربية #raja #widad #football #botola","title":"هدف عالمي للموهبة الرجاوية يحيا ايغيز ⭐️🟢🔥 #الرجاء #الوداد #الماص #بركان #البطولة_المغربية #raja #widad #football #botola","author":{"__typename":"User","__isActor":"User","name":"البطولة آنفو","url":"https://www.facebook.com/people/%D8%A7%D9%84%D8%A8%D8%B7%D9%88%D9%84%D8%A9-%D8%A2%D9%86%D9%81%D9%88/100083047823362/","is_verified":false,"id":"100083047823362"},"thumbnail":"https://scontent.fcai19-12.fna.fbcdn.net/v/t15.5256-10/640676129_921391920397606_2677953042354722746_n.jpg?stp=c0.289.720.403a_dst-jpg_s403x403_tt6&_nc_cat=101&ccb=1-7&_nc_sid=e3495b&_nc_ohc=NqrODWPm42UQ7kNvwHU-l1v&_nc_oc=AdkqfKKczR7ZPdaimVUPWio4jBwWw-WHtdodtW8x6NwzQ3WGuQpNpaJI66duMtZB-Rw&_nc_zt=23&_nc_ht=scontent.fcai19-12.fna&_nc_gid=zQWYTQNV7ow0DaMz9wXpBQ&oh=00_AfuAU2U6GEx1XQ4qJwpWczx_ubFqkrwSKA3OtveP0piWtw&oe=69A1B51B","time_and_views_raw":"3 hours ago · 3.3K views"},{"type":"search_video","video_id":"1245009567733383","video_url":"htt…
Key fields to consume: type, video_id, video_url, title, description, author.name/author.url/author.is_verified, thumbnail, and time_and_views_raw for lightweight UI badges.
Official sample: Profile Details by URL
The listing also provides an example call that resolves a Facebook profile by URL. This is useful when you already have a profile link and need structured details.
{"profile":{"name":"Mark Zuckerberg","profile_id":"4","url":"https://www.facebook.com/zuck","image":"https://scontent-atl3-2.xx.fbcdn.net/v/t39.30808-1/632598281_10117314650513371_3238643608998008744_n.jpg?stp=dst-jpg_s480x480_tt6&_nc_cat=105&ccb=1-7&_nc_sid=1d2534&_nc_ohc=LjkvEg7sdw8Q7kNvwEaPsox&_nc_oc=AdmCdyxSpDASES67Y_gDG38HAgX4jHJmTVIhvvCWNAPvPyv-pT2MkqAPjlQhPbHwWrY8uW9gqGX2G_SqONA9jbku&_nc_zt=24&_nc_ht=scontent-atl3-2.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_Aft5Pz5CRJir2D9RSDB9DHeDE2DgVFClZFvg3B_3N3-Rdg&oe=69A18B0B","intro":"Bringing the world closer together.","cover_image":"https://scontent-atl3-3.xx.fbcdn.net/v/t39.30808-6/632550896_10117314656231911_7975049830116595629_n.png?_nc_cat=110&ccb=1-7&_nc_sid=2a1932&_nc_ohc=MK0GxxJ3MnAQ7kNvwGa91zk&_nc_oc=AdkYRmT5nQE8Wy7rtQIQVcsAFZpf2O-AfWgQayQistV8orDCmh3HHLcV1wyBGJ4MhxNmm_SjaJsm_Fhj0K4dUZng&_nc_zt=23&_nc_ht=scontent-atl3-3.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_AfvWwbUzfWNcxPpMjaQEicKtpNeAHrXk8D1zfpIjowyKEw&oe=69A17D22","gender":"MALE","about":{},"about_public":[{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nS7-NxdkDDt.png","width":40},"text":"Profile · Public figure","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Founder and CEO at Meta","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Works at Biohub","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nDxCDAeszOF.png","width":40},"text":"Studied Computer Science and Psychology at Harvard University","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yA/r/bStXkZOl3Ha.png","width":40},"text":"Lives in Palo Alto, California","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yh/r/k7egJAGHjmH.png","width":40},"text":"From Dobbs Ferry, New York","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yk/r/exk40A1bzjc.png","width":40},"text":"Married to Priscilla Chan","external_url":null}],"verified":true,"delegate_page_id":null,"reels_profile_id":"YXBwX2NvbGxlY3Rpb246cGZiaWQwUHlEa0Y2ZnV0NlFXdjhtS2NlNDR6dnp3OUJ5TnlXOVZXanNmM2hiWjJ1OXZ6cGVzQmh4NWdRd3RrUU1oajhHSGJoMjczN2hXcEMyMWJXWDRLTWw=","influencer_category":"Profile · Public figure","education":"…
From this payload, you’ll typically read profile.name, profile.profile_id, profile.url, profile.image, and profile.verified to surface identity info or link back to the source.
Putting it together in production
- Normalize IDs: store facebook_id (page), event_id, and video_id as primary keys. De-duplicate by these over time.
- Cache responses: keyword searches are repeatable; cache them on your side for a short TTL to reduce redundant calls.
- Respect source policies: only display and process data as permitted by your use case and applicable terms.
- UI hygiene: the image and thumbnail fields are direct CDN URIs suited for avatars or preview tiles.
- Cursor handling: when present (e.g., in events results), persist the cursor string so you can maintain continuity between fetches.
- Error handling: check HTTP status codes; treat timeouts and network errors with retries and backoff as appropriate.
Practical use cases that ship this week
- Brand discovery: search pages for your brand name; show verified pages first via is_verified.
- Lead routing: enrich inbound leads with a matching page url and facebook_id for your CRM.
- Event curation: search-events by a topic (e.g., “beer”) and post the event_id/title/url to your calendar or Slack.
- Content surfacing: search-videos for your niche keyword and embed video_url alongside author and thumbnail.
Call from AI agents via MCP
If you prefer to operate through an AI coding agent (Claude Code, Cursor, Windsurf, or any MCP-compatible client), Zyla exposes an MCP endpoint. Point your tool to:
Pass your Zyla API key (same Authorization: Bearer YOUR_API_KEY value) to the MCP client as directed by your agent. Tools can then issue the same endpoint calls shown above from within an agent session. This is handy for scripted searches (e.g., “search pages for X, then fetch videos for Y”).
To browse, subscribe, and manage keys for additional services, visit Zyla API Hub.
Tips that save you time
- Prioritize verification: use is_verified to rank official pages to the top of your results UI.
- Store both url and facebook_id: URLs are human-friendly; IDs are stable for re-fetching or cross-referencing.
- Language considerations: titles and descriptions may include non-Latin scripts; make sure your storage is UTF-8.
- Rate usage: the subscription is quota-based; design your polling or backfills accordingly. For first use, a 7-day trial or 50 requests can help validate your flow—check the API page for current details.
FAQ
How do I authenticate?
Send the header Authorization: Bearer YOUR_API_KEY with each request. You obtain this key by subscribing on the API’s listing page.
What data fields do I get back for page search?
The response contains results[], where each item includes type, name, url/profile_url, image { uri, width, height, scale }, facebook_id, and is_verified.
Is there pagination?
The Search Events response can include a cursor string. Keep that value if you plan to maintain continuity across fetches. If additional pagination controls are available, they will appear on the API page.
Can I call these endpoints from an AI agent?
Yes. Use Zyla’s MCP endpoint so your MCP-compatible client can call the same endpoints with your API key.
Is there a free plan?
There’s no free plan. The subscription uses a quota model, not pay-per-call. For your first API, you can start with a 7-day trial or 50 requests—see the listing for the most up-to-date access options.
Ship it
If you need an API to search Facebook Pages (and optionally Events and Videos), subscribe and get your key in minutes. Use the sample calls above to wire up your integration now: Start 7-day trial on Facebook Scraper API.
Official API response
{"profile":{"name":"Mark Zuckerberg","profile_id":"4","url":"https://www.facebook.com/zuck","image":"https://scontent-atl3-2.xx.fbcdn.net/v/t39.30808-1/632598281_10117314650513371_3238643608998008744_n.jpg?stp=dst-jpg_s480x480_tt6&_nc_cat=105&ccb=1-7&_nc_sid=1d2534&_nc_ohc=LjkvEg7sdw8Q7kNvwEaPsox&_nc_oc=AdmCdyxSpDASES67Y_gDG38HAgX4jHJmTVIhvvCWNAPvPyv-pT2MkqAPjlQhPbHwWrY8uW9gqGX2G_SqONA9jbku&_nc_zt=24&_nc_ht=scontent-atl3-2.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_Aft5Pz5CRJir2D9RSDB9DHeDE2DgVFClZFvg3B_3N3-Rdg&oe=69A18B0B","intro":"Bringing the world closer together.","cover_image":"https://scontent-atl3-3.xx.fbcdn.net/v/t39.30808-6/632550896_10117314656231911_7975049830116595629_n.png?_nc_cat=110&ccb=1-7&_nc_sid=2a1932&_nc_ohc=MK0GxxJ3MnAQ7kNvwGa91zk&_nc_oc=AdkYRmT5nQE8Wy7rtQIQVcsAFZpf2O-AfWgQayQistV8orDCmh3HHLcV1wyBGJ4MhxNmm_SjaJsm_Fhj0K4dUZng&_nc_zt=23&_nc_ht=scontent-atl3-3.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_AfvWwbUzfWNcxPpMjaQEicKtpNeAHrXk8D1zfpIjowyKEw&oe=69A17D22","gender":"MALE","about":{},"about_public":[{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nS7-NxdkDDt.png","width":40},"text":"Profile · Public figure","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Founder and CEO at Meta","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Works at Biohub","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nDxCDAeszOF.png","width":40},"text":"Studied Computer Science and Psychology at Harvard University","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yA/r/bStXkZOl3Ha.png","width":40},"text":"Lives in Palo Alto, California","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yh/r/k7egJAGHjmH.png","width":40},"text":"From Dobbs Ferry, New York","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yk/r/exk40A1bzjc.png","width":40},"text":"Married to Priscilla Chan","external_url":null}],"verified":true,"delegate_page_id":null,"reels_profile_id":"YXBwX2NvbGxlY3Rpb246cGZiaWQwUHlEa0Y2ZnV0NlFXdjhtS2NlNDR6dnp3OUJ5TnlXOVZXanNmM2hiWjJ1OXZ6cGVzQmh4NWdRd3RrUU1oajhHSGJoMjczN2hXcEMyMWJXWDRLTWw=","influencer_category":"Profile · Public figure","education":"…
Official API response
{"profile":{"name":"Mark Zuckerberg","profile_id":"4","url":"https://www.facebook.com/zuck","image":"https://scontent-atl3-2.xx.fbcdn.net/v/t39.30808-1/632598281_10117314650513371_3238643608998008744_n.jpg?stp=dst-jpg_s480x480_tt6&_nc_cat=105&ccb=1-7&_nc_sid=1d2534&_nc_ohc=LjkvEg7sdw8Q7kNvwEaPsox&_nc_oc=AdmCdyxSpDASES67Y_gDG38HAgX4jHJmTVIhvvCWNAPvPyv-pT2MkqAPjlQhPbHwWrY8uW9gqGX2G_SqONA9jbku&_nc_zt=24&_nc_ht=scontent-atl3-2.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_Aft5Pz5CRJir2D9RSDB9DHeDE2DgVFClZFvg3B_3N3-Rdg&oe=69A18B0B","intro":"Bringing the world closer together.","cover_image":"https://scontent-atl3-3.xx.fbcdn.net/v/t39.30808-6/632550896_10117314656231911_7975049830116595629_n.png?_nc_cat=110&ccb=1-7&_nc_sid=2a1932&_nc_ohc=MK0GxxJ3MnAQ7kNvwGa91zk&_nc_oc=AdkYRmT5nQE8Wy7rtQIQVcsAFZpf2O-AfWgQayQistV8orDCmh3HHLcV1wyBGJ4MhxNmm_SjaJsm_Fhj0K4dUZng&_nc_zt=23&_nc_ht=scontent-atl3-3.xx&_nc_gid=IndkrZ-NXLMaL1RGOJUuzw&oh=00_AfvWwbUzfWNcxPpMjaQEicKtpNeAHrXk8D1zfpIjowyKEw&oe=69A17D22","gender":"MALE","about":{},"about_public":[{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nS7-NxdkDDt.png","width":40},"text":"Profile · Public figure","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Founder and CEO at Meta","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yi/r/Xcm_N7TYfz4.png","width":40},"text":"Works at Biohub","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yW/r/nDxCDAeszOF.png","width":40},"text":"Studied Computer Science and Psychology at Harvard University","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yA/r/bStXkZOl3Ha.png","width":40},"text":"Lives in Palo Alto, California","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yh/r/k7egJAGHjmH.png","width":40},"text":"From Dobbs Ferry, New York","external_url":null},{"icon":{"height":40,"scale":2,"uri":"https://static.xx.fbcdn.net/rsrc.php/v4/yk/r/exk40A1bzjc.png","width":40},"text":"Married to Priscilla Chan","external_url":null}],"verified":true,"delegate_page_id":null,"reels_profile_id":"YXBwX2NvbGxlY3Rpb246cGZiaWQwUHlEa0Y2ZnV0NlFXdjhtS2NlNDR6dnp3OUJ5TnlXOVZXanNmM2hiWjJ1OXZ6cGVzQmh4NWdRd3RrUU1oajhHSGJoMjczN2hXcEMyMWJXWDRLTWw=","influencer_category":"Profile · Public figure","education":"…