You can perform Instagram channel searches by calling the Meta Content Library API client get() method with the instagram/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 an Instagram channel node.
| Parameter | Type | Description |
|---|---|---|
| List | Keyword(s) to search for. Searches the channel |
| String | Comma-separated list of Meta Content Library Instagram account 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 Instagram account of the channel admin is verified. An Instagram account with a legacy blue verified badge means that Instagram has confirmed that it is the authentic presence for that person or brand. Learn more about verified badges. |
| String or Integer | Date in YYYY-MM-DD (date only) or UNIX timestamp (translates to a date and time to the second) format. Instagram 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. Instagram channels created on or after this date or timestamp are returned (used with
|
To search for Instagram 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="instagram/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 Instagram 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="instagram/channels/preview", params=list("admin_ids"="993204391916661"))
jsonlite::fromJSON(response$text, flatten=TRUE) # Display first page