Within public Facebook profiles there is an about section that has key details like name of the page, phone number, address, opening hours, number of likes and followers, and many other details.

The SerpApi Facebook Profiles API can be used to gather public profile information for market analysis, influencer discovery, and competitive benchmarking. You can analyze audience demographics or track engagement trends across public profiles for targeting strategies. Recruiters and HR platforms can integrate it to verify professional identities or collect candidate data. You can even monitor public posts and sentiment about a brand, event, or topic. It streamlines access to structured Facebook profile data.

The good news is SerpApi has recently released a Facebook Profile API. The Facebook Profile API allows you scrape important information from public Facebook profiles. Now let's review how to scrape Facebook profiles.

What can you scrape?

  • Page details: name, id, url, gender
  • Profile details: verified, profile_picture, cover_photo, likes, followers, profile_type, profile_intro_text, category
  • Location information: address, phone, email, business_hours, price_range

Getting Started with SerpApi

Before we jump into the Facebook Profile API we must first make sure we are set up to use SerpApi.

Step 1: Create a free account

If you already have an account you can skip this step. Otherwise sign up at this link: https://serpapi.com/users/sign_up.

Verify your email and phone number and click "Subscribe".

Step 2: Find your API Key

Once you have created and verified your free account you can next find your API key. This will be located at this link: https://serpapi.com/manage-api-key.

You can regenerate your API key from the same link, otherwise it will not change.

Step 3: Install SerpApi library (Optional)

I recommend installing the SerpApi library for ease of use, we offer many libraries in different languages. Review the full list of languages with instructions for each, here: https://serpapi.com/integrations.

You can also use a simple GET request in any language if you prefer that to installing the library, we will be reviewing both for the Facebook Profile API.

Step 4: Review the Facebook Profile API documentation

We include a full documentation page for each of our APIs. Let's take a look at Facebook Profile API:

Facebook Profile API - SerpApi
Scrape Facebook Profile with SerpApi’s Facebook Profile API. Profile name, description, posts, photos, videos and more.

Within the documentation you can quickly identify what information you'll need.

The SerpApi parameters are consistent across all of our APIs, today we will be using the top 2 that are required:

  • engine (Required): Set to facebook_profile to use the Facebook Profile API.
  • api_key (Required): Parameter defines the SerpApi private key to use.
  • no_cache (Optional): Require SerpApi to fetch fresh results (not cached).
  • async (Optional):
    • False (default): Keep HTTP connection open until you got your results
    • True: submit search to SerpApi and retrieve later (Searches Archive API)
  • zero_trace (Optional): Enterprise only, skip storing search data
  • output (Optional): json for structured JSON or html for raw html
  • json_restrictor (Optional): The fields you want to restrict in the outputs for smaller, faster responses

Next we'll look at the parameters that are available for the Facebook Profile API itself, good news there is only one! It is required so we will be using it in our query:

  • profile_id (Required): The Facebook Profile ID you will need in order to scrape a profile.

Now that we understand what is available and what is required, let's collect the remaining information.

Where do I find the profile_id?

We already have the engine and the api_key, now the parameter remaining is the profile_id. You can find the profile ID at the end of the URL of the profile you are looking to scrape.

Let's say for example we are looking at SerpApi's profile, you can see the link here: https://www.facebook.com/serpapicom.

Extracting the profile_id for SerpApi from the profile link we can identify it is "serpapicom" as that is the id at the end of the link:

Now that we have the profile_id we have everything we need to successfully query The Facebook Profile API.

How to Scrape Facebook profiles

You can use any programming language and many platforms in order to call our APIs. The parameters and results we reviewed above will not differ between the platforms, however the language on how you call the APIs may differ.

You will see across the examples the engine is always set to facebook_profile, the api_key will be set to your API Key, and we include the profile_id in every query. In this case the profile_id is set to serpapicom as that is the profile_id we identified above, however you will switch this value out for the appropriate ID.

GET Request

The syntax for the actual GET request between languages will of course vary between programming languages.

However, the link used each time is consistent. When you are sending a GET request in any language you will use this link to make the request:

https://serpapi.com/search.json?engine=facebook_profile&api_key=YOUR_SECRET_API_KEY&profile_id=serpapicom

Python (using SerpApi library)

from serpapi import GoogleSearch

params = {
  "engine": "facebook_profile",
  "profile_id": "serpapicom",
  "api_key": "YOUR_SECRET_API_KEY"
}

search = GoogleSearch(params)
results = search.get_dict()

cURL

curl --get https://serpapi.com/search \
 -d engine="facebook_profile" \
 -d profile_id="serpapicom" \
 -d api_key="YOUR_SECRET_API_KEY"

No Code

Google Sheets

To connect your code with Google Sheets first follow this blog post:

Connect SERP API with Google Sheets (No Code)
Here is how to connect SERP API (SerpApi) to Google Sheets using a no-code solution
=SERPAPI_RESULT("engine=facebook_profile&profile_id=Modernatx", "profile_results.name")

Make.com

While not every API we offer is on Make.com, there is a Universal Module where you can use any API.

Review this blog post to get started:

Announcing SerpApi’s Make App
We are pleased to announce the release of our Custom App on Make.com. This makes it easier than ever to integrate SerpApi with other systems without having to write any code.

N8N

Similar to Make.com, not every API is currently included in N8N. However, you can use the HTTP Request node to still call any of our APIs.

To get started review this blog post:

Boost Your n8n Workflows with SerpApi’s Verified Node
Add real-time search to your n8n workflows and AI Agents with SerpApi’s node. Featuring over 20 APIs including Google Search, Google Maps, Bing, and more.

Additional Programming Languages

Each of our documentation pages offers examples with code blocks. You can toggle between the programming languages in the top right corner of the code block for the SerpApi integration.

Here is a link to the documentation page first example for the Facebook Profile API where you can see the code examples and where to select the programming language:

Conclusion

The new Facebook Profile API is a powerful API where you can gather a lot of information regarding different public Facebook profiles. Whether you need to scrape business location details or track popularity of different pages across time, we have the API for you.

You can use any programming language, you can use SerpApi's libraries or use a GET request, or a no code option. The implementation is up to you. We are happy to provide the data you need in a structured JSON format.

If you're interested in what other APIs we offer, view the full list of APIs here: https://serpapi.com/search-api.

Resources

Related: