Facebook GraphQL Scraper — Open-Source, Lightweight, No Headless Browser
Описание и применение
Скриптер facebook-gql-scraper позволяет быстро собирать данные с Facebook без API‑ключа и тяжелых браузеров, используя экспортированные куки.
Задача
Existing free Facebook scrapers are outdated or unreliable, requiring developers to find a lightweight, API‑key‑free solution for collecting Facebook data.
Результат
The scraper enables developers to collect diverse Facebook data types quickly and efficiently without heavy dependencies or API keys.
Рабочий процесс
- Export Facebook cookies as JSON using Cookie‑Editor (Firefox) or EditThisCookie (Chrome).
- Save the file as facebook_cookies.json.
- Install the library with
pip install facebook-gql-scraper. - Create a FacebookContext with the cookies file.
- Instantiate a Profile via
Profile.from_username(ctx, username='Ishowspeed'). - Access profile attributes (name, biography, birthday).
- Iterate over posts with
user.get_posts()and print post details. - Explore additional data such as comments, reactions, photos, and videos using the library’s API.
Доказательства
I built an open-source Facebook GraphQL scraper — no API key required.
It supports scraping: Profiles and user posts, Comments and reactions, Groups, Marketplace, Search results, Photos, videos, and reels.
Export your Facebook cookies as JSON using Cookie-Editor (Firefox) or EditThisCookie (Chrome), then save as facebook_cookies.json.
pip install facebook-gql-scraper
import facebook_gql_scraper as fgs ctx = fgs.FacebookContext(cookies_file="facebook_cookies.json") user = fgs.Profile.from_username(ctx, username="Ishowspeed") print(user.name, user.biography, user.birthday) for post in user.get_posts(): print(post.id, post.text)
- Дата записи: 2026-10-12T17:41:35.372Z