You need to find Facebook videos for a search term and turn the results into links your application can display. This guide shows how to call the Facebook Scraper API’s video search endpoint, read the returned video and author fields, and handle the integration through Zyla API Hub.
What the video search returns
Search Videos retrieves videos matching a required search query. The documented example searches for football and returns a results array containing video identifiers, links, descriptions, titles, author information, thumbnails, and a raw time-and-views string.
That data can support a video discovery interface, a research workflow, or a dashboard that lets an editor review matching posts. The result links point to Facebook; the example response does not establish that the API returns a downloadable video file.
The Zyla API Hub marketplace provides access through one account and API key. It lists more than 10,000 public APIs, including the Facebook Scraper API used here.
Getting started on Zyla API Hub
- Open the Facebook Scraper API marketplace page linked at the end of this article.
- Click Subscribe or Start Free Trial when available, and obtain your API key.
- Send the key in the
Authorization: Bearer YOUR_API_KEYheader when calling a Hub endpoint.
Access uses a subscription and quota rather than pay-per-call billing. First-API access is described as a 7-day trial or 50 requests; check the API page for current access options and pricing.
Keep the key on your server or in your development environment rather than shipping it in browser code. The examples below use YOUR_API_KEY as the value to replace.
Search for videos
Search Videos uses GET. Its required query parameter is a string; the documented request uses football.
Request URL: https://zylalabs.com/api/11904/facebook-scraper-api/22641/search-videos?query=football
Call the endpoint from Python
This standard-library example calls video search by default. It also supports the profile request shown later in the official marketplace example, so you can inspect that response without changing the search request.
import json
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
video_url = (
"https://zylalabs.com/api/11904/facebook-scraper-api/"
"22641/search-videos?query=football"
)
profile_url = (
"https://zylalabs.com/api/11904/facebook-scraper-api/"
"22610/profile-details-by-url?"
"url=https%3A%2F%2Fwww.facebook.com%2Fzuck%2F"
)
show_profile = len(sys.argv) > 1 and sys.argv[1] == "profile"
request = Request(
profile_url if show_profile else video_url,
headers={"Authorization": "Bearer YOUR_API_KEY"},
method="GET",
)
try:
with urlopen(request) as response:
data = json.load(response)
except HTTPError as error:
sys.exit(f"Request failed with HTTP status {error.code}")
except URLError as error:
sys.exit(f"Could not reach the API: {error.reason}")
except json.JSONDecodeError:
sys.exit("The response was not valid JSON")
if show_profile:
profile = data.get("profile") or {}
print(profile.get("name"), profile.get("url"))
else:
for video in data.get("results", []):
author = video.get("author") or {}
print(video.get("title"))
print("Video:", video.get("video_url"))
print("Author:", author.get("name"))
print("Time and views:", video.get("time_and_views_raw"))
print()
Replace the key and run the script to print the video results. Passing profile as the script argument selects the separate profile example instead. The script reads optional values with get, so a missing author or title does not immediately stop result rendering.
Read the video response
The following is the documented response excerpt for the video search. It is truncated in the source, so the block is useful for inspecting fields but is not a complete JSON document to parse.
{"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…
video_ididentifies the returned video;video_urlis the link to open it.titleanddescriptionprovide text for a result card. Preserve Unicode when storing and displaying them.author.name,author.url, andauthor.is_verifiedprovide context about the author in this example.thumbnailis an image URL. Treat it as a returned link rather than assuming it is permanent.time_and_views_rawis display text, not a documented numeric view count or timestamp. Avoid treating it as either without a separate parsing strategy.
For a production interface, handle an empty results array and request failures separately: no matches is a different outcome from a failed API call. The documented video request defines the search query, but does not establish a pagination parameter, so do not build a next-page request from assumptions.
Other documented endpoints
The same API provides related searches. These endpoints are useful when a video discovery workflow also needs to find a page or an event, but their results are not substitutes for video results.
Search Pages
Use GET to retrieve pages matching a search query. The required string parameter is query; the documented example is:
https://zylalabs.com/api/11904/facebook-scraper-api/22640/search-pages?query=messi
The example response contains page names, profile URLs, image information, Facebook IDs, and verification status. A page result identifies a page, not a video returned by Search Videos.
Search Events
Use GET to find Facebook events by keyword or filter. The documented required string parameter is query; the example request is:
https://zylalabs.com/api/11904/facebook-scraper-api/22642/search-events?query=beer
The example response includes event IDs, titles, and URLs. It also contains a cursor field, but the supplied request definition does not specify how to use it for another request.
Profile Details By Url
The marketplace also documents a GET request for profile details using a URL. It is a separate operation from video search. Here is the official request:
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"
The official response is reproduced below as supplied. It is truncated and therefore is not a complete JSON document.
{"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-pT2MkqAPjlQhPbHwWrY8uW9qGX2G_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":"…
For this operation, the fields used by the Python example are profile.name and profile.url. The excerpt also shows profile_id and verified; these belong to the profile response, not the video-search result shape.
Build a useful search workflow
For an editorial review tool, render each video’s title, author name, thumbnail, and link together. Keep the original description available for context, and let a person open the Facebook URL before deciding whether the result is relevant.
For repeated research, store the search term alongside the returned video ID and link. If you cache results, choose a refresh policy appropriate to your application: the raw time-and-views text is relative, and an image URL should not be assumed to remain valid indefinitely.
Watch subscription quota when testing. Reusing a saved response during UI development can reduce unnecessary calls, while a fresh request is still needed when you want current search results.
Call the API from an AI agent
Zyla APIs can also be called through MCP from Claude Code, Cursor, Windsurf, or another MCP-compatible client. Configure the client with https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY, replacing the key placeholder with your own key.
An agent can use the available API tools to support a video discovery task, such as finding matching videos and summarizing the returned titles and links. Check the results before presenting them as recommendations, and protect the MCP URL because it contains your API key.
FAQ
What parameter is required to search videos?
Search Videos requires the string parameter query. The documented request uses query=football.
Does the response include a video link?
Yes. The documented video result includes video_url, along with video_id, text, author information, and a thumbnail.
Can I get a numeric view count from the example?
The example supplies time_and_views_raw as combined display text. It does not establish a separate numeric view-count field.
How do I paginate video search results?
The supplied video-search request defines query but does not specify a pagination parameter. Check the API listing for current documentation before implementing pagination.
Create a free Zyla API Hub account, open the listing, and get an API key to start integrating: Start 7-day trial on Facebook Scraper API. Check the listing for current access options and pricing.