Documentation
¶
Overview ¶
Package socialapis is the Go SDK for the SocialAPIs.io REST API. It mirrors the Python `socialapis-sdk` and TypeScript `socialapis-sdk` — same endpoint coverage, idiomatic per-language conventions.
Index ¶
- Constants
- type APIError
- type APIServerError
- type Account
- type AuthenticationError
- type BadRequestError
- type ConnectionError
- type Error
- type Facebook
- func (f *Facebook) DownloadMedia(ctx context.Context, mediaURL string, extra map[string]any) (Response, error)
- func (f *Facebook) GetAdArchiveDetails(ctx context.Context, adArchiveID, pageID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetAdsCountries(ctx context.Context, extra map[string]any) (Response, error)
- func (f *Facebook) GetAdsPageDetails(ctx context.Context, pageID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetCityCoordinates(ctx context.Context, city string, extra map[string]any) (Response, error)
- func (f *Facebook) GetCommentReplies(ctx context.Context, commentFeedbackID, expansionToken string, ...) (Response, error)
- func (f *Facebook) GetGroupDetails(ctx context.Context, group string, extra map[string]any) (*GroupInfo, error)
- func (f *Facebook) GetGroupID(ctx context.Context, group string, extra map[string]any) (Response, error)
- func (f *Facebook) GetGroupMetadata(ctx context.Context, group string, extra map[string]any) (Response, error)
- func (f *Facebook) GetGroupPosts(ctx context.Context, group string, extra map[string]any) (Response, error)
- func (f *Facebook) GetGroupVideos(ctx context.Context, groupID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetListingDetails(ctx context.Context, listingID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetMarketplaceCategories(ctx context.Context, extra map[string]any) (Response, error)
- func (f *Facebook) GetPageID(ctx context.Context, page string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPageInfo(ctx context.Context, page string, extra map[string]any) (*PageInfo, error)
- func (f *Facebook) GetPagePosts(ctx context.Context, page string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPageReels(ctx context.Context, page string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPageVideos(ctx context.Context, page string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPostAttachments(ctx context.Context, postID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPostComments(ctx context.Context, post string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPostDetails(ctx context.Context, post string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPostDetailsExtended(ctx context.Context, post string, extra map[string]any) (Response, error)
- func (f *Facebook) GetPostID(ctx context.Context, post string, extra map[string]any) (Response, error)
- func (f *Facebook) GetSellerDetails(ctx context.Context, sellerID string, extra map[string]any) (Response, error)
- func (f *Facebook) GetVideoPostDetails(ctx context.Context, videoID string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchAds(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchAdsByKeywords(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchLocations(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchMarketplace(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchPages(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchPeople(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchPosts(ctx context.Context, query string, extra map[string]any) (Response, error)
- func (f *Facebook) SearchRentals(ctx context.Context, extra map[string]any) (Response, error)
- func (f *Facebook) SearchVehicles(ctx context.Context, extra map[string]any) (Response, error)
- func (f *Facebook) SearchVideos(ctx context.Context, query string, extra map[string]any) (Response, error)
- type FacebookScraper
- type GroupInfo
- type HTTPDoer
- type Instagram
- func (i *Instagram) GetHighlightDetails(ctx context.Context, highlightID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetLocationPosts(ctx context.Context, locationID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetNearbyLocations(ctx context.Context, locationID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetPostDetails(ctx context.Context, shortcode string, extra map[string]any) (Response, error)
- func (i *Instagram) GetPostID(ctx context.Context, post string, extra map[string]any) (Response, error)
- func (i *Instagram) GetProfileDetails(ctx context.Context, username string, extra map[string]any) (*ProfileInfo, error)
- func (i *Instagram) GetProfileHighlights(ctx context.Context, userID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetProfilePosts(ctx context.Context, username string, extra map[string]any) (Response, error)
- func (i *Instagram) GetProfileReels(ctx context.Context, userID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetReelsByAudio(ctx context.Context, audioID string, extra map[string]any) (Response, error)
- func (i *Instagram) GetReelsFeed(ctx context.Context, extra map[string]any) (Response, error)
- func (i *Instagram) GetUserID(ctx context.Context, profile string, extra map[string]any) (Response, error)
- func (i *Instagram) Search(ctx context.Context, keyword string, extra map[string]any) (Response, error)
- type InstagramScraper
- type InsufficientCreditsError
- type Option
- type PageInfo
- type ProfileInfo
- type RateLimitError
- type Response
Constants ¶
const DefaultBaseURL = "https://api.socialapis.io"
DefaultBaseURL is the production socialapis.io REST endpoint.
const DefaultTimeout = 30 * time.Second
DefaultTimeout for HTTP requests when no per-call deadline is set via context.
const Version = "0.1.1"
Version of the SDK. Bumped by the release workflow on `git tag vX.Y.Z`.
Lockstep with the Python (`socialapis-sdk` on PyPI) and JavaScript (`socialapis-sdk` on npm) SDKs in this family. All three start at 0.1.1 so users know the SDKs are at feature parity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is returned for any HTTP error response from the API. Specific 4xx/5xx flavours are typed below — use errors.As to dispatch.
type APIServerError ¶
type APIServerError struct{ APIError }
APIServerError is 5xx — the API failed. Safe to retry with backoff.
func (*APIServerError) Error ¶
func (e *APIServerError) Error() string
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account is the synchronous client for account-level endpoints — usage, credits, rate-limit info. None of these calls consume credits.
acc, err := socialapis.NewAccount("YOUR_API_TOKEN")
usage, err := acc.GetUsage(ctx)
func NewAccount ¶
NewAccount constructs an Account client.
func (*Account) GetLimits ¶
GetLimits returns your plan's rate limit, concurrent-task cap, allowed packages.
type AuthenticationError ¶
type AuthenticationError struct{ APIError }
AuthenticationError is 401 — the API token is invalid or missing. Not retryable; the caller has to fix the token.
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
type BadRequestError ¶
type BadRequestError struct{ APIError }
BadRequestError is 4xx (excluding 401/402/429) — client-side mistake. NOT retryable without fixing input.
func (*BadRequestError) Error ¶
func (e *BadRequestError) Error() string
type ConnectionError ¶
ConnectionError is a network failure / timeout / non-JSON response. Almost always transient. Safe to retry with backoff.
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
type Error ¶
type Error interface {
error
// contains filtered or unexported methods
}
Error is the base interface that every SDK-originating error satisfies. Callers can catch broadly with `errors.As(err, &socialapis.Error{...})` or narrowly with the typed subtypes below.
type Facebook ¶
type Facebook struct {
// contains filtered or unexported fields
}
Facebook is the synchronous client for the Facebook surface of the SocialAPIs.io REST API. Construct with NewFacebook; every method takes a context.Context as the first argument (idiomatic Go).
fb, err := socialapis.NewFacebook("YOUR_API_TOKEN")
if err != nil { ... }
ctx := context.Background()
page, err := fb.GetPageInfo(ctx, "EngenSA", nil)
FacebookScraper is an alias so users migrating from popular but abandoned scrapers can keep their import line greppable. See alias.go.
func NewFacebook ¶
NewFacebook constructs a Facebook client. The apiToken is required.
Get a free key (200 calls/month, no card) at https://socialapis.io/auth/signup.
func (*Facebook) DownloadMedia ¶
func (f *Facebook) DownloadMedia(ctx context.Context, mediaURL string, extra map[string]any) (Response, error)
DownloadMedia resolves a Facebook video/photo URL to a downloadable URL.
func (*Facebook) GetAdArchiveDetails ¶
func (f *Facebook) GetAdArchiveDetails(ctx context.Context, adArchiveID, pageID string, extra map[string]any) (Response, error)
GetAdArchiveDetails returns detailed info for a specific archived ad.
func (*Facebook) GetAdsCountries ¶
GetAdsCountries returns all country codes supported by the Meta Ads Library.
func (*Facebook) GetAdsPageDetails ¶
func (f *Facebook) GetAdsPageDetails(ctx context.Context, pageID string, extra map[string]any) (Response, error)
GetAdsPageDetails returns Ads-Library metadata for a Facebook Page.
func (*Facebook) GetCityCoordinates ¶
func (f *Facebook) GetCityCoordinates(ctx context.Context, city string, extra map[string]any) (Response, error)
GetCityCoordinates resolves a city name to GPS coordinates.
func (*Facebook) GetCommentReplies ¶
func (f *Facebook) GetCommentReplies(ctx context.Context, commentFeedbackID, expansionToken string, extra map[string]any) (Response, error)
GetCommentReplies returns replies to a specific comment. Both inputs come from GetPostComments when called with include_reply_info=true.
func (*Facebook) GetGroupDetails ¶
func (f *Facebook) GetGroupDetails(ctx context.Context, group string, extra map[string]any) (*GroupInfo, error)
GetGroupDetails returns typed GroupInfo. This endpoint has NO envelope wrapper — payload is at the top level.
func (*Facebook) GetGroupID ¶
func (f *Facebook) GetGroupID(ctx context.Context, group string, extra map[string]any) (Response, error)
GetGroupID returns the numeric Facebook Group ID.
func (*Facebook) GetGroupMetadata ¶
func (f *Facebook) GetGroupMetadata(ctx context.Context, group string, extra map[string]any) (Response, error)
GetGroupMetadata returns lightweight Group metadata (name, id, url, image).
func (*Facebook) GetGroupPosts ¶
func (f *Facebook) GetGroupPosts(ctx context.Context, group string, extra map[string]any) (Response, error)
GetGroupPosts returns recent posts from a Facebook Group.
func (*Facebook) GetGroupVideos ¶
func (f *Facebook) GetGroupVideos(ctx context.Context, groupID string, extra map[string]any) (Response, error)
GetGroupVideos returns videos posted to a Group (takes numeric group_id).
func (*Facebook) GetListingDetails ¶
func (f *Facebook) GetListingDetails(ctx context.Context, listingID string, extra map[string]any) (Response, error)
GetListingDetails returns full info for a Marketplace listing.
func (*Facebook) GetMarketplaceCategories ¶
func (f *Facebook) GetMarketplaceCategories(ctx context.Context, extra map[string]any) (Response, error)
GetMarketplaceCategories returns all Marketplace categories.
func (*Facebook) GetPageID ¶
func (f *Facebook) GetPageID(ctx context.Context, page string, extra map[string]any) (Response, error)
GetPageID returns the numeric Facebook Page ID for a URL or slug. Backed by GET /facebook/pages/id.
func (*Facebook) GetPageInfo ¶
func (f *Facebook) GetPageInfo(ctx context.Context, page string, extra map[string]any) (*PageInfo, error)
GetPageInfo returns typed metadata for a Facebook Page. Backed by GET /facebook/pages/details. Unwraps the API's "0"-keyed envelope before populating PageInfo.
func (*Facebook) GetPagePosts ¶
func (f *Facebook) GetPagePosts(ctx context.Context, page string, extra map[string]any) (Response, error)
GetPagePosts returns recent posts from a Facebook Page (cursor-paginated).
func (*Facebook) GetPageReels ¶
func (f *Facebook) GetPageReels(ctx context.Context, page string, extra map[string]any) (Response, error)
GetPageReels returns Reels (short videos) from a Facebook Page.
func (*Facebook) GetPageVideos ¶
func (f *Facebook) GetPageVideos(ctx context.Context, page string, extra map[string]any) (Response, error)
GetPageVideos returns long-form videos from a Facebook Page.
func (*Facebook) GetPostAttachments ¶
func (f *Facebook) GetPostAttachments(ctx context.Context, postID string, extra map[string]any) (Response, error)
GetPostAttachments returns all media attachments from a post.
func (*Facebook) GetPostComments ¶
func (f *Facebook) GetPostComments(ctx context.Context, post string, extra map[string]any) (Response, error)
GetPostComments returns comments on a Facebook post or reel. Pass include_reply_info="true" via extra to get reply cursors.
func (*Facebook) GetPostDetails ¶
func (f *Facebook) GetPostDetails(ctx context.Context, post string, extra map[string]any) (Response, error)
GetPostDetails returns full details of a Facebook post.
func (*Facebook) GetPostDetailsExtended ¶
func (f *Facebook) GetPostDetailsExtended(ctx context.Context, post string, extra map[string]any) (Response, error)
GetPostDetailsExtended returns extended post details (views, video URLs, music info).
func (*Facebook) GetPostID ¶
func (f *Facebook) GetPostID(ctx context.Context, post string, extra map[string]any) (Response, error)
GetPostID extracts the numeric Facebook post ID from a post URL.
func (*Facebook) GetSellerDetails ¶
func (f *Facebook) GetSellerDetails(ctx context.Context, sellerID string, extra map[string]any) (Response, error)
GetSellerDetails returns seller profile, ratings, reviews from Marketplace.
func (*Facebook) GetVideoPostDetails ¶
func (f *Facebook) GetVideoPostDetails(ctx context.Context, videoID string, extra map[string]any) (Response, error)
GetVideoPostDetails returns title, reactions, and play counts for a video post.
func (*Facebook) SearchAds ¶
func (f *Facebook) SearchAds(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchAds searches ads in the Meta Ad Library by keyword.
func (*Facebook) SearchAdsByKeywords ¶
func (f *Facebook) SearchAdsByKeywords(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchAdsByKeywords searches ads in the Ad Library by keyword + country.
func (*Facebook) SearchLocations ¶
func (f *Facebook) SearchLocations(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchLocations searches Facebook for locations matching a keyword.
func (*Facebook) SearchMarketplace ¶
func (f *Facebook) SearchMarketplace(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchMarketplace searches Facebook Marketplace listings.
func (*Facebook) SearchPages ¶
func (f *Facebook) SearchPages(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchPages searches Facebook pages by keyword. Pass location_id via extra for geo filtering.
func (*Facebook) SearchPeople ¶
func (f *Facebook) SearchPeople(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchPeople searches Facebook profiles by keyword.
func (*Facebook) SearchPosts ¶
func (f *Facebook) SearchPosts(ctx context.Context, query string, extra map[string]any) (Response, error)
SearchPosts searches Facebook posts by keyword.
func (*Facebook) SearchRentals ¶
SearchRentals searches Marketplace rental-property listings.
func (*Facebook) SearchVehicles ¶
SearchVehicles searches Marketplace vehicle listings. Requires lat/lng filters via extra.
type FacebookScraper ¶
type FacebookScraper = Facebook
FacebookScraper is an alias for Facebook. It exists so users migrating from popular abandoned scrapers can keep their import path / type name greppable in their codebase.
FacebookScraper and Facebook are the EXACT same type — not a wrapper.
func NewFacebookScraper ¶
func NewFacebookScraper(apiToken string, opts ...Option) (*FacebookScraper, error)
NewFacebookScraper constructs a FacebookScraper (= Facebook) client.
Provided as a sibling to NewFacebook so the migration story stays a one-line constructor swap.
type GroupInfo ¶
type GroupInfo struct {
GroupID string `json:"group_id,omitempty"`
GroupMemberCount string `json:"group_member_count,omitempty"`
GroupTotalMembersInfoText string `json:"group_total_members_info_text,omitempty"`
GroupNewMembersInfoText string `json:"group_new_members_info_text,omitempty"`
DescriptionText string `json:"description_text,omitempty"`
PrivacyInfoText map[string]any `json:"privacy_info_text,omitempty"`
CreatedTime int64 `json:"created_time,omitempty"`
GroupRules []any `json:"group_rules,omitempty"`
GroupHistory map[string]any `json:"group_history,omitempty"`
AdminTags []any `json:"admin_tags,omitempty"`
GroupLocations []any `json:"group_locations,omitempty"`
NumberOfPostsInLastDay int `json:"number_of_posts_in_last_day,omitempty"`
NumberOfPostsInLastMonth int `json:"number_of_posts_in_last_month,omitempty"`
// Forward-compat
Extra map[string]any `json:"-"`
}
GroupInfo is the response from `Facebook.GetGroupDetails()` — `GET /facebook/groups/details`.
NOTE: this endpoint has NO envelope wrapper — payload sits at the top level alongside `message` and `meta`.
type HTTPDoer ¶
HTTPDoer is the minimum interface the SDK needs from an HTTP client. stdlib's *http.Client satisfies this. Custom implementations (e.g. adding retry logic, metrics, or per-request tracing) can also be dropped in via WithHTTPClient.
type Instagram ¶
type Instagram struct {
// contains filtered or unexported fields
}
Instagram is the synchronous client for the Instagram surface of the SocialAPIs.io REST API. Same shape as Facebook — every method takes ctx context.Context as the first argument.
ig, err := socialapis.NewInstagram("YOUR_API_TOKEN")
profile, err := ig.GetProfileDetails(ctx, "instagram", nil)
func NewInstagram ¶
NewInstagram constructs an Instagram client.
func (*Instagram) GetHighlightDetails ¶
func (i *Instagram) GetHighlightDetails(ctx context.Context, highlightID string, extra map[string]any) (Response, error)
GetHighlightDetails returns all stories within a specific Highlight.
func (*Instagram) GetLocationPosts ¶
func (i *Instagram) GetLocationPosts(ctx context.Context, locationID string, extra map[string]any) (Response, error)
GetLocationPosts returns posts tagged at a specific Instagram location. Pass tab="ranked" or tab="recent" via extra.
func (*Instagram) GetNearbyLocations ¶
func (i *Instagram) GetNearbyLocations(ctx context.Context, locationID string, extra map[string]any) (Response, error)
GetNearbyLocations returns Instagram locations near a given location.
func (*Instagram) GetPostDetails ¶
func (i *Instagram) GetPostDetails(ctx context.Context, shortcode string, extra map[string]any) (Response, error)
GetPostDetails returns full Instagram post details.
func (*Instagram) GetPostID ¶
func (i *Instagram) GetPostID(ctx context.Context, post string, extra map[string]any) (Response, error)
GetPostID extracts the shortcode/ID from any Instagram post URL.
func (*Instagram) GetProfileDetails ¶
func (i *Instagram) GetProfileDetails(ctx context.Context, username string, extra map[string]any) (*ProfileInfo, error)
GetProfileDetails returns typed ProfileInfo for an Instagram username. Unwraps the API's "data"-keyed envelope before populating.
func (*Instagram) GetProfileHighlights ¶
func (i *Instagram) GetProfileHighlights(ctx context.Context, userID string, extra map[string]any) (Response, error)
GetProfileHighlights returns all Story Highlights for a profile.
func (*Instagram) GetProfilePosts ¶
func (i *Instagram) GetProfilePosts(ctx context.Context, username string, extra map[string]any) (Response, error)
GetProfilePosts returns recent posts from an Instagram profile.
func (*Instagram) GetProfileReels ¶
func (i *Instagram) GetProfileReels(ctx context.Context, userID string, extra map[string]any) (Response, error)
GetProfileReels returns Reels for an Instagram profile. Takes a numeric user_id (use GetUserID to resolve a username first).
func (*Instagram) GetReelsByAudio ¶
func (i *Instagram) GetReelsByAudio(ctx context.Context, audioID string, extra map[string]any) (Response, error)
GetReelsByAudio returns all Reels using a specific audio track.
func (*Instagram) GetReelsFeed ¶
GetReelsFeed returns the trending Reels feed.
type InstagramScraper ¶
type InstagramScraper = Instagram
InstagramScraper is an alias for Instagram. Same migration story as FacebookScraper.
func NewInstagramScraper ¶
func NewInstagramScraper(apiToken string, opts ...Option) (*InstagramScraper, error)
NewInstagramScraper constructs an InstagramScraper (= Instagram) client.
type InsufficientCreditsError ¶
type InsufficientCreditsError struct{ APIError }
InsufficientCreditsError is 402 — credit balance exhausted. Retryable after refill / upgrade. Tracked as a distinct error so paid integrations can auto-top-up on this signal.
func (*InsufficientCreditsError) Error ¶
func (e *InsufficientCreditsError) Error() string
type Option ¶
type Option func(*baseConfig)
Option configures a Facebook / Instagram / Account client. Use the `With...` functions below — they cover every configurable behaviour.
func WithBaseURL ¶
WithBaseURL overrides the API base URL. Useful for staging or local mock servers.
func WithHTTPClient ¶
WithHTTPClient lets callers pass a custom HTTPDoer (typically an *http.Client with a different timeout or transport).
type PageInfo ¶
type PageInfo struct {
// Identifiers
AdPageID string `json:"ad_page_id,omitempty"`
UserID string `json:"user_id,omitempty"`
// Display
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
Category any `json:"category,omitempty"` // can be a list or a string
Status string `json:"status,omitempty"`
// Content
Bio string `json:"bio,omitempty"`
Description string `json:"description,omitempty"`
// Contact
Address string `json:"address,omitempty"`
Phone string `json:"phone,omitempty"`
Email string `json:"email,omitempty"`
Website string `json:"website,omitempty"`
MapsAddress string `json:"maps_address,omitempty"`
// Engagement
FollowersCount int `json:"followers_count,omitempty"`
FollowersDisplay string `json:"followers_display,omitempty"`
LikesCount int `json:"likes_count,omitempty"`
LikesDisplay string `json:"likes_display,omitempty"`
// Media
Image string `json:"image,omitempty"`
ImageAlt string `json:"image_alt,omitempty"`
// Ratings
Rating string `json:"rating,omitempty"`
RatingCount int `json:"rating_count,omitempty"`
RatingOverall string `json:"rating_overall,omitempty"`
// Business
BusinessHours string `json:"business_hours,omitempty"`
BusinessPrice string `json:"business_price,omitempty"`
BusinessServices string `json:"business_services,omitempty"`
IsBusinessPageActive bool `json:"is_business_page_active,omitempty"`
ConfirmedOwnerLabel string `json:"confirmed_owner_label,omitempty"`
// Linked socials
Twitter string `json:"twitter,omitempty"`
Instagram string `json:"instagram,omitempty"`
LinkedIn string `json:"linkedin,omitempty"`
Pinterest string `json:"pinterest,omitempty"`
Telegram string `json:"telegram,omitempty"`
YouTube string `json:"youtube,omitempty"`
// Forward-compat — any field the API adds that we haven't typed yet
Extra map[string]any `json:"-"`
}
PageInfo is the response from `Facebook.GetPageInfo()` — `GET /facebook/pages/details`.
The API wraps this payload under string key "0" in the response envelope; the SDK unwraps before returning. Field names match the LIVE API exactly (verified 2026-06-22).
Forward-compat: any field the API adds that we haven't typed yet lives on Extra — access via `page.Extra["new_field"]`.
type ProfileInfo ¶
type ProfileInfo struct {
// Identifiers
ID string `json:"id,omitempty"`
PK string `json:"pk,omitempty"`
FBID string `json:"fbid,omitempty"`
// Display
Username string `json:"username,omitempty"`
FullName string `json:"full_name,omitempty"`
Biography string `json:"biography,omitempty"`
CategoryName string `json:"category_name,omitempty"`
// Media URLs
ProfilePicURL string `json:"profile_pic_url,omitempty"`
ProfilePicURLHD string `json:"profile_pic_url_hd,omitempty"`
ExternalURL string `json:"external_url,omitempty"`
ExternalURLLinkshimmed string `json:"external_url_linkshimmed,omitempty"`
// Counts
FollowersCount int `json:"followers_count,omitempty"`
FollowingCount int `json:"following_count,omitempty"`
MediaCount int `json:"media_count,omitempty"`
TotalClipsCount int `json:"total_clips_count,omitempty"`
HighlightReelCount int `json:"highlight_reel_count,omitempty"`
MutualFollowersCount int `json:"mutual_followers_count,omitempty"`
// Flags
IsPrivate bool `json:"is_private,omitempty"`
IsVerified bool `json:"is_verified,omitempty"`
IsBusinessAccount bool `json:"is_business_account,omitempty"`
IsProfessionalAccount bool `json:"is_professional_account,omitempty"`
IsMemorialized bool `json:"is_memorialized,omitempty"`
IsUnpublished bool `json:"is_unpublished,omitempty"`
IsEmbedsDisabled bool `json:"is_embeds_disabled,omitempty"`
IsJoinedRecently bool `json:"is_joined_recently,omitempty"`
AccountType int `json:"account_type,omitempty"`
// Features
HasClips bool `json:"has_clips,omitempty"`
HasGuides bool `json:"has_guides,omitempty"`
HasChannel bool `json:"has_channel,omitempty"`
HasArEffects bool `json:"has_ar_effects,omitempty"`
// Business contact
BusinessCategoryName string `json:"business_category_name,omitempty"`
BusinessEmail string `json:"business_email,omitempty"`
BusinessPhoneNumber string `json:"business_phone_number,omitempty"`
BusinessContactMethod string `json:"business_contact_method,omitempty"`
AddressStreet string `json:"address_street,omitempty"`
CityName string `json:"city_name,omitempty"`
Zip string `json:"zip,omitempty"`
// Forward-compat
Extra map[string]any `json:"-"`
}
ProfileInfo is the response from `Instagram.GetProfileDetails()` — `GET /instagram/profile/details`.
The API wraps the payload under "data" in the envelope (alongside `success`, `message`, `meta`); the SDK unwraps before returning.
type RateLimitError ¶
RateLimitError is 429 — too many requests. Retryable after the RetryAfterSeconds interval (parsed from the Retry-After header).
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type Response ¶
Response is the generic untyped response a method returns when the endpoint doesn't have a hand-typed struct yet. Most endpoints in v0.1.0 return Response — only the three headline endpoints return typed structs (PageInfo, GroupInfo, ProfileInfo).
Forward-compat: any field the API returns is preserved in the map regardless of whether we've typed it; callers can access via `r["some_field"]`.