Facebook Topic Classification API. On each item you fetch.
What the item is about, as categories of the IAB Content Taxonomy's top level (most likely first; at most three), each with its probability. Add analysis=topics to any of 18 Facebook endpoints that offer it.
GET /v1/facebook/post?analysis=topics
One param on the request. Topics on each item.
The Facebook Post API returns each post with analysis.topics beside its fields.
curl -G 'https://socialtap.dev/v1/facebook/post' \
--data-urlencode 'url=https://www.facebook.com/reel/4075684206061398/' \
--data-urlencode 'analysis=topics' \
-H "x-api-key: $SOCIALTAP_API_KEY"// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
url: "https://www.facebook.com/reel/4075684206061398/",
analysis: "topics",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/post?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/post",
params={"url": "https://www.facebook.com/reel/4075684206061398/", "analysis": "topics"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, meta = body["data"], body["meta"]
print(data, meta["credits_charged"]){
"topics": [
"automotive"
],
"topics_probability": {
"automotive": 0.65
}
}Values are examples.
GET https://socialtap.dev/v1/facebook/postDocs What the value means.
The values below that apply, possibly none. topics_probability beside it maps each value returned to how sure it is, from 0 to 1.
| Value | Meaning |
|---|---|
automotive | cars, motorcycles, vehicles |
books_literature | books, writing, poetry |
business_finance | companies, industries, startups, the economy, marketing |
careers | jobs, hiring, workplaces, career advice |
education | schools, learning, courses, exams |
events_attractions | concerts, festivals, conferences, parks, museums |
family_relationships | parenting, dating, marriage, friendship |
fine_art | painting, sculpture, design, photography as art |
food_drink | cooking, recipes, restaurants, drinks |
healthy_living | fitness, nutrition, wellness, mental wellbeing |
hobbies_interests | crafts, collecting, DIY, outdoor hobbies |
home_garden | home improvement, decor, gardening, real estate living |
medical_health | diseases, treatments, doctors, medicine |
movies | films, cinema, actors |
music_audio | music, artists, podcasts, radio |
news_politics | news, politics, elections, government, world events |
personal_finance | saving, investing, crypto, taxes, debt, insurance |
pets | pets and animals |
pop_culture | celebrities, internet culture, memes, gossip |
real_estate | buying, selling and renting property |
religion_spirituality | religion, faith, spirituality, astrology |
science | science, research, space, the environment |
shopping | products, deals, retail, buying advice |
sports | sports, teams, athletes, betting on sports |
style_fashion | fashion, beauty, makeup, skincare |
technology_computing | software, apps, gadgets, AI, programming, the internet |
television | TV shows, streaming series |
travel | trips, destinations, hotels, airlines |
video_gaming | video games, gaming, esports |
Keep only what matches.
On a list, where keeps the items that pass. Every item judged is charged whether or not it passes, so a page can be short.
https://socialtap.dev/v1/facebook/posts?handle=NASA&analysis=topics&where=analysis.topics=automotive18 Facebook endpoints offer it.
Each adds the analysis to the posts, profiles, comments, transcripts, web results and ads it returns. Text analyses cost one flat amount per request, or per page on a list, however many you ask for.
-
Post
Facebook Post API
Post, photo, video or reel with exact counts
1 credit$0.75–$1.97 per 1,000 requestsGET /v1/facebook/post -
Post
Facebook Profile Posts API
Newest first, with exact reactions and shares
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/posts -
Post
Facebook Group Posts API
Public group posts with exact counts
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/group_posts -
Post
Facebook Profile Photos API
Full-size photos, uploaded or tagged
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/photos -
Post
Facebook Reels API
Newest first, with views and video files
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/reels -
Profile
Facebook Profile API
Exact follower count, contact info and hours
1 credit$0.75–$1.97 per 1,000 requestsGET /v1/facebook/profile -
Comment
Facebook Comments API
Top-level, with exact reactions and reply counts
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/comments -
Comment
Facebook Comment Replies API
Thread under a comment, both levels
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/replies -
Transcript
Facebook Video Transcript API
Timed transcript of a video or reel
From 1 credit$0.75–$1.97 per 1,000 requestsGET /v1/facebook/transcript -
Web result
Facebook Group Search API
Groups by topic, place or name
From 1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/search_groups -
Web result
Facebook Post Search API
Public posts and videos by keyword
From 1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/search_posts -
Web result
Facebook Page and People Search API
Pages and people by name, niche or place
From 1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/search_profiles -
Profile
Facebook Ad Library Advertiser API
Advertiser profile and linked Instagram
1 credit$0.75–$1.97 per 1,000 requestsGET /v1/facebook/advertiser -
Profile
Facebook Ad Library Advertiser Search API
Advertisers by name, with Page IDs
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/search_advertisers -
Transcript
Facebook Ad Transcript API
Timed transcript of what a video ad says
From 2 credits$1.50–$3.93 per 1,000 requestsGET /v1/facebook/ad_transcript -
Ad
Facebook Ad Library Ad API
Creatives, run dates, placements and EU reach
1 credit$0.75–$1.97 per 1,000 requestsGET /v1/facebook/ad -
Ad
Facebook Ad Library Advertiser Ads API
Active and past ads of one Page
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/ads -
Ad
Facebook Ad Library Search API
Ads by keyword, with creatives and run dates
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/facebook/search_ads
| Endpoint | Adds |
|---|---|
| Facebook Post API | +2 credits per request |
| Facebook Profile Posts API | +6 credits per page of 3 |
| Facebook Group Posts API | +6 credits per page of 3 |
| Facebook Profile Photos API | +14 credits per page of 8 |
| Facebook Reels API | +18 credits per page of 10 |
| Facebook Profile API | +2 credits per request |
| Facebook Comments API | +16 credits per page of 10 |
| Facebook Comment Replies API | +16 credits per page of 10 |
| Facebook Video Transcript API | +6 credits per request |
| Facebook Group Search API | +52 credits per page of 50 |
| Facebook Post Search API | +52 credits per page of 50 |
| Facebook Page and People Search API | +52 credits per page of 50 |
| Facebook Ad Library Advertiser API | +2 credits per request |
| Facebook Ad Library Advertiser Search API | +17 credits per page of 15 |
| Facebook Ad Transcript API | +6 credits per request |
| Facebook Ad Library Ad API | +1 credit per request |
| Facebook Ad Library Advertiser Ads API | +10 credits per page of 10 |
| Facebook Ad Library Search API | +10 credits per page of 10 |
More analyses on Facebook and beyond.
The same answer on other platforms, and other answers here.
Questions about Facebook topic classification
The analyses guide has the rest.
Which Facebook endpoints offer topic classification?
How much does an analysis cost?
Do I pay when an analysis can't answer?
Can I get only the items that match?
Which languages do analyses answer in?
Can I use my own categories or questions?
Send your first request in a minute.
Get a key, send a link you already have and see what comes back. The same key works on every platform.
- No credit card
- Failed requests are free
- Works on all 319 endpoints