GET
/
history
/
:platform
Available on Business, Enterprise plans.

You can retrieve posts and analytics from social media platforms (Facebook, Instagram, LinkedIn, Pinterest, TikTok, X/Twitter, and YouTube), regardless of whether they were originally created through Ayrshare or posted directly on the platforms. More detailed analytics are available with the analytics endpoint.

The IDs returned in from this endpoint are the social networks’ native social post ID and not the Ayrshare post ID. This allows you to get details for any post on a social network, even if it was not created through Ayrshare. For example, you can retrieve a post that was manually published on facebook.com and use the social post Facebook ID returned to get comments or analytics.

If you do not need posts that originated outside of Ayrshare, simply use the Ayrshare post ID returned in a post with the comment, analytics, or history endpoints.

:platform = facebook, instagram, linkedin, pinterest, tiktok, twitter, youtube.

Example: https://api.ayrshare.com/api/history/instagram

The Instagram mediaUrl field is omitted from response if the media contains copyrighted material or has been flagged for a copyright violation. Examples of copyrighted material can include audio on reels. You can check in the Instagram app under Settings -> Account Status.

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY
Profile-Key
string
Profile Key of a User Profile.

Format: Profile-Key: PROFILE_KEY

Path Parameters

platform
string
required

The platform of the posts to retrieve. Values: facebook, instagram, linkedin, pinterest, tiktok, twitter, youtube

Query Parameters

limit
number
default: 10

Number of history records to return. Max: 300.

skipAnalytics
boolean
default: false

Skip gathering full analytics for Facebook Pages and Instagram. Returns only the social ID. Should be used if analytics aren’t needed, for a faster return, or errors occur when limit > 100.

pagePublished
boolean
default: 10

Facebook only. By default the posts returned are from the Facebook Page feed. You may also choose to only return posts published by the page.

Use feed (default) when you want a more comprehensive view of all content associated with the page, including interactions from other users. Use pagePublished when you only want to retrieve posts made by the page itself.