登录
使用 JS token

Facebook scrapers 配合您的 JavaScript token 效果最佳。

API 用法

Crawling API 请求中添加 &scraper=facebook-profile。在 url 参数中传入经过 URL 编码的目标 URL。

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.facebook.com/zuck' \
  --data-urlencode 'scraper=facebook-profile' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.facebook.com/zuck',
    {'scraper': 'facebook-profile'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://www.facebook.com/zuck',
  { scraper: 'facebook-profile' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.facebook.com/zuck', scraper: 'facebook-profile')
data = JSON.parse(res.body)

示例输入 URL

传入 url 参数的 URL(为便于阅读已 URL 解码):

https://www.facebook.com/zuck

响应结构

JSON 响应体。当源页面省略相应值时,字段类型可能为 null

name
string
个人资料所有者的显示名称。
profile_image
string
头像图片 URL。
cover_image
string | null
封面图片 URL。
intro
string | null
个人资料中的简介 / 介绍文本。
work
array
列出的工作经历条目。
work[].employer
string
雇主名称。
work[].title
string
职位名称。
work[].period
string | null
日期范围(例如 «2004 - present»)。
education
array
教育经历条目,包含 schooldegreeperiod
similar_profiles
array<string>
Facebook 推荐的相似个人资料名称。

示例响应

{
  "name": "Mark Zuckerberg",
  "profile_image": "https://scontent.fbcd…/profile.jpg",
  "intro": "Founder and CEO of Meta.",
  "work": [
    {
      "employer": "Meta",
      "title": "Founder & CEO",
      "period": "Feb 2004 – present"
    }
  ]
}