Skip to Content

Facebook API

13 endpoints for Pages, posts and Marketplace.

Every Facebook endpoint, by group. Each is a GET under /v1/facebook.

Quick Reference

PropertyValue
Base path/v1/facebook
Endpoints13
CreditsSee Below
GuideFacebook

Accounts

Posts

Marketplace

Events

Example Request

Every Facebook endpoint is called this way: its path, and what to read as query parameters.

import { SocialAPI } from "@socialapihq/sdk";

const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });

const { data } = await client.facebook.profile({ handle: "NASA" });
Response
{
  "data": {
    "id": "100044561550831",
    "username": "NASA",
    "displayName": "NASA - National Aeronautics and Space Administration",
    "bio": null,
    "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=9L3SyA6O4hMQ7kNvwFFAvxF&_nc_oc=AdpybpYhMw8jWVtu_JxDWUdMtLI5Czq9TSbYuo76Tt_Ox7pjEOtGt-zaWMbXtwrefdE&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQSM-2Yh4eXf9cZZwPB8BzXgNMEWSvNW3yHgzBkVrWdheQ&oe=6B0CCF95",
    "url": "https://www.facebook.com/NASA",
    "verified": true,
    "private": false,
    "followers": 28000000,
    "following": 53,
    "likes": null,
    "posts": null,
    "externalUrl": "https://www.nasa.gov/nasa-app/",
    "createdAt": null,
    "ext": {
      "pageId": "54971236771",
      "category": "Government organization",
      "followersLabel": "28M followers",
      "followingLabel": "53 following",
      "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=GVR710ihTyEQ7kNvwHoC3xD&_nc_oc=AdrCE6VeeQD4Y3D241kJ12-Iay1yW4-xHohgIU2E_l-MxAObvtEm-CmlFH7rAhOwXXU&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQR060AGMvQOt9YGGAfnInfe0lHPcITapSQoOhUfSrNIYA&oe=6B0CD367",
      "intro": [
        {
          "kind": "category",
          "text": "Page · Government organization",
          "url": null
        },
        {
          "kind": "confirmed_owner_label",
          "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page",
          "url": null
        },
        {
          "kind": "email",
          "text": "public-inquiries@hq.nasa.gov",
          "url": null
        }
      ]
    }
  }
}

Errors

A call that fails costs nothing. See Errors for every code.