Facebook and Instagram data in Google Sheets
SocialAPIs (socialapis.io) is a public Facebook and Instagram data API. The Sheets add-on turns it into formulas: Page followers, Instagram profiles and posts, Meta Ads Library ads, one cell at a time.
Install
Set it up in a minute
- 1The add-on is coming soon to the Google Workspace Marketplace. Sign up now and your key will be ready when it's listed.
- 2Create a free account and copy your API key from the dashboard (200 calls a month, no card).
- 3In Sheets, open Extensions → SocialAPIs → Set API key, paste the key and select Check and save. The check uses the free
/usageendpoint. - 4Type a formula such as
=SOCIALAPIS_FB_PAGE("nasa", "followers"), or use Extensions → SocialAPIs → Insert example sheet.
Reference
Functions
; instead of ,: =SOCIALAPIS_FB_PAGE("nasa"; "followers").=SOCIALAPIS_FB_PAGE(link, [field], [exact])1 (5 with exact TRUE) credit · GET /facebook/pages/detailsOne field (name, followers, followers_display, likes, likes_display, category, verified, url, ad_page_id, image), or every field as a 2-row table when field is empty. Big Pages show a rounded follower count (e.g. 28M); add TRUE for the exact number.
=SOCIALAPIS_FB_PAGE_ID(link)1 credit · GET /facebook/pages/idThe numeric Page ID, as text.
=SOCIALAPIS_IG_PROFILE(username, [field])1 credit · GET /instagram/profile/detailsOne field (username, full_name, followers, following, posts, bio, verified, private, category, url), or every field as a 2-row table.
=SOCIALAPIS_IG_POSTS(username)1 credit · GET /instagram/profile/postsOne row per post of the first page: post_url, shortcode, type, likes, views, owner, counts_hidden.
=SOCIALAPIS_FB_ADS(keywordOrAdPageId, [country])1 credit · GET /facebook/ads/searchActive ads in the Meta Ads Library, one row per ad: advertiser, headline, text, call to action, platforms, start date, landing domain, Ads Library link.
=SOCIALAPIS_FB_POSTS(link, [limit])1 for 3 posts credit · GET /facebook/pages/postsThe Page's latest posts, one row per post, with the API's own fields as columns. limit 3 to 9 (5-7 posts = 2 credits, 8-9 = 3).
=SOCIALAPIS(endpoint, [params])the endpoint's credit · GET any endpointAny SocialAPIs endpoint as a table, e.g. =SOCIALAPIS("/facebook/search/pages", "query=coffee shop&limit=5"). Every endpoint in the API reference works.
=SOCIALAPIS_USAGE([field])free · GET /usageCredits left (default), credits used, usage %, plan, reset date.
link takes a Page URL or username (nasa, facebook.com/nasa). For ads, a keyword searches active ads in a country (default US); a numeric ad_page_id (from =SOCIALAPIS_FB_PAGE(link, "ad_page_id")) lists one Page's ads. Lists return the first page of results. Endpoint details: API reference.
Example
Track competitor Pages
| A | B | C | |
| 1 | Page | Followers | Category |
| 2 | https://www.facebook.com/nasa | =SOCIALAPIS_FB_PAGE(A2, "followers") | =SOCIALAPIS_FB_PAGE(A2, "category") |
| 3 | https://www.facebook.com/spacex | =SOCIALAPIS_FB_PAGE(A3, "followers") | =SOCIALAPIS_FB_PAGE(A3, "category") |
Two fields of the same Page share one cached call when one finishes before the other starts, so this sheet costs 2 to 4 credits the first time, then nothing for 10 minutes.
Your key
Where the API key goes
- Stored in your Google account's properties for the add-on, shown back only as its last 4 characters.
- Sent only to
https://api.socialapis.ioin thex-api-tokenheader, never in a URL or a cell. - In a shared spreadsheet, formulas use the key of the spreadsheet's owner (a Google rule for custom functions). Anyone who can edit the sheet can add formulas that spend the owner's credits.
Pricing
Same credits as the API
Get your API key
200 free calls a month, no card. The same key works in Sheets, the SDKs, n8n and MCP.