Social Media
Facebook logo

Facebook API

facebook.com

Public Facebook data: profiles, posts, comments and search.

Actions
4
Category
Social Media
Login
Not required
Output
JSON

Call the Facebook API

Submit a task, then poll the job until it settles. This example runs facebook_ad_library_search.

curl -X POST https://api.anakin.io/v1/wire/task \
  -H "X-API-Key: $ANAKIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "facebook_ad_library_search",
    "params": {
      "query": "nike"
    }
  }'

4 actions on facebook.com

Read

  • Ad Library Search

    facebook_ad_library_searchread10 credits / call

    Search the Meta Ad Library by keyword, one full page (about 30 ads) per call: advertiser, active flag, run dates, platforms, ad text, title, call to action, link, images and videos. Use cursor for more.

    query
    string · required
    country
    string
    cursor
    string
  • Page Posts

    facebook_page_postsread100 credits / call

    Get a Facebook page's latest posts (10 by default, up to 60): text, date, reactions, comments, shares, video views, link and image.

    page
    string · required
    limit
    integer
  • Page Profile

    facebook_page_profileread10 credits / call

    Get a public Facebook page: name, category, intro, followers, likes, website, email, creation date, ad status, avatar and cover.

    page
    string · required
  • Post Comments

    facebook_post_commentsread10 credits / call

    Get the comments on a Facebook post, one full page (about 10) per call: text, date, reactions, reply count and commenter name. Use cursor for more.

    post_url
    string · required
    cursor
    string

Facebook API questions

Is there an API for Facebook?
Facebook does not offer a public data API for this, but Anakin Wire provides 4 maintained endpoints for facebook.com. You call Anakin's REST API with an action ID and parameters and get structured JSON back; Anakin handles the browser, proxies, anti-bot, and parsing.
How do I scrape Facebook data?
POST to https://api.anakin.io/v1/wire/task with your API key, the action ID, and its parameters, then poll GET /v1/wire/jobs/{id} until the job settles. There is nothing to install and no scraper to maintain — when facebook.com changes its markup, Anakin updates the action.
Do I need a Facebook account?
No. Every Facebook action listed here runs anonymously — no account and no credentials required.
What does the Facebook API cost?
Usage-based credits, charged per call and refunded automatically when a job fails. New accounts start with 300 free credits and no card. See anakin.io/pricing for the current rates.

More Social Media APIs

All Social Media sites