facebook

Search Facebook groups by keyword

Finds public Facebook groups by keyword, so you can pick the groups to read before calling /v1/facebook/group/posts. Returns one row per group, in the order the search found them, on the same Author shape /v1/facebook/group returns: author.id is the group's key (its numeric id, or the vanity name of a group that set one), author.url is the canonical https://www.facebook.com/groups/<key>/ form that /v1/facebook/group/posts and /v1/facebook/group take as url with no re-mapping, and author.display_name is the group's name. Groups are discovered through a public web search index limited to Facebook group pages, so a group is found either through its own page or through a post inside it: author.ext.search_hit.match says which (group_page or post_in_group), and author.ext.search_hit also carries the hit's title, snippet and evidence_url (the exact page that matched). A group found only through a post has display_name: null, because a post's title is not the group's name. The search hit carries no member count, description, privacy or creation date, so on a plain call author.followers, author.bio, author.joined_at and author.ext.group are null. Send include=details and every group is joined, in the same call, to the group lookup: the member count, the description, the creation date, the privacy and visibility labels, the posting activity (author.ext.group.activity), the numeric id (author.ext.group.id) and, where it was null, the name land on each row. Cost: 1 credit for the page plus 1 credit per group whose member count, description or activity was filled from a fresh lookup (at most 10 groups a page, so 11 credits at most); groups already in cache are free, groups that could not be filled are refunded, and a repeat of the same call within the cache window is 0 credits. Time: a plain page takes about 2 to 5 seconds; include=details adds 3 to 7 seconds on a fresh page (the lookups run in parallel and the call waits for the slowest, never more than 12 seconds) and nothing when the groups are already cached. The response carries a hydration block itemising rows, lookups, cache hits, credits and milliseconds. Every row also carries computed.relevance against your query, free, and relevance=filter drops the groups that are not about it. A page holds up to 10 groups, fewer when several hits belong to one group. Forward pagination.next_cursor as cursor for the next page. The same group can appear again on a later page, and once under its vanity name and once under its numeric id, so dedupe on author.ext.group.id after include=details when that matters. A group can be public in the search and still private to read: check author.ext.group.privacy_label before calling group/posts.

get/facebook/search/groups

Request

  • Base URL: https://www.socialcrawl.dev/v1
  • URL: https://www.socialcrawl.dev/v1/facebook/search/groups
  • Auth: API key in header x-api-key

Query parameters

querystring required

Keywords describing the groups to find, for example vintage cars. Keywords only: the search is already limited to public Facebook groups, so a site: operator is refused before billing.

pageinteger

Page number, starting at 1. Forwarding pagination.next_cursor as cursor does the same. Native upstream cursor param. Send the universal cursor instead: the API maps it to this name for you.

include'details'

Set to details (one token only) to fill, on every group in this one call, author.followers (members), author.bio (the description), author.joined_at, author.ext.group.privacy_label, visibility_label, activity and id (the numeric group id), and the name where it was null. Holds 1 credit per group (at most 10 a page) and keeps only the groups whose member count, description or activity was filled from a fresh lookup; groups already in cache and groups the lookup cannot fill are refunded, so a page is never more than 11 credits. The join takes 3 to 7 seconds on a fresh page, never more than 12, and nothing when the groups are already cached; read data.hydration for the rows, the credits held and kept, and the time. Without it the call is unchanged.

relevance'score' | 'filter'

Optional. Without this param every row already carries computed.relevance against your query, free ({ p, sense, depth, spam }: is this row about what your query means, or a different thing that shares its words?), and nothing is dropped or reordered. score asks for it explicitly and waits for every row; filter also drops the rows that are not about your query, and lists their ids in data.relevance.dropped_ids. Your query is the topic; nothing to configure. A row that could not be judged is never dropped and carries relevance: null. Pagination is unchanged, so a filtered page can hold fewer rows. Free with your query as the topic; with relevant_to it adds 1 credit per started 25 newly judged rows (rows already judged for the same topic are free, and so is a cached page).

relevance_thresholdstring

Optional, only with relevance. The probability (0 to 1) a row must reach to be kept by relevance=filter. Default 0.5. Lower keeps more rows, higher keeps fewer.

relevant_tostring

Optional, only with relevance. Up to 200 characters describing what you mean, used as the topic instead of the query. Use it when the query is ambiguous, for example query=cleopatra with relevant_to=Cleopatra, the IGT slot game.

judgments'on' | 'off'

Optional, on (the default) or off. By default every row gains free SocialCrawl judgments (computed.labels, and computed.relevance on search endpoints), reported in data.labels (mode default) and data.relevance (origin default), each with a status (complete, partial or skipped) and pending: the rows still being judged when the page was sent, which carry null now and are filled on your next call or cached read. Default judgments never add credits, never change an existing field, and never drop or reorder a row. off returns the page exactly as before, with none of those keys. label=none does the same.

dry_run'1'

Optional. When 1, return a cost preview for this labelled or relevance-filtered request without fetching the page or judging any row. data.estimate reports rows_expected, rows_cached, label_credits_min, label_credits_max and base_credits. 0 credits charged.

fit'goal'

Optional. When goal, keep the rows and fields needed for the goal you pass in goal= (plus any that are uncertain, and the first and last), and replace the rest with a stub. data.held_back lists the held ids and a recall id that re-reads the full page from cache at no extra charge. Without this param the page is unchanged.

goalstring

Required by fit=goal. What you are trying to do, in your own words, up to 300 characters.

fit_tokensinteger

Optional, only with fit=goal. Soft cap on how much of the page to keep, in tokens. Uncertain blocks and the first and last block are kept even if they exceed it.

cursorstring

Universal pagination cursor. Send pagination.next_cursor from the previous response back verbatim: the API maps it to this endpoint's native page (page style). You never construct, decode, or look up a cursor. Omit it for page 1.

Headers

Cache-Controlstring

Send no-cache to bypass the response cache and force a live fetch. Billed at the normal endpoint cost; the fresh result is written back to cache for the next caller. Only the no-cache directive triggers this. See the Response Schema guide for details.

Idempotency-Keystring

Optional UUID that makes the request safely retriable. The key is reserved atomically per account before billing. A concurrent retry receives 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After of 1 second while the original is young, growing to a quarter of the time it has been running (at most 30); a crashed reservation expires after 5 minutes. A replay keeps the cached payload immutable except for billing metadata: credits_used becomes 0, idempotent_replay becomes true, and credits_remaining is refreshed to the current balance. A known current balance appears in both the body and X-Credits-Remaining header; no balance row resolves to 0. On a transient lookup failure, body credits_remaining is null and X-Credits-Remaining is omitted. Completed outcomes expire after 24 hours. If the claim store is unavailable, the request fails closed before billing. GET endpoints do not combine idempotent replay with Server-Sent Events: use Accept: application/json when sending this header. The unsupported key-plus-SSE combination is rejected before billing.

Response

Successful response

successboolean required

Whether the request succeeded

platformstring required

Platform name

endpointstring required

API endpoint path

credits_usedinteger required

Number of credits consumed

credits_remaininginteger nullable required

Current account balance, or null when this response could not establish one. Free cache hits always return null because they do not establish an authoritative post-request balance. An idempotency replay also returns null when its current-balance lookup fails. It is never a fabricated zero, so a zero here means the account really is empty. The authoritative reading is the one on a billed response, which comes straight from the deduction.

request_idstring required

Unique request identifier for support

cachedboolean required

Whether the response was served from cache

idempotent_replayboolean

True only when this response is an idempotency replay

Example response

{
  "success": true,
  "platform": "facebook",
  "endpoint": "/v1/facebook/search/groups",
  "credits_used": 1,
  "credits_remaining": 4999,
  "request_id": "req-abc123",
  "idempotent_replay": true,
  "meta": {
    "hint": {
      "code": "search_multi",
      "message": "You searched \"matcha\" on 3 platforms one call at a time; /v1/search/multi returns each platform's own search rows in one call at the same price per platform, and a platform with no rows is not charged.",
      "method": "GET",
      "path": "/v1/search/multi?query=matcha&platforms=instagram,tiktok,youtube"
    }
  },
  "pagination": {
    "next_cursor": "sc.eyJ2IjoyLCJjIjoiMiIsInAiOiJwYWdlIn0",
    "has_more": true,
    "page_size": 30,
    "stopped_at": "known_id"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.