Skip to content
Scrappa Get API key
Facebook API 1 credit / request

Facebook Profile Feed API

GET https://scrappa.co/api/facebook/profile/feed?handle=Microsoft

Get the first page of the timeline feed of a public Facebook profile. One call returns up to about 20 posts (the number Facebook renders on its first feed page, usually 9 to 20), newest first. Every post carries: post_id, post_url, creation_time and created_at (ISO 8601, UTC), text, link_url (the external URL a post shares, from a link attachment or from the post text), link_card (url, title, description, source, domain, image), image, media_type (text, photo, video, album or link), media (type, id, url, image, duration_ms, width, height, video_url per item), media_id, media_width, media_height, video_url, video_thumbnail, video_duration_ms, video_view_count, reaction_count, reactions by type, comment_count, share_count, top_comments (the comments Facebook shows under the post: id, text, created_at, url, author), is_paid_partnership, is_made_with_ai, is_pinned, co_authors (the other pages of a collaboration post; author is the first one), and the author as object (id, name, short_name, url, picture) and as flat keys (author_id, author_name, author_short_name, author_url, author_picture). Posts of other pages that Facebook lists next to the feed are left out. A field Facebook does not show for a post is null (top_comments and co_authors are empty lists). video_view_count is null when Facebook has not computed a count yet. There is no pagination: each call reads the first feed page once. Use the post endpoint with a full permalink for one post in detail. A feed that cannot be read is not billed.

Facebook Profile Feed API 1 credit / request

Endpoint

Request preview
GET
https://scrappa.co/api/facebook/profile/feed?handle=Microsoft
Auth header
x-api-key
Cost
1 credit / request
handle = Microsoft
Response preview
200 OK
{
    "success": true,
    "posts": [
        {
            "post_id": "1067413072098798",
            "post_url": "https://www.facebook.com/Microsoft/posts/pfbid0zUdvXj74i8a65s9g1kgrBkvP9qstAhgq143wffAYscidGdKt6RgoA8BcU72Ks1",
            "creation_time": 1743805106,
            "created_at": "2025-04-04T22:18:26Z",
            "text": "For the first time in a decade, Microsoft\u2019s 3 CEOs are on stage together again.",
            "link_url": null,
            "link_card": null,
            "image": "https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=1067413028765469",
            "media_type": "photo",
            "media": [
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

handle string Required

Facebook profile handle, without the @ or the facebook.com prefix (e.g. Microsoft).

Example value Microsoft

Request Examples

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://scrappa.co/api/facebook/profile/feed?handle=Microsoft",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-api-key: YOUR_API_KEY_HERE"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
PHP
<?php

use Illuminate\Support\Facades\Http;

$response = Http::timeout(30)
    ->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
    ->get('https://scrappa.co/api/facebook/profile/feed?handle=Microsoft');

if ($response->successful()) {
    echo $response->body();
} else {
    echo "Error: " . $response->status();
}
JavaScript
const options = {
    method: 'GET',
    headers: {
        'x-api-key': 'YOUR_API_KEY_HERE'
    }
};

fetch('https://scrappa.co/api/facebook/profile/feed?handle=Microsoft', options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        return response.text();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
JavaScript
const axios = require('axios');

const options = {
    method: 'GET',
    url: 'https://scrappa.co/api/facebook/profile/feed?handle=Microsoft',
    headers: {
        x-api-key: 'YOUR_API_KEY_HERE',
    }
};

try {
    const response = await axios(options);
    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
Ruby
require 'net/http'
require 'uri'

uri = URI.parse("https://scrappa.co/api/facebook/profile/feed?handle=Microsoft")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'

request = Net::HTTP::Get.new(uri.request_uri)
request['x-api-key'] = 'YOUR_API_KEY_HERE'

begin
    response = http.request(request)
    puts response.body
rescue => e
    puts "Error: #{e.message}"
end
Python
import http.client
import json

conn = http.client.HTTPSConnection("scrappa.co")

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    conn.request("GET", "/api/facebook/profile/feed?handle=Microsoft", headers=headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
except Exception as e:
    print(f"Error: {e}")
finally:
    conn.close()
Python
import requests

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    response = requests.get('https://scrappa.co/api/facebook/profile/feed?handle=Microsoft', headers=headers)
    response.raise_for_status()
    print(response.text)
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
Java
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class ApiExample {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://scrappa.co/api/facebook/profile/feed?handle=Microsoft")
        .addHeader("x-api-key", "YOUR_API_KEY_HERE")
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                System.out.println(response.body().string());
            } else {
                System.out.println("Error: " + response.code());
            }
        } catch (IOException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://scrappa.co/api/facebook/profile/feed?handle=Microsoft", nil)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }
    req.Header.Set("x-api-key", "YOUR_API_KEY_HERE")

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println("Error reading response:", err)
        return
    }

    fmt.Println(string(body))
}
Terminal
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/facebook/profile/feed?handle=Microsoft"
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY_HERE");

        try
        {
            var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://scrappa.co/api/facebook/profile/feed?handle=Microsoft"));
            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }
}
TypeScript
import axios from 'axios';

async function run(): Promise<void> {
    try {
        const response = await axios({
            method: 'GET',
            url: 'https://scrappa.co/api/facebook/profile/feed?handle=Microsoft',
            headers: {
        'x-api-key': 'YOUR_API_KEY_HERE',
            },
        });

        console.log(response.data);
    } catch (error) {
        console.error('Error:', error);
    }
}

void run();
RUST
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .get("https://scrappa.co/api/facebook/profile/feed?handle=Microsoft")
        .header("x-api-key", "YOUR_API_KEY_HERE")
        .send()
        .await?;

    println!("{}", response.text().await?);

    Ok(())
}

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

success posts posts_count meta

Common posts fields

post_id post_url creation_time created_at
JSON Response
200 OK
{
    "success": true,
    "posts": [
        {
            "post_id": "1067413072098798",
            "post_url": "https://www.facebook.com/Microsoft/posts/pfbid0zUdvXj74i8a65s9g1kgrBkvP9qstAhgq143wffAYscidGdKt6RgoA8BcU72Ks1",
            "creation_time": 1743805106,
            "created_at": "2025-04-04T22:18:26Z",
            "text": "For the first time in a decade, Microsoft\u2019s 3 CEOs are on stage together again.",
            "link_url": null,
            "link_card": null,
            "image": "https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=1067413028765469",
            "media_type": "photo",
            "media": [
                {
                    "type": "photo",
                    "id": "1067413028765469",
                    "url": "https://www.facebook.com/photo/?fbid=1067413028765469&set=a.650054897167953",
                    "image": "https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=1067413028765469",
                    "duration_ms": null,
                    "width": 810,
                    "height": 540,
                    "video_url": null
                }
            ],
            "media_id": "1067413028765469",
            "media_width": 810,
            "media_height": 540,
            "video_url": null,
            "video_thumbnail": null,
            "video_duration_ms": null,
            "video_view_count": null,
            "reaction_count": 40904,
            "reactions": {
                "angry": 34515,
                "like": 5040
            },
            "comment_count": 467,
            "share_count": 1100,
            "author": {
                "id": "100064903443387",
                "name": "Microsoft",
                "short_name": "Microsoft",
                "url": "https://www.facebook.com/Microsoft/",
                "picture": "https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=100064903443387"
            },
            "author_id": "100064903443387",
            "author_name": "Microsoft",
            "author_short_name": "Microsoft",
            "author_url": "https://www.facebook.com/Microsoft/",
            "author_picture": "https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=100064903443387",
            "is_paid_partnership": false,
            "is_made_with_ai": false,
            "is_pinned": false,
            "co_authors": [],
            "top_comments": [
                {
                    "id": "917299978045106",
                    "text": "Great photo!",
                    "created_at": "2025-04-05T08:12:11Z",
                    "url": "https://www.facebook.com/Microsoft/posts/pfbid0zUdvXj74i8a65s9g1kgrBkvP9qstAhgq143wffAYscidGdKt6RgoA8BcU72Ks1?comment_id=917299978045106",
                    "author": {
                        "id": "61563440931056",
                        "name": "Example Person",
                        "url": "https://www.facebook.com/people/Example-Person/61563440931056/",
                        "picture": null
                    }
                }
            ],
            "actor_name": "Microsoft",
            "media_permalink_url": "https://www.facebook.com/photo/?fbid=1067413028765469&set=a.650054897167953"
        }
    ],
    "posts_count": 1,
    "meta": {
        "classification": "ok",
        "billable": true,
        "endpoint_family": "facebook_profile_feed",
        "duration_ms": 7200
    }
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A required parameter is missing or malformed, for example a handle with characters Facebook does not allow or a non-numeric id.

{
    "message": "The request validation failed",
    "errors": {
        "handle": [
            "The handle is required."
        ]
    }
}
404

Not Found

The page, profile, group, event, photo, reel, post or listing does not exist, is not public, or was served by Facebook without the requested record. This is the truthful answer, not a temporary fault: it is never billed and retrying the same permalink will not change it.

{
    "success": false,
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested Facebook resource was not found."
    },
    "meta": {
        "billable": false,
        "retryable": false
    }
}
503

Records Not Read

Facebook returned records for this request that the parser could not read. The origin status is 502 and it is reported here as 503 because Cloudflare replaces 502 and 504 bodies with its own page. This request is never billed: the customer received no data.

{
    "success": false,
    "error": {
        "code": "EXTRACTION_MISS",
        "message": "Facebook returned records for this request that could not be read. This request is not billed."
    },
    "meta": {
        "billable": false,
        "retryable": false
    }
}
503

Temporarily Unavailable

The upstream service is temporarily unavailable. Please retry shortly.

{
    "success": false,
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Facebook is temporarily unavailable. Please retry."
    },
    "meta": {
        "billable": false,
        "retryable": true
    }
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.