Platforms
Facebook

Facebook Integration

The Web Action SDK provides powerful actions to interact with Facebook. This guide covers all available Facebook actions, their inputs, outputs, and usage examples.

Actions

Search Marketplace For Items

Searches the Facebook Marketplace for items based on a search query.

Function: sdk.facebook.searchMarketplaceForItems
 
Input:
{
  searchQuery: string,
  topN: number, // 1-10, optional
  filter: {
    minPrice: number, // optional
    maxPrice: number, // optional
    deliveryMethod: string, // "All" | "Local pickup" | "Shipping", optional
  }
}
 
Output:
{
  items: Array<{
    title: string,
    price: string,
    location: string,
    itemUrl: string,
  }>
}

Example:

const items = await sdk.facebook.searchMarketplaceForItems({
  searchQuery: "iphone",
  topN: 5,
  filter: {
    minPrice: 100,
    maxPrice: 200,
    deliveryMethod: "Shipping",
  },
});
 
console.log(items);

Search for Profiles

Searches for profiles on Facebook based on a name.

Function: sdk.facebook.searchForProfiles
 
Input:
{
  name: string,
  filter: string, // "All" | "People" | "Photos" | "Videos" | "Posts"
  topN: number, // 1-10, optional
}
 
Output:
{
  profiles: Array<{
    name: string,
    profileUrl: string,
    profilePictureUrl: string,
  }>
}

Example:

const profiles = await sdk.facebook.searchForProfiles({
  name: "John Doe",
  filter: "People",
  topN: 5,
});
 
console.log(profiles);

Troubleshooting

If you encounter any issues while using the Facebook integration, please refer to our Troubleshooting Guide for common problems and their solutions.