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
| Parameter | Type | Description |
|---|---|---|
| List | Keyword(s) to search for. Searches the channel |
| String | Comma-separated list of Meta Content Library Facebook Page or profile IDs of the channel admins to include in the search. |
| Enum | Sorting mode in which the channels are returned (only for synchronous endpoint). Available options:
Default value: |
| Int | Returns channels with the specified minimum number of members. Can be used with |
| Int | Returns channels with the specified maximum number of members or fewer. Can be used with |
| Boolean | Whether the Facebook Page or profile of the channel admin is verified. |
| 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
|
| 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
|
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 pageYou 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