SDKs
Official open-source clients for Python, JavaScript/TypeScript and Go. All three cover every endpoint, return typed responses for the main resources, and use cursor pagination.
Python
pip install socialapis-sdk
from socialapis import Facebook, Instagram
fb = Facebook(api_token="YOUR_API_KEY")
page = fb.get_page_info("nike")
print(page.title, page.followers_count)
ig = Instagram(api_token="YOUR_API_KEY")
profile = ig.get_profile_details("nike")
print(profile.username, profile.followers_count)
Async clients (AsyncFacebook, AsyncInstagram) are included. The package is socialapis-sdk on PyPI; the import name is socialapis.
JavaScript / TypeScript
npm install socialapis-sdk
import { Facebook, Instagram } from "socialapis-sdk";
const fb = new Facebook({ apiToken: "YOUR_API_KEY" });
const page = await fb.getPageInfo("nike");
console.log(page.title, page.followers_count);
const ig = new Instagram({ apiToken: "YOUR_API_KEY" });
const profile = await ig.getProfileDetails("nike");
console.log(profile.username, profile.followers_count);
Runs on Node.js 18+, Bun, Deno and browsers. Ships ESM and CommonJS builds.
Go
go get github.com/SocialAPIsHub/socialapis-go
package main
import (
"context"
"fmt"
"log"
socialapis "github.com/SocialAPIsHub/socialapis-go"
)
func main() {
fb, err := socialapis.NewFacebook("YOUR_API_KEY")
if err != nil {
log.Fatal(err)
}
page, err := fb.GetPageInfo(context.Background(), "nike", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(page.Title, page.FollowersCount)
}
No external dependencies. Errors are typed, so you can check them with errors.As.
Pagination
List endpoints return an end_cursor. Pass it back to get the next page. See each SDK's README for the exact method signature.
Migrating from an abandoned scraper?
The Python SDK includes FacebookScraper and InstagramScraper aliases for code written against kevinzg/facebook-scraper and arc298/instagram-scraper. See the Python SDK README.