Facebook / Search

Search Groups

Search Facebook's Groups tab. Each returned group costs 4 credits.

01

Request

POST /api/facebook/search/groups with a bearer API key. Each call returns one page.

queryRequired search text, such as gardening.
cityOptional numeric Facebook city ID. Baltimore, Maryland is 112438218775062. Omit to search all cities.
publicOptional boolean. True restricts results to public groups; false or omitted leaves visibility unrestricted.
cursorOmit or send null initially. Pass data.pagination.cursor unchanged to fetch the next page.
▸ ▾ request {}
{"query":"buy and sell","city":"112438218775062","public":true}

With public off, both public and private groups can appear.

When data.pagination.has_next_page is true, send data.pagination.cursor as cursor with the same query and filters. Pass it back unchanged. Page lengths vary; stop when there is no next page.

Each returned group costs 4 credits. Empty results cost nothing. If the wallet cannot cover the entire page, the request returns 402. Failed fetches are refunded.

02

Response sample

▸ ▾ response {} — illustrative group; native card shortened
{
  "cost": 4,
  "created_at": 1790850788,
  "request_duration": 310,
  "parse_duration": 1,
  "data": {
    "groups": [
      {
        "id": "123456789000001",
        "name": "Community Gardening",
        "url": "https://www.facebook.com/groups/123456789000001/",
        "profile_picture": {
          "uri": "https://scontent.example.com/group.jpg",
          "width": 60,
          "height": 60,
          "scale": 1
        },
        "privacy": "Public",
        "members": "1.1K members",
        "activity": "3 posts a day",
        "description_snippets": [],
        "join_state": "CAN_JOIN",
        "has_membership_questions": false
      }
    ],
    "results": [
      {
        "role": "ENTITY_GROUPS",
        "type": "XFBSearchListCellProfileRenderingStrategy",
        "data": {
          "__typename": "XFBSearchListCellProfileRenderingStrategy",
          "view_model": {
            "profile": {
              "__typename": "Group",
              "id": "123456789000001",
              "name": "Community Gardening",
              "url": "https://www.facebook.com/groups/123456789000001/",
              "profile_picture": {
                "uri": "https://scontent.example.com/group.jpg",
                "width": 60,
                "height": 60,
                "scale": 1
              }
            },
            "primary_snippet_text_with_entities": {
              "text": "Public · 1.1K members · 3 posts a day"
            },
            "description_snippets_text_with_entities": [],
            "ctas": {
              "primary": [
                {
                  "profile": {
                    "viewer_join_state": "CAN_JOIN",
                    "has_membership_questions": false
                  }
                }
              ]
            }
          }
        }
      }
    ],
    "pagination": {
      "has_next_page": false,
      "cursor": null
    }
  }
}

03

Fields

Responses include cost, created_at, request_duration and parse_duration alongside data.

privacy, members and activity are separate fields. Membership and activity preserve Facebook's displayed rounding and units; missing parts are null.

data.groups []

idtextNumeric Facebook group ID, kept as text.
nametextThe group name shown in the result.
urltextLink to the group.
▸ ▾ profile_pictureobjectProfile picture, or null when absent.
uritextFacebook-hosted image URL. The URL can expire.
widthnumberImage width.
heightnumberImage height.
scalenumberImage scale.
privacytextDisplayed visibility, such as Public or Private; null when absent.
memberstextDisplayed membership label, such as 1.1K members. Counts can be rounded; null when absent.
activitytextDisplayed posting frequency, such as 3 posts a day; null when absent.
description_snippetstext[]Description fragments supplied by Facebook. Empty when none appear; explicit null fragments are preserved.
join_statetextJoin action available to the browser identity used for this request, such as CAN_JOIN or CAN_REQUEST. Can be null.
has_membership_questionsbooleanWhether joining requires answering questions, or null when Facebook omits it.

data.results []

roletextFacebook result role.
typetextFacebook card type.
dataobjectNative card data, preserving additional fields returned by Facebook.

data.pagination {}

has_next_pagebooleanWhether Facebook reported another page.
cursortextContinuation to send as cursor, or null at the end.