Facebook API

Social / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

The Facebook Graph API is Meta primary way for apps to read and write data to Facebook, including user profiles, pages, posts, photos, and analytics. It uses OAuth 2.0, and most endpoints require an access token with specific permissions approved by the user. Because of Meta review process, plan extra time for your app to go through App Review before accessing data beyond your own account.

Beginner Tip

In development mode, your app can only access data from users who have a role in your app (admin, developer, or tester). Switch to Live mode only after completing Meta App Review for the permissions you need.

Available Data

book title and author
ISBN and publisher
cover image URL
page count
publication date
stock price and symbol

Example Response

JSON Response
{
  "title": "The Great Gatsby",
  "authors": [
    "F. Scott Fitzgerald"
  ],
  "publishedDate": "1925-04-10",
  "pageCount": 218,
  "categories": [
    "Fiction"
  ],
  "imageLinks": {
    "thumbnail": "https://books.google.com/..."
  },
  "averageRating": 4
}

Field Reference

id Unique identifier for the Facebook user, page, or object.
name Display name of the user or page.
email Email address of the user, only returned if the email permission was granted.
picture Object containing the URL and dimensions of the user profile picture.
access_token Page access token returned when querying a Page object that your user manages.

Implementation Example

Request
const url = "https://developers.facebook.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

OAuthException: Invalid OAuth access token The access token has expired, been revoked, or is malformed.
Generate a new access token using the Meta for Developers token debugger or re-run the OAuth login flow.
OAuthException: (#10) Application does not have permission for this action Your app has not been granted the required permission by the user or has not passed App Review.
Check that the user has granted the specific permission in the login dialog and that your app has been approved for it by Meta.
GraphMethodException: Unsupported get request You are trying to read a field or object that is not accessible with a Page or User token, or that no longer exists.
Use the Graph API Explorer to test the endpoint interactively and verify you are using the correct token type (User, Page, or App token).

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Social
Difficulty Advanced
Verified: 2026-04-04

Related Tags

Similar APIs

View All →