Guide to Facebook channel data

You can perform Facebook channel searches by calling the Meta Content Library API client get() method with the facebook/channels/preview path. This document describes the parameters, and shows how to perform basic queries using the method.

All of the examples in this document are taken from a Secure Research Environment use case and assume you have created a Jupyter notebook and a client object. See Getting started to learn more.

See Data dictionary for detailed information about the fields that are available on a Facebook channel node

Parameters

Parameter Type Description

Q
Required if ADMIN_IDS parameter is not provided. Optional otherwise.

List

Keyword(s) to search for. Searches the channel name field. See Advanced search guidelines for information about how multiple keyword searches with Boolean operators are handled.

ADMIN_IDS
Required if Q parameter is not provided. Optional otherwise.

String

Comma-separated list of Meta Content Library Facebook Page or profile IDs of the channel admins to include in the search.

SORT
Optional

Enum

Sorting mode in which the channels are returned (only for synchronous endpoint). Available options:

  • most_to_least_member_count: Channels are sorted by member count, from most to least.
  • newest_to_oldest: Channels are returned in reverse chronological order (newest first).
  • oldest_to_newest: Channels are returned in chronological order (oldest first).

Default value: most_to_least_member_count

MEMBER_COUNT_MIN
Optional

Int

Returns channels with the specified minimum number of members. Can be used with MEMBER_COUNT_MAX to specify a member count range.

MEMBER_COUNT_MAX
Optional

Int

Returns channels with the specified maximum number of members or fewer. Can be used with MEMBER_COUNT_MIN to specify a member count range. If you specify a member count maximum but no minimum, the minimum defaults to 0.

IS_ADMIN_VERIFIED
Optional

Boolean

Whether the Facebook Page or profile of the channel admin is verified.

SINCE
Optional

String or Integer

Date in YYYY-MM-DD (date only) or UNIX timestamp (translates to a date and time to the second) format. Facebook channels created on or after this date or timestamp are returned (used with UNTIL to define a time range). SINCE and UNTIL are based on UTC time zone, regardless of the local time zone of the user who made the comment.

  • If both SINCE and UNTIL are included, the query includes the time range defined by those values.
  • If SINCE is included and UNTIL is omitted, the query includes the SINCE time through the present time.
  • If SINCE is omitted and UNTIL is included, the query goes from the beginning of Facebook time through the UNTIL time.
  • If SINCE and UNTIL are both omitted, the query goes from the beginning of Facebook time to the present time.
  • If SINCE and UNTIL are the same UNIX timestamp, the query includes the SINCE time through the SINCE time plus one hour.
  • If SINCE and UNTIL are the same date (YYYY-MM-DD), the query includes the SINCE date through the SINCE date plus one day.

UNTIL
Optional

String or Integer

Date in YYYY-MM-DD (date only) or UNIX timestamp (translates to a date and time to the second) format. Facebook channels created on or after this date or timestamp are returned (used with SINCE to define a time range). SINCE and UNTIL are based on UTC time zone, regardless of the local time zone of the user who made the comment.

  • If both SINCE and UNTIL are included, the query includes the time range defined by those values.
  • If SINCE is included and UNTIL is omitted, the query includes the SINCE time through the present time.
  • If SINCE is omitted and UNTIL is included, the query goes from the beginning of Facebook time through the UNTIL time.
  • If SINCE and UNTIL are both omitted, the query goes from the beginning of Facebook time to the present time.
  • If SINCE and UNTIL are the same UNIX timestamp, the query includes the SINCE time through the SINCE time plus one hour.
  • If SINCE and UNTIL are the same date (YYYY-MM-DD), the query includes the SINCE date through the SINCE date plus one day.

Sample queries

Search for channels by keyword

To search for Facebook channels that contain a specific keyword use the get() method with the q parameter. See Advanced search guidelines for information about how multiple keyword searches are handled.

library(reticulate)
client <- import("metacontentlibraryapi")$MetaContentLibraryAPIClient

client$set_default_version(client$LATEST_VERSION)

response <- client$get(path="facebook/channels/preview", params=list("q"="meta"))
jsonlite::fromJSON(response$text, flatten=TRUE) # Display first page
from metacontentlibraryapi import MetaContentLibraryAPIClient as client

client.set_default_version(client.LATEST_VERSION)

response = client.get(
    path="facebook/channels/preview",
    params={"q":"meta"},
)
display(response.json()) # Display first page

Search for channels by channel admin ID

You can search for Instagram channels using specific admin account IDs obtained from previous channel searches.

For example, to get data on specific Facebook channels (specific admin account IDs) that contain specific keywords or phrases, use the get() method with the admin_ids parameter (specifying the list of admin account IDs you want included), and the q parameter specifying the keywords. If you omit the q parameter, all channels with admins from the list of IDs provided are included.

response <- client$get(path="facebook/channels/preview", params=list("admin_ids"="693175016186503"))
jsonlite::fromJSON(response$text, flatten=TRUE) # Display first page
response = client.get(
    path="facebook/channels/preview",
    params={"admin_ids":["693175016186503"]},
)
display(response.json()) # Display first page