curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/instagram
# Get only regular posts (no Stories) within a date range
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/facebook?limit=20&since=2026-03-17&until=2026-03-20&dataType=posts"
# First request
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10"
# Next page request (use 'next' cursor from previous response)
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10&next=eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUi..."
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/instagram", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
const API_KEY = "API_KEY";
// Function to fetch posts with pagination (up to maxPosts or until cutoffTime)
async function fetchPosts(platform, { limit = 25, maxPosts = 100, cutoffTime = null } = {}) {
const posts = [];
let nextCursor = null;
let pagePosts = [];
do {
const url = new URL(`https://api.ayrshare.com/api/history/${platform}`);
url.searchParams.set("limit", limit);
if (nextCursor) {
url.searchParams.set("next", nextCursor);
}
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});
const data = await response.json();
pagePosts = data.posts || [];
// Filter by date if cutoffTime is specified
if (cutoffTime) {
pagePosts = pagePosts.filter(post => new Date(post.created) >= cutoffTime);
}
posts.push(...pagePosts);
// Get cursor for next page
nextCursor = data.meta?.pagination?.hasMore ? data.meta.pagination.next : null;
} while (nextCursor && pagePosts.length > 0 && posts.length < maxPosts);
return posts.slice(0, maxPosts);
}
// Fetch up to 100 Twitter posts
fetchPosts("twitter", { maxPosts: 100 }).then(posts => console.log(posts));
// Fetch posts from the last 30 days (up to 200)
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
fetchPosts("twitter", { maxPosts: 200, cutoffTime: thirtyDaysAgo }).then(posts => console.log(posts));
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/history/instagram', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/instagram';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistoryPlatformGETRequest_csharp
{
class HistoryPlatform
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"status": "success",
"posts": [
// Bluesky Response Example
{
"cid": "bafyreigh7nz7x6pl4atgsextqtcbh33mg66yqt3caeihutn7ojkmpdtnzm", // Bluesky Content ID
"created": "2025-01-06T21:35:08.951Z",
"id": "at://did:plc:n7atrjd22xgkmgwig6dzlhzd/app.bsky.feed.post/3lfb57nxgxs2e", // Bluesky Social Post ID
"indexedAt": "2025-01-06T21:35:09.156Z",
"labels": [],
"likeCount": 2,
"post": "What a wonderful data day!",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf43nl5jis24",
"quoteCount": 3,
"replyCount": 2,
"repostCount": 1,
"viewer": {
"threadMuted": false,
"embeddingDisabled": false
}
},
// Facebook Response Example
// Note: If the FB page has fewer than 100 likes then not all analytics data available.
{
"clicksUnique": 31,
"created": "2022-06-14T23:43:21Z",
"commentsCount": 13,
"engagedUsers": 3,
"fullPicture": "https://scontent.ford4-1.fna.fbcdn.net/v/t39.30808-6/287997502_758105082307121_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=8024bb&_nc_ohc=EkktQTp_uWIAX_xtTxV&_nc_ht=scontent.ford4-1.fna&edm=AKK4YLsEAAAA&oh=00_AT-Y5Ht2Pl3MeY-qIBs6BC10SbZ-47Vfcc7DKiQrCnIUA&oe=62AEEECA",
"id": "104619420979033_758005082307127", // Facebook Social Post ID
"impressionsUnique": 0,
"isPopular": false,
"lastUpdated": "2022-06-14T23:43:38.359Z",
"likeCount": 38,
"likedBy": [ // Users who liked the post
{
"id": "7101149746568432",
"name": "John Smith"
}
],
"mediaUrls": [ // If attached photos or video
{
"media": {
"image": {
"height": 412,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/294978304_1014487762575117_6279324362130508123_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=ad6a45&_nc_ohc=y3bYN-PGN0YAX9kO2qn&_nc_ht=scontent-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT9by7D4y4sjY4BW5RW53JO6BaG2UkpUCCJrrugW7GDW9w&oe=62E23000",
"width": 720
},
// Source if mediaType is video
"source": "https://video-lga3-1.xx.fbcdn.net/v/t39.25447-2/294718581_137662848672158_7246454806912028286_n.mp4?_nc_cat=111&vs=696d8a2ba08f208b&_nc_vs=HBkcFQAYJEdIVU1rUkdlb1RFaE5IMEFBSDdPNmVaQWxKQmtibWRqQUFBRhUAAsgBAEsGiBJwcm9ncmVzc2l2ZV9yZWNpcGUBMQ1zdWJzYW1wbGVfZnBzABB2bWFmX2VuYWJsZV9uc3ViACBtZWFzdXJlX29yaWdpbmFsX3Jlc29sdXRpb25fc3NpbQAoY29tcHV0ZV9zc2ltX29ubHlfYXRfb3JpZ2luYWxfcmVzb2x1dGlvbgARZGlzYWJsZV9wb3N0X3B2cXMAFQAlABwAACac%2FNfk2tKqARWQTigCQzMYC3Z0c19wcmV2aWV3HBdAGZmZmZmZmhhEZGFzaF9pNGxpdGViYXNpY19wYXNzdGhyb3VnaGFsaWduZWRfNDgwX2NyZl8yOF9tYWluXzMuMF9mcmFnXzJfdmlkZW8SABgYdmlkZW9zLnZ0cy5jYWxsYmFjay5wcm9kOBJWSURFT19WSUVXX1JFUVVFU1QbD4gVb2VtX3RhcmdldF9lbmNvZGVfdGFnBm9lcF9zZBNvZW1fcmVxdWVzdF90aW1lX21zATAMb2VtX2NmZ19ydWxlCnNkX3VubXV0ZWQTb2VtX3JvaV9yZWFjaF9jb3VudAI5OBFvZW1faXNfZXhwZXJpbWVudAAMb2VtX3JvaV9ub3RlC3Byb2dyZXNzaXZlEW9lbV9yb2lfdXNlcl90aWVyAB5vZW1fcm9pX3ByZWRpY3RlZF93YXRjaF90aW1lX3MBMBZvZW1fcm9pX3JlY2lwZV9iZW5lZml0BTAuMDAwJW9lbV9yb2lfc3RhdGljX2JlbmVmaXRfY29zdF9ldmFsdWF0b3ILcHJvZ3Jlc3NpdmUMb2VtX3ZpZGVvX2lkEDEyNjk2MTcwNzM3NzgxNTESb2VtX3ZpZGVvX2Fzc2V0X2lkDzc5ODQ2NjE3NDg0NzE4OBVvZW1fdmlkZW9fcmVzb3VyY2VfaWQPMzc1MjU0ODg3ODkwNzAyHG9lbV9zb3VyY2VfdmlkZW9fZW5jb2RpbmdfaWQPNDUwODU0MzgzNjE1MDc5DnZ0c19yZXF1ZXN0X2lkD2EyYThlNWU4OTBkNTRmMyUCHBwcFfDmFxsBVQACGwFVAAIcFQIAAAAWgLq3AwAlxAEbB4gBcwQ1ODkyAmNkCjIwMjItMDctMjQDcmNiATADYXBwBVdhdGNoAmN0GERJUkVDVEVEX1BPU1RfQVRUQUNITUVOVBNvcmlnaW5hbF9kdXJhdGlvbl9zBTYuNDE3AnRzFHByb2dyZXNzaXZlX29yZGVyaW5nAA%3D%3D&ccb=1-7&_nc_sid=a06cc9&_nc_ohc=bA3WO4Dk72QAX9TB9ag&_nc_ht=video-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT_CzNhlIwNxY_7UMWIGQMNOtD-Aw_LGcVHnDWvcQJVkAw&oe=62E2ADE1&_nc_rid=780575090331889"
},
"mediaType": "video", // "link" or "photo"
"url": "https://www.facebook.com/115237020273490/videos/1269617073778151",
"videoId": "1269617073778151"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:18:38.359Z",
"parentId": "5764771300200609_742258953848744", // If a shared post, then the ID of the original post
"post": "What a nice one",
"postUrl": "https://www.facebook.com/104619420979033_758105082307121",
"properties": [ // for videos only
{
"name": "Length",
"text": "00:07"
}
],
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"statusType": "added_video", // Status actions: added_photos, added_video, app_created_story, approved_friend, created_event, created_group, created_note, mobile_status_update, published_story, shared_story, tagged_in_photo, wall_post
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{
"clicksUnique": 45,
"created": "2022-06-14T14:53:01Z",
"engagedUsers": 2,
"fullPicture": "https://external.ford4-1.fna.fbcdn.net/emg1/v/t13/614683800928174083?url=https%3a%2f%2fwww.alphast.com%2fwp-content%2fuploads%2f2022%2f06%2fheadphones-scaled.jpg&fb_obo=1&utld=fbcdn.net&stp=dst-emg0_q75&ccb=13-1&oh=00_AT-MVM6lP-eWgsqCW6IhImKAJaGy71JIGIntjlVnZkJw&oe=62AAAC5C&_nc_sid=5f3a21",
"id": "104619420979033_757752962332339", // Facebook Social Post ID
"impressionsUnique": 1,
"isPopular": false,
"lastUpdated": "2022-06-14T23:40:48.453Z",
"mediaUrls": [
{
"mediaUrl": "link",
"url": "https://www.alphasht.com/finding-the-best-headphones/"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:15:48.453Z",
"post": "Finding The Best Headphones: Finding the best headphones for you depends on several factors.",
"postUrl": "https://www.facebook.com/104619420979033_75775296233233",
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{ // Facebook Story
"clicksUnique": 0,
"commentsCount": 0,
"created": "2024-03-15T19:36:29.000Z",
"engagedUsers": 0,
"id": "1593984754722429",
"impressionsFanPaidUnique": 0,
"impressionsFanUnique": 0,
"impressionsOrganicUnique": 0,
"impressionsPaidUnique": 0,
"impressionsUnique": 0,
"likeCount": 0,
"mediaId": "1593984754722429",
"mediaType": "video",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/451306699",
"width": 405
},
"source": "https://video-lga3-1.xx.fbcdn.net/o1/v/t2/f2/m69/An_VRpjrlZJxZEUVTHHMpd"
},
"mediaType": "video",
"type": "story"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"post": "",
"postId": "1433249613981178",
"postUrl": "https://facebook.com/stories/114251701259415/UzpfSVNDOjE0MzMyNDk2MTczMTQ1MTE=/?view_single=1",
"reactions": {},
"reactionsByType": 0,
"sharesCount": 0,
"statusType": "published",
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
// Instagram Response Example
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/75317300_249468363049056_6683482523516619964_n.jpg",
"permalink": "https://www.instagram.com/p/B5OBT3ygpfg/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "FEED", // Media product type: AD, FEED, STORY or REELS
"mediaType": "IMAGE", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17833140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "The #Mandalorian is on tonight instead of Friday",
"postUrl": "https://www.instagram.com/p/B5OBT3ygpfg/" // same as permalink
},
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/72719989_401282024671549_6704610247561386099_n.jpg", // The media_url field is omitted from responses if the media contains copyrighted material or has been flagged for a copyright violation. Examples of copyrighted material can include audio on reels.
"permalink": "https://www.instagram.com/p/B6_EubJFlMI/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "REELS", // Media product type: AD, FEED, STORY or REELS
"mediaType": "VIDEO", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17933140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "And finally, number eleven of the best shows of 2019 is #Mandalorian #BabyYoda #Bestof2019",
"postUrl": "https://www.instagram.com/p/B6_EubJFlMI/" // same as permalink
},
{
"commentsCount": 3,
"created": "2024-04-29T16:10:10Z",
"id": "17998949393616",
"isPopular": false,
"lastUpdated": "2024-04-29T22:28:20.499Z",
"likeCount": 14,
"mediaProductType": "FEED",
"mediaType": "CAROUSEL_ALBUM",
"mediaUrls": [
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/441166659",
"id": "18395216701078298"
},
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/o1/v/t16/f1/m82/834208F324481538FE6E565772BC6B8E_video_dashinit.mp4",
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.29350-15/440150892_371703612533736_7866608290099350261_n.jpg",
"id": "18041898211827161"
}
],
"nextUpdate": "2024-04-29T22:39:20.499Z",
"post": "Learn to value yourself, which means: to fight for your happiness. - Ayn Rand",
"postUrl": "https://www.instagram.com/p/C6WgGmSPn/",
"username": "johnboy"
},
// LinkedIn Response Example
{
"clickCount": 0,
"commentCount": 1,
"created": "2022-12-28T16:07:38Z",
"engagement": 0.6666666666666666,
"id": "urn:li:share:701389826709", // LinkedIn Social Post ID
"impressionCount": 3,
"lastModified": "2022-12-28T16:07:38Z",
"likeCount": 1,
"post": "left thirty pocket track flower whistle",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:701389826709",
"publishedAt": "2022-12-28T16:07:38Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0,
"status": "PUBLISHED",
"uniqueImpressionsCount": 3,
"visibility": "PUBLIC"
},
{
"clickCount": 0,
"comments": [
"urn:li:comment:(urn:li:activity:722)" // Look up using the Comments endpoint
],
"commentCount": 1,
"commentsState": "OPEN",
"created": "2022-12-28T17:05:11Z",
"engagement": 0.16, // Not available for Personal accounts
"id": "urn:li:share:70139127498", // LinkedIn Social Post ID
"impressionCount": 12, // Not available for Personal accounts
"lastModified": "2022-12-28T17:05:11Z",
"likeBy": [
"urn:li:person:Sgwlpf744" // Look up using the brands endpoint
],
"likeCount": 1,
"likedByCurrentUser": false,
"mediaUrls": [ // please see .../ayrshare.com/additional-info/upcoming-api-changes#changes-in-effect-december-1-2023
{
"id": "urn:li:video:C4E10AQHz0RMm5aAiAg",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5aAiAg"
},
{
"id": "urn:li:video:C4E10AQHz0RMm5adsH2",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5adsH2"
}
],
"post": "no monkey gulf organization mood choose earn",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:70139127498",
"publishedAt": "2022-12-28T17:05:11Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0, // Not available for Personal accounts
"status": "PUBLISHED",
"uniqueImpressionsCount": 9, // Not available for Personal accounts
"totalFirstLevelComments": 1,
"visibility": "PUBLIC"
},
// Pinterest Response Example
{
"altText": "",
"boardId": "955255839651522358",
"coverImageUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#353027", // Dominant pin color. Hex number, e.g. "#6E7874"
"duration": 6416, // Time in millisecord
"height": 1062,
"id": "7184649418547260", // Pinterest Social Post ID
"link": "",
"mediaType": "video",
"mediaUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"note": "What a great post",
"post": "You are what you believe yourself to be. - Paulo Coelho",
"postUrl": "https://www.pinterest.com/pin/7184649418547260",
"productTags": [],
"title": "My new post",
"username": "ayrshare",
"width": 1856
},
{
"altText": "",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#7c7c7c",
"height": 600,
"id": "7184649468512979", // Pinterest Social Post ID
"link": "",
"mediaType": "image",
"mediaUrl": "https://i.pinimg.com/originals/1b/0a/02/1b0a02123fba55042474b61bb2aa1.jpg",
"post": "Peace begins with a smile. - Mother Teresa",
"postUrl": "https://www.pinterest.com/pin/7184649468512979",
"username": "ayrshare",
"width": 600
},
{
"altText": "",
"created": "2022-10-17T12:26:05Z",
"dominantColor": "#7f805e",
"id": "36493237618990511", // Pinterest Social Post ID
"link": "",
"mediaType": "multiple_mixed",
"mediaUrls": [
{
"mediaType": "image",
"height": 442,
"width": 249,
"mediaUrl": "https://i.pinimg.com/originals/6c/e2/1f/6ce21fa3936b51cd39c34be6f60dd469.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "video",
"duration": 19600,
"height": 1280,
"width": 720,
"mediaUrl": "https://i.pinimg.com/videos/thumbnails/originals/9370f0845be155b5640c0f.jpg"
}
],
"post": " ",
"postUrl": "https://www.pinterest.com/pin/36493237618990511",
"username": "johnsmith"
},
// Snapchat Response Example
{
"id": "43d61bfe-2249-5a46-944a-d36d27c9530b",
"profileId": "43548e97-edf1-44f9-984a-0a38470133",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/fY3MDNOXp0hxLecKdr4hV",
"type": "PUBLIC_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"created": "2025-05-19T19:38:36.789Z",
"ended": "2025-05-19T19:38:36.790Z"
},
{
"id": "07c99fea-1c72-4f72-bcd9-7dacfae753e0",
"profileId": "43548e97-edf1-44f9-984a-0a3847023",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/wTf9NQ0mZ4GCDyFj7feQ8",
"type": "SAVED_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"title": "A song about snaps",
"created": "2025-05-20T18:09:04.876Z",
"updated": "2025-05-20T18:09:04.876Z"
},
// TikTok Response Example
{
"audienceCities": [
{
"city_name": "US Teton County",
"percentage": 3.1
},
{
"city_name": "US Queens",
"percentage": 6.3
}
],
"audienceCountries": [
{
"country": "GB",
"percentage": 0.0029
},
{
"country": "US",
"percentage": 0.9604
}
],
"averageTimeWatched": 2.0132, // Average watch time in seconds. The average time viewers spent watching your video.
"commentsCount": 1, // Total number of lifetime comments. Available 24-48 hours after posting.
"created": "2024-02-26T18:32:00Z",
"embedUrl": "https://www.tiktok.com/static/profile-video?id=73399801580586794&",
"engagementLikes": [ // Engagement likes. The distribution of your viewers who liked your video at specific points in the video's timeline.
{
"percentage": 0,
"second": "179"
},
{
"percentage": 0,
"second": "339"
}
],
"fullVideoWatchedRate": 0.0176, // The percentage of viewers who watched the entire video.
"id": "7339980158058679594",
"impressionSources": [
{
"impression_source": "Search",
"percentage": 0
},
{
"impression_source": "Sound",
"percentage": 0
},
{
"impression_source": "other_profile_vv",
"percentage": 0
},
{
"impression_source": "Follow",
"percentage": 0
},
{
"impression_source": "For You",
"percentage": 1
},
{
"impression_source": "Hashtag",
"percentage": 0
},
{
"impression_source": "Personal Profile",
"percentage": 0
}
],
"likeCount": 2, // Total number of lifetime likes. Available 24-48 hours after posting.
"mediaType": "video",
"musicTitle": "♬ original sound - Mack",
"musicUrl": "https://www.tiktok.com/music/original-sound",
"name": "Mack",
"post": "I have failed over and over and over again in my life and that is why I succeed. - Michael Jordan",
"postUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"reach": 653, // The number of people who watched your published content at least once.
"shareUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"shareCount": 2, // Total number of lifetime shares. Available 24-48 hours after posting.
"tags": [],
"thumbnailHeight": 1024,
"thumbnailUrl": "https://p19-sign.tiktokcdn-us.com/obj/tos-useast5-p-85c255-tx/oIpT 9CLHAaQfuD67E3jfAFJ5eVDuF5Ibkmszg?x-expires=1709305200&x-signature=ZBTR0Q%2B4KLi8szRCir8eYEcAs1s%3D",
"thumbnailWidth": 576,
"totalTimeWatched": 1373, // Total watch time in seconds. The total time viewers spent watching your video.
"url": "https://www.tiktok.com/@happy",
"videoDuration": 11.332, // Video duration in seconds.
"videoViewRetention": [ // This metric indicates how many of your viewers are still watching after a certain amount of time.
{
"percentage": 0.1,
"second": "155"
},
{
"percentage": 0.07,
"second": "234"
}
],
/* Total number of lifetime users who viewed the video. Available 24-48 hours after posting.
If the user swipes away from the ad then swipes back, it would be counted as 2 impressions.
Therefore, a new video view will be counted again with the new impression session.
*/
"videoViews": 697
},
// Twitter Response Example
// Note: Non-public and organic metrics only available last 30-days of Tweets
{
"created": "2022-05-20T20:07:53.000Z",
"entities": {
"urls": [
{
"start": 77, // Starting character position (inclusive)
"end": 96, // Ending character position (exclusive)
"url": "https://t.co/abc123", // Shortened t.co URL
"expandedUrl": "https://www.ayrshare.com/docs", // Full URL after redirect
"displayUrl": "ayrshare.com/docs", // User-friendly display version
"unwoundUrl": "https://www.ayrshare.com/docs" // Final destination URL
}
],
"hashtags": [
{
"start": 97, // Starting character position (inclusive)
"end": 112, // Ending character position (exclusive)
"tag": "SocialMediaAPI" // Hashtag text without #
}
],
"mentions": [
{
"start": 113, // Starting character position (inclusive)
"end": 122, // Ending character position (exclusive)
"username": "ayrshare" // Username without @
}
],
"cashtags": [
{
"start": 123, // Starting character position (inclusive)
"end": 128, // Ending character position (exclusive)
"tag": "META" // Stock symbol without $
}
],
"annotations": [
{
"start": 46, // Starting character position (inclusive)
"end": 54, // Ending character position (exclusive)
"probability": 0.9456, // Confidence score (0.0 to 1.0)
"type": "Product", // Entity type: Person, Place, Product, Organization, Other
"normalizedText": "Ayrshare" // Standardized entity name
}
]
},
"id": "1187026023991603", // Twitter Social Post ID
"media": [ // Attached media
{
"mediaKey": "7_1555577959943217152",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1555577959943217152/pu/img/f4M9veIozFjQA_XD.jpg",
"durationMs": 2168, // Duration in milliseconds, videos only
"type": "video" // or "photo", "animated_gif"
}
],
"nonPublicMetrics": { // Use this to determine the total number of impressions generated for the Tweet. Only available for Tweets created the last 30 days.
"impressionCount": 1, // Number of times the Tweet has been viewed
"userProfileClicks": 0
},
"organicMetrics": { // Use this to measure organic engagement for the Tweet. Only available for Tweets created the last 30 days.
"userProfileClicks": 2,
"impressionCount": 4, // Number of times the Tweet has been viewed organically.
"replyCount": 3,
"retweetCount": 1,
"likeCount": 234
},
"possiblySensitive": false, // Tweet contains possibly sensitive information
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare $META",
"postUrl": "https://twitter.com/myhandle/status/1187026023991603",
"publicMetrics": { // Use this to measure Tweet engagement. Only available for Tweets created the last 30 days.
"retweetCount": 2,
"replyCount": 2,
"likeCount": 5,
"quoteCount": 1
},
"referencedTweets": [ // If a quoted or reply tweet
{
"type": "quoted", // or "replied_to"
"id": "1556718165828276224", // Quoted or replied Tweet ID
"url": "https://www.twitter.com/1556718165828276224" // Quoted or Replied Tweet URL
}
],
"source": "Ayrshare", // Determine if a Twitter user posted from the web, mobile device, or other app.
"text": "To effectively communicate, we must realize that we are all different", // Deprecated, use "post" field
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
{
"authorId": "1194338779881472",
"created": "2023-12-27T03:24:23.000Z",
"createdAt": "2023-12-27T03:24:23.000Z",
"editHistoryTweetIds": [
"17398682514485715"
],
"id": "17398682514485715",
"media": [ // available for videos and gifs
{
"nonPublicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback50Count": 4,
"playback25Count": 11,
"playback75Count": 2
},
"publicMetrics": {
"viewCount": 27
},
"durationMs": 28240,
"organicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback25Count": 11,
"playback75Count": 2,
"playback50Count": 4,
"viewCount": 27
},
"mediaKey": "7_1739849636389814272",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1739849636389814272/pu/img/bCkAdkD0R00-ZlkY.jpg",
"width": 1920,
"type": "video",
"height": 1080,
"mediaUrls": [
{
"bitRate": 256000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/480x270/4RoZCqynednVMFgy.mp4?tag=12"
},
{
"bitRate": 832000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/640x360/RYy5iHTIxu7_iyZm.mp4?tag=12"
},
{
"bitRate": 2176000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/1280x720/9UpR90ekFA-9Ucxo.mp4?tag=12"
},
{
"contentType": "application/x-mpegURL",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/pl/0AVy2xIOLQcsrEZG.m3u8?tag=12&container=fmp4"
}
]
}
],
"nonPublicMetrics": {
"impressionCount": 54,
"userProfileClicks": 0
},
"organicMetrics": {
"userProfileClicks": 0,
"likeCount": 0,
"replyCount": 0,
"impressionCount": 54,
"retweetCount": 0
},
"possiblySensitive": false,
"post": "Family is the most important thing in the world. - Diana, Princess of Wales https://t.co/MgYxnJDer6",
"postUrl": "https://twitter.com/superme/status/17398682514485715",
"publicMetrics": {
"retweetCount": 0,
"replyCount": 0,
"likeCount": 0,
"quoteCount": 0,
"bookmarkCount": 0,
"impressionCount": 54
},
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
// YouTube Response Example
{
"created": "2022-08-15T19:14:44Z",
"description": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire", // Deprecated, use "post" field
"id": "Q-4OuHCALVa", // YouTube Social Post ID
"position": 0,
"post": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire",
"postUrl": "https://www.youtube.com/watch?v=Q-4OuHCALVa",
"privacyStatus": "public",
"license": "youtube", // "youtube" or "creativeCommon"
"embeddable": true, // whether the video can be embedded on external sites
"publicStatsViewable": true, // whether the extended stats panel is publicly viewable
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Q-4OuHCALVa/default.jpg",
"title": "Yo time"
},
{
"created": "2022-08-08T22:24:42Z",
"description": "Little author little, one travels far. - J.R.R. Tolkien", // Deprecated, use "post" field
"id": "Btg4ysKnHea", // YouTube Social Post ID
"position": 1,
"post": "Little author little, one travels far. - J.R.R. Tolkien",
"postUrl": "https://www.youtube.com/watch?v=Btg4ysKnHea",
"privacyStatus": "unlisted",
"license": "creativeCommon",
"embeddable": false,
"publicStatsViewable": false,
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Btg4ysKnHea/default.jpg",
"title": "Nice one 2"
}
],
"lastUpdated": "2022-11-14T16:04:51.994Z",
"nextUpdate": "2022-11-14T16:37:21.994Z",
"meta": {
"pagination": {
"hasMore": true, // More results available
"next": "eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUiLCJzb3VyY2UiOiJwdWJsaWMiLCJwbGF0Zm9ybSI6InR3aXR0ZXIifQ==", // Cursor for next page
"limit": 10 // Requested page size
}
}
}
{
"status": "error",
"code": 196,
"message": "Instagram is not connected"
}
{
// When some of the data is not available from the social networks.
// All available data is still returned
"status": "error",
"posts": [
{... valid data },
{
"action": "analytics",
"code": 187,
"commentsCount": 0,
"created": "2019-03-22T13:31:02Z",
"createdTime": "2019-03-22T13:31:02+0000",
"from": {
"name": "Ayrshare",
"id": "746346376697"
},
"fullPicture": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/",
"id": "746346376697_3993223", // Facebook Social Post ID
"isPopular": false,
"likeCount": 2,
"mediaUrls": [
{
"description": "Dirk Cotton's approach to retirement planning.",
"media": {
"image": {
"height": 720,
"src": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/608115669879219",
"width": 720
}
},
"mediaType": "link",
"title": "The Retirement Planning Regime",
"url": "https://bit.ly/2RwaH"
}
],
"message": "Error getting analytics.",
"post": "Error getting analytics.",
"status": "error",
"statusType": "shared_story"
},
{... valid data }
]
}
History
Beitragsverlauf für eine Plattform
Verlauf gesendeter Beiträge für eine Plattform, einschließlich Beiträgen, die nicht über Ayrshare erstellt wurden
GET
/
history
/
:platform
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/instagram
# Get only regular posts (no Stories) within a date range
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/facebook?limit=20&since=2026-03-17&until=2026-03-20&dataType=posts"
# First request
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10"
# Next page request (use 'next' cursor from previous response)
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10&next=eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUi..."
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/instagram", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
const API_KEY = "API_KEY";
// Function to fetch posts with pagination (up to maxPosts or until cutoffTime)
async function fetchPosts(platform, { limit = 25, maxPosts = 100, cutoffTime = null } = {}) {
const posts = [];
let nextCursor = null;
let pagePosts = [];
do {
const url = new URL(`https://api.ayrshare.com/api/history/${platform}`);
url.searchParams.set("limit", limit);
if (nextCursor) {
url.searchParams.set("next", nextCursor);
}
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});
const data = await response.json();
pagePosts = data.posts || [];
// Filter by date if cutoffTime is specified
if (cutoffTime) {
pagePosts = pagePosts.filter(post => new Date(post.created) >= cutoffTime);
}
posts.push(...pagePosts);
// Get cursor for next page
nextCursor = data.meta?.pagination?.hasMore ? data.meta.pagination.next : null;
} while (nextCursor && pagePosts.length > 0 && posts.length < maxPosts);
return posts.slice(0, maxPosts);
}
// Fetch up to 100 Twitter posts
fetchPosts("twitter", { maxPosts: 100 }).then(posts => console.log(posts));
// Fetch posts from the last 30 days (up to 200)
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
fetchPosts("twitter", { maxPosts: 200, cutoffTime: thirtyDaysAgo }).then(posts => console.log(posts));
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/history/instagram', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/instagram';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistoryPlatformGETRequest_csharp
{
class HistoryPlatform
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"status": "success",
"posts": [
// Bluesky Response Example
{
"cid": "bafyreigh7nz7x6pl4atgsextqtcbh33mg66yqt3caeihutn7ojkmpdtnzm", // Bluesky Content ID
"created": "2025-01-06T21:35:08.951Z",
"id": "at://did:plc:n7atrjd22xgkmgwig6dzlhzd/app.bsky.feed.post/3lfb57nxgxs2e", // Bluesky Social Post ID
"indexedAt": "2025-01-06T21:35:09.156Z",
"labels": [],
"likeCount": 2,
"post": "What a wonderful data day!",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf43nl5jis24",
"quoteCount": 3,
"replyCount": 2,
"repostCount": 1,
"viewer": {
"threadMuted": false,
"embeddingDisabled": false
}
},
// Facebook Response Example
// Note: If the FB page has fewer than 100 likes then not all analytics data available.
{
"clicksUnique": 31,
"created": "2022-06-14T23:43:21Z",
"commentsCount": 13,
"engagedUsers": 3,
"fullPicture": "https://scontent.ford4-1.fna.fbcdn.net/v/t39.30808-6/287997502_758105082307121_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=8024bb&_nc_ohc=EkktQTp_uWIAX_xtTxV&_nc_ht=scontent.ford4-1.fna&edm=AKK4YLsEAAAA&oh=00_AT-Y5Ht2Pl3MeY-qIBs6BC10SbZ-47Vfcc7DKiQrCnIUA&oe=62AEEECA",
"id": "104619420979033_758005082307127", // Facebook Social Post ID
"impressionsUnique": 0,
"isPopular": false,
"lastUpdated": "2022-06-14T23:43:38.359Z",
"likeCount": 38,
"likedBy": [ // Users who liked the post
{
"id": "7101149746568432",
"name": "John Smith"
}
],
"mediaUrls": [ // If attached photos or video
{
"media": {
"image": {
"height": 412,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/294978304_1014487762575117_6279324362130508123_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=ad6a45&_nc_ohc=y3bYN-PGN0YAX9kO2qn&_nc_ht=scontent-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT9by7D4y4sjY4BW5RW53JO6BaG2UkpUCCJrrugW7GDW9w&oe=62E23000",
"width": 720
},
// Source if mediaType is video
"source": "https://video-lga3-1.xx.fbcdn.net/v/t39.25447-2/294718581_137662848672158_7246454806912028286_n.mp4?_nc_cat=111&vs=696d8a2ba08f208b&_nc_vs=HBkcFQAYJEdIVU1rUkdlb1RFaE5IMEFBSDdPNmVaQWxKQmtibWRqQUFBRhUAAsgBAEsGiBJwcm9ncmVzc2l2ZV9yZWNpcGUBMQ1zdWJzYW1wbGVfZnBzABB2bWFmX2VuYWJsZV9uc3ViACBtZWFzdXJlX29yaWdpbmFsX3Jlc29sdXRpb25fc3NpbQAoY29tcHV0ZV9zc2ltX29ubHlfYXRfb3JpZ2luYWxfcmVzb2x1dGlvbgARZGlzYWJsZV9wb3N0X3B2cXMAFQAlABwAACac%2FNfk2tKqARWQTigCQzMYC3Z0c19wcmV2aWV3HBdAGZmZmZmZmhhEZGFzaF9pNGxpdGViYXNpY19wYXNzdGhyb3VnaGFsaWduZWRfNDgwX2NyZl8yOF9tYWluXzMuMF9mcmFnXzJfdmlkZW8SABgYdmlkZW9zLnZ0cy5jYWxsYmFjay5wcm9kOBJWSURFT19WSUVXX1JFUVVFU1QbD4gVb2VtX3RhcmdldF9lbmNvZGVfdGFnBm9lcF9zZBNvZW1fcmVxdWVzdF90aW1lX21zATAMb2VtX2NmZ19ydWxlCnNkX3VubXV0ZWQTb2VtX3JvaV9yZWFjaF9jb3VudAI5OBFvZW1faXNfZXhwZXJpbWVudAAMb2VtX3JvaV9ub3RlC3Byb2dyZXNzaXZlEW9lbV9yb2lfdXNlcl90aWVyAB5vZW1fcm9pX3ByZWRpY3RlZF93YXRjaF90aW1lX3MBMBZvZW1fcm9pX3JlY2lwZV9iZW5lZml0BTAuMDAwJW9lbV9yb2lfc3RhdGljX2JlbmVmaXRfY29zdF9ldmFsdWF0b3ILcHJvZ3Jlc3NpdmUMb2VtX3ZpZGVvX2lkEDEyNjk2MTcwNzM3NzgxNTESb2VtX3ZpZGVvX2Fzc2V0X2lkDzc5ODQ2NjE3NDg0NzE4OBVvZW1fdmlkZW9fcmVzb3VyY2VfaWQPMzc1MjU0ODg3ODkwNzAyHG9lbV9zb3VyY2VfdmlkZW9fZW5jb2RpbmdfaWQPNDUwODU0MzgzNjE1MDc5DnZ0c19yZXF1ZXN0X2lkD2EyYThlNWU4OTBkNTRmMyUCHBwcFfDmFxsBVQACGwFVAAIcFQIAAAAWgLq3AwAlxAEbB4gBcwQ1ODkyAmNkCjIwMjItMDctMjQDcmNiATADYXBwBVdhdGNoAmN0GERJUkVDVEVEX1BPU1RfQVRUQUNITUVOVBNvcmlnaW5hbF9kdXJhdGlvbl9zBTYuNDE3AnRzFHByb2dyZXNzaXZlX29yZGVyaW5nAA%3D%3D&ccb=1-7&_nc_sid=a06cc9&_nc_ohc=bA3WO4Dk72QAX9TB9ag&_nc_ht=video-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT_CzNhlIwNxY_7UMWIGQMNOtD-Aw_LGcVHnDWvcQJVkAw&oe=62E2ADE1&_nc_rid=780575090331889"
},
"mediaType": "video", // "link" or "photo"
"url": "https://www.facebook.com/115237020273490/videos/1269617073778151",
"videoId": "1269617073778151"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:18:38.359Z",
"parentId": "5764771300200609_742258953848744", // If a shared post, then the ID of the original post
"post": "What a nice one",
"postUrl": "https://www.facebook.com/104619420979033_758105082307121",
"properties": [ // for videos only
{
"name": "Length",
"text": "00:07"
}
],
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"statusType": "added_video", // Status actions: added_photos, added_video, app_created_story, approved_friend, created_event, created_group, created_note, mobile_status_update, published_story, shared_story, tagged_in_photo, wall_post
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{
"clicksUnique": 45,
"created": "2022-06-14T14:53:01Z",
"engagedUsers": 2,
"fullPicture": "https://external.ford4-1.fna.fbcdn.net/emg1/v/t13/614683800928174083?url=https%3a%2f%2fwww.alphast.com%2fwp-content%2fuploads%2f2022%2f06%2fheadphones-scaled.jpg&fb_obo=1&utld=fbcdn.net&stp=dst-emg0_q75&ccb=13-1&oh=00_AT-MVM6lP-eWgsqCW6IhImKAJaGy71JIGIntjlVnZkJw&oe=62AAAC5C&_nc_sid=5f3a21",
"id": "104619420979033_757752962332339", // Facebook Social Post ID
"impressionsUnique": 1,
"isPopular": false,
"lastUpdated": "2022-06-14T23:40:48.453Z",
"mediaUrls": [
{
"mediaUrl": "link",
"url": "https://www.alphasht.com/finding-the-best-headphones/"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:15:48.453Z",
"post": "Finding The Best Headphones: Finding the best headphones for you depends on several factors.",
"postUrl": "https://www.facebook.com/104619420979033_75775296233233",
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{ // Facebook Story
"clicksUnique": 0,
"commentsCount": 0,
"created": "2024-03-15T19:36:29.000Z",
"engagedUsers": 0,
"id": "1593984754722429",
"impressionsFanPaidUnique": 0,
"impressionsFanUnique": 0,
"impressionsOrganicUnique": 0,
"impressionsPaidUnique": 0,
"impressionsUnique": 0,
"likeCount": 0,
"mediaId": "1593984754722429",
"mediaType": "video",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/451306699",
"width": 405
},
"source": "https://video-lga3-1.xx.fbcdn.net/o1/v/t2/f2/m69/An_VRpjrlZJxZEUVTHHMpd"
},
"mediaType": "video",
"type": "story"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"post": "",
"postId": "1433249613981178",
"postUrl": "https://facebook.com/stories/114251701259415/UzpfSVNDOjE0MzMyNDk2MTczMTQ1MTE=/?view_single=1",
"reactions": {},
"reactionsByType": 0,
"sharesCount": 0,
"statusType": "published",
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
// Instagram Response Example
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/75317300_249468363049056_6683482523516619964_n.jpg",
"permalink": "https://www.instagram.com/p/B5OBT3ygpfg/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "FEED", // Media product type: AD, FEED, STORY or REELS
"mediaType": "IMAGE", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17833140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "The #Mandalorian is on tonight instead of Friday",
"postUrl": "https://www.instagram.com/p/B5OBT3ygpfg/" // same as permalink
},
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/72719989_401282024671549_6704610247561386099_n.jpg", // The media_url field is omitted from responses if the media contains copyrighted material or has been flagged for a copyright violation. Examples of copyrighted material can include audio on reels.
"permalink": "https://www.instagram.com/p/B6_EubJFlMI/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "REELS", // Media product type: AD, FEED, STORY or REELS
"mediaType": "VIDEO", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17933140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "And finally, number eleven of the best shows of 2019 is #Mandalorian #BabyYoda #Bestof2019",
"postUrl": "https://www.instagram.com/p/B6_EubJFlMI/" // same as permalink
},
{
"commentsCount": 3,
"created": "2024-04-29T16:10:10Z",
"id": "17998949393616",
"isPopular": false,
"lastUpdated": "2024-04-29T22:28:20.499Z",
"likeCount": 14,
"mediaProductType": "FEED",
"mediaType": "CAROUSEL_ALBUM",
"mediaUrls": [
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/441166659",
"id": "18395216701078298"
},
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/o1/v/t16/f1/m82/834208F324481538FE6E565772BC6B8E_video_dashinit.mp4",
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.29350-15/440150892_371703612533736_7866608290099350261_n.jpg",
"id": "18041898211827161"
}
],
"nextUpdate": "2024-04-29T22:39:20.499Z",
"post": "Learn to value yourself, which means: to fight for your happiness. - Ayn Rand",
"postUrl": "https://www.instagram.com/p/C6WgGmSPn/",
"username": "johnboy"
},
// LinkedIn Response Example
{
"clickCount": 0,
"commentCount": 1,
"created": "2022-12-28T16:07:38Z",
"engagement": 0.6666666666666666,
"id": "urn:li:share:701389826709", // LinkedIn Social Post ID
"impressionCount": 3,
"lastModified": "2022-12-28T16:07:38Z",
"likeCount": 1,
"post": "left thirty pocket track flower whistle",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:701389826709",
"publishedAt": "2022-12-28T16:07:38Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0,
"status": "PUBLISHED",
"uniqueImpressionsCount": 3,
"visibility": "PUBLIC"
},
{
"clickCount": 0,
"comments": [
"urn:li:comment:(urn:li:activity:722)" // Look up using the Comments endpoint
],
"commentCount": 1,
"commentsState": "OPEN",
"created": "2022-12-28T17:05:11Z",
"engagement": 0.16, // Not available for Personal accounts
"id": "urn:li:share:70139127498", // LinkedIn Social Post ID
"impressionCount": 12, // Not available for Personal accounts
"lastModified": "2022-12-28T17:05:11Z",
"likeBy": [
"urn:li:person:Sgwlpf744" // Look up using the brands endpoint
],
"likeCount": 1,
"likedByCurrentUser": false,
"mediaUrls": [ // please see .../ayrshare.com/additional-info/upcoming-api-changes#changes-in-effect-december-1-2023
{
"id": "urn:li:video:C4E10AQHz0RMm5aAiAg",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5aAiAg"
},
{
"id": "urn:li:video:C4E10AQHz0RMm5adsH2",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5adsH2"
}
],
"post": "no monkey gulf organization mood choose earn",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:70139127498",
"publishedAt": "2022-12-28T17:05:11Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0, // Not available for Personal accounts
"status": "PUBLISHED",
"uniqueImpressionsCount": 9, // Not available for Personal accounts
"totalFirstLevelComments": 1,
"visibility": "PUBLIC"
},
// Pinterest Response Example
{
"altText": "",
"boardId": "955255839651522358",
"coverImageUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#353027", // Dominant pin color. Hex number, e.g. "#6E7874"
"duration": 6416, // Time in millisecord
"height": 1062,
"id": "7184649418547260", // Pinterest Social Post ID
"link": "",
"mediaType": "video",
"mediaUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"note": "What a great post",
"post": "You are what you believe yourself to be. - Paulo Coelho",
"postUrl": "https://www.pinterest.com/pin/7184649418547260",
"productTags": [],
"title": "My new post",
"username": "ayrshare",
"width": 1856
},
{
"altText": "",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#7c7c7c",
"height": 600,
"id": "7184649468512979", // Pinterest Social Post ID
"link": "",
"mediaType": "image",
"mediaUrl": "https://i.pinimg.com/originals/1b/0a/02/1b0a02123fba55042474b61bb2aa1.jpg",
"post": "Peace begins with a smile. - Mother Teresa",
"postUrl": "https://www.pinterest.com/pin/7184649468512979",
"username": "ayrshare",
"width": 600
},
{
"altText": "",
"created": "2022-10-17T12:26:05Z",
"dominantColor": "#7f805e",
"id": "36493237618990511", // Pinterest Social Post ID
"link": "",
"mediaType": "multiple_mixed",
"mediaUrls": [
{
"mediaType": "image",
"height": 442,
"width": 249,
"mediaUrl": "https://i.pinimg.com/originals/6c/e2/1f/6ce21fa3936b51cd39c34be6f60dd469.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "video",
"duration": 19600,
"height": 1280,
"width": 720,
"mediaUrl": "https://i.pinimg.com/videos/thumbnails/originals/9370f0845be155b5640c0f.jpg"
}
],
"post": " ",
"postUrl": "https://www.pinterest.com/pin/36493237618990511",
"username": "johnsmith"
},
// Snapchat Response Example
{
"id": "43d61bfe-2249-5a46-944a-d36d27c9530b",
"profileId": "43548e97-edf1-44f9-984a-0a38470133",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/fY3MDNOXp0hxLecKdr4hV",
"type": "PUBLIC_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"created": "2025-05-19T19:38:36.789Z",
"ended": "2025-05-19T19:38:36.790Z"
},
{
"id": "07c99fea-1c72-4f72-bcd9-7dacfae753e0",
"profileId": "43548e97-edf1-44f9-984a-0a3847023",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/wTf9NQ0mZ4GCDyFj7feQ8",
"type": "SAVED_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"title": "A song about snaps",
"created": "2025-05-20T18:09:04.876Z",
"updated": "2025-05-20T18:09:04.876Z"
},
// TikTok Response Example
{
"audienceCities": [
{
"city_name": "US Teton County",
"percentage": 3.1
},
{
"city_name": "US Queens",
"percentage": 6.3
}
],
"audienceCountries": [
{
"country": "GB",
"percentage": 0.0029
},
{
"country": "US",
"percentage": 0.9604
}
],
"averageTimeWatched": 2.0132, // Average watch time in seconds. The average time viewers spent watching your video.
"commentsCount": 1, // Total number of lifetime comments. Available 24-48 hours after posting.
"created": "2024-02-26T18:32:00Z",
"embedUrl": "https://www.tiktok.com/static/profile-video?id=73399801580586794&",
"engagementLikes": [ // Engagement likes. The distribution of your viewers who liked your video at specific points in the video's timeline.
{
"percentage": 0,
"second": "179"
},
{
"percentage": 0,
"second": "339"
}
],
"fullVideoWatchedRate": 0.0176, // The percentage of viewers who watched the entire video.
"id": "7339980158058679594",
"impressionSources": [
{
"impression_source": "Search",
"percentage": 0
},
{
"impression_source": "Sound",
"percentage": 0
},
{
"impression_source": "other_profile_vv",
"percentage": 0
},
{
"impression_source": "Follow",
"percentage": 0
},
{
"impression_source": "For You",
"percentage": 1
},
{
"impression_source": "Hashtag",
"percentage": 0
},
{
"impression_source": "Personal Profile",
"percentage": 0
}
],
"likeCount": 2, // Total number of lifetime likes. Available 24-48 hours after posting.
"mediaType": "video",
"musicTitle": "♬ original sound - Mack",
"musicUrl": "https://www.tiktok.com/music/original-sound",
"name": "Mack",
"post": "I have failed over and over and over again in my life and that is why I succeed. - Michael Jordan",
"postUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"reach": 653, // The number of people who watched your published content at least once.
"shareUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"shareCount": 2, // Total number of lifetime shares. Available 24-48 hours after posting.
"tags": [],
"thumbnailHeight": 1024,
"thumbnailUrl": "https://p19-sign.tiktokcdn-us.com/obj/tos-useast5-p-85c255-tx/oIpT 9CLHAaQfuD67E3jfAFJ5eVDuF5Ibkmszg?x-expires=1709305200&x-signature=ZBTR0Q%2B4KLi8szRCir8eYEcAs1s%3D",
"thumbnailWidth": 576,
"totalTimeWatched": 1373, // Total watch time in seconds. The total time viewers spent watching your video.
"url": "https://www.tiktok.com/@happy",
"videoDuration": 11.332, // Video duration in seconds.
"videoViewRetention": [ // This metric indicates how many of your viewers are still watching after a certain amount of time.
{
"percentage": 0.1,
"second": "155"
},
{
"percentage": 0.07,
"second": "234"
}
],
/* Total number of lifetime users who viewed the video. Available 24-48 hours after posting.
If the user swipes away from the ad then swipes back, it would be counted as 2 impressions.
Therefore, a new video view will be counted again with the new impression session.
*/
"videoViews": 697
},
// Twitter Response Example
// Note: Non-public and organic metrics only available last 30-days of Tweets
{
"created": "2022-05-20T20:07:53.000Z",
"entities": {
"urls": [
{
"start": 77, // Starting character position (inclusive)
"end": 96, // Ending character position (exclusive)
"url": "https://t.co/abc123", // Shortened t.co URL
"expandedUrl": "https://www.ayrshare.com/docs", // Full URL after redirect
"displayUrl": "ayrshare.com/docs", // User-friendly display version
"unwoundUrl": "https://www.ayrshare.com/docs" // Final destination URL
}
],
"hashtags": [
{
"start": 97, // Starting character position (inclusive)
"end": 112, // Ending character position (exclusive)
"tag": "SocialMediaAPI" // Hashtag text without #
}
],
"mentions": [
{
"start": 113, // Starting character position (inclusive)
"end": 122, // Ending character position (exclusive)
"username": "ayrshare" // Username without @
}
],
"cashtags": [
{
"start": 123, // Starting character position (inclusive)
"end": 128, // Ending character position (exclusive)
"tag": "META" // Stock symbol without $
}
],
"annotations": [
{
"start": 46, // Starting character position (inclusive)
"end": 54, // Ending character position (exclusive)
"probability": 0.9456, // Confidence score (0.0 to 1.0)
"type": "Product", // Entity type: Person, Place, Product, Organization, Other
"normalizedText": "Ayrshare" // Standardized entity name
}
]
},
"id": "1187026023991603", // Twitter Social Post ID
"media": [ // Attached media
{
"mediaKey": "7_1555577959943217152",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1555577959943217152/pu/img/f4M9veIozFjQA_XD.jpg",
"durationMs": 2168, // Duration in milliseconds, videos only
"type": "video" // or "photo", "animated_gif"
}
],
"nonPublicMetrics": { // Use this to determine the total number of impressions generated for the Tweet. Only available for Tweets created the last 30 days.
"impressionCount": 1, // Number of times the Tweet has been viewed
"userProfileClicks": 0
},
"organicMetrics": { // Use this to measure organic engagement for the Tweet. Only available for Tweets created the last 30 days.
"userProfileClicks": 2,
"impressionCount": 4, // Number of times the Tweet has been viewed organically.
"replyCount": 3,
"retweetCount": 1,
"likeCount": 234
},
"possiblySensitive": false, // Tweet contains possibly sensitive information
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare $META",
"postUrl": "https://twitter.com/myhandle/status/1187026023991603",
"publicMetrics": { // Use this to measure Tweet engagement. Only available for Tweets created the last 30 days.
"retweetCount": 2,
"replyCount": 2,
"likeCount": 5,
"quoteCount": 1
},
"referencedTweets": [ // If a quoted or reply tweet
{
"type": "quoted", // or "replied_to"
"id": "1556718165828276224", // Quoted or replied Tweet ID
"url": "https://www.twitter.com/1556718165828276224" // Quoted or Replied Tweet URL
}
],
"source": "Ayrshare", // Determine if a Twitter user posted from the web, mobile device, or other app.
"text": "To effectively communicate, we must realize that we are all different", // Deprecated, use "post" field
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
{
"authorId": "1194338779881472",
"created": "2023-12-27T03:24:23.000Z",
"createdAt": "2023-12-27T03:24:23.000Z",
"editHistoryTweetIds": [
"17398682514485715"
],
"id": "17398682514485715",
"media": [ // available for videos and gifs
{
"nonPublicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback50Count": 4,
"playback25Count": 11,
"playback75Count": 2
},
"publicMetrics": {
"viewCount": 27
},
"durationMs": 28240,
"organicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback25Count": 11,
"playback75Count": 2,
"playback50Count": 4,
"viewCount": 27
},
"mediaKey": "7_1739849636389814272",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1739849636389814272/pu/img/bCkAdkD0R00-ZlkY.jpg",
"width": 1920,
"type": "video",
"height": 1080,
"mediaUrls": [
{
"bitRate": 256000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/480x270/4RoZCqynednVMFgy.mp4?tag=12"
},
{
"bitRate": 832000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/640x360/RYy5iHTIxu7_iyZm.mp4?tag=12"
},
{
"bitRate": 2176000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/1280x720/9UpR90ekFA-9Ucxo.mp4?tag=12"
},
{
"contentType": "application/x-mpegURL",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/pl/0AVy2xIOLQcsrEZG.m3u8?tag=12&container=fmp4"
}
]
}
],
"nonPublicMetrics": {
"impressionCount": 54,
"userProfileClicks": 0
},
"organicMetrics": {
"userProfileClicks": 0,
"likeCount": 0,
"replyCount": 0,
"impressionCount": 54,
"retweetCount": 0
},
"possiblySensitive": false,
"post": "Family is the most important thing in the world. - Diana, Princess of Wales https://t.co/MgYxnJDer6",
"postUrl": "https://twitter.com/superme/status/17398682514485715",
"publicMetrics": {
"retweetCount": 0,
"replyCount": 0,
"likeCount": 0,
"quoteCount": 0,
"bookmarkCount": 0,
"impressionCount": 54
},
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
// YouTube Response Example
{
"created": "2022-08-15T19:14:44Z",
"description": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire", // Deprecated, use "post" field
"id": "Q-4OuHCALVa", // YouTube Social Post ID
"position": 0,
"post": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire",
"postUrl": "https://www.youtube.com/watch?v=Q-4OuHCALVa",
"privacyStatus": "public",
"license": "youtube", // "youtube" or "creativeCommon"
"embeddable": true, // whether the video can be embedded on external sites
"publicStatsViewable": true, // whether the extended stats panel is publicly viewable
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Q-4OuHCALVa/default.jpg",
"title": "Yo time"
},
{
"created": "2022-08-08T22:24:42Z",
"description": "Little author little, one travels far. - J.R.R. Tolkien", // Deprecated, use "post" field
"id": "Btg4ysKnHea", // YouTube Social Post ID
"position": 1,
"post": "Little author little, one travels far. - J.R.R. Tolkien",
"postUrl": "https://www.youtube.com/watch?v=Btg4ysKnHea",
"privacyStatus": "unlisted",
"license": "creativeCommon",
"embeddable": false,
"publicStatsViewable": false,
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Btg4ysKnHea/default.jpg",
"title": "Nice one 2"
}
],
"lastUpdated": "2022-11-14T16:04:51.994Z",
"nextUpdate": "2022-11-14T16:37:21.994Z",
"meta": {
"pagination": {
"hasMore": true, // More results available
"next": "eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUiLCJzb3VyY2UiOiJwdWJsaWMiLCJwbGF0Zm9ybSI6InR3aXR0ZXIifQ==", // Cursor for next page
"limit": 10 // Requested page size
}
}
}
{
"status": "error",
"code": 196,
"message": "Instagram is not connected"
}
{
// When some of the data is not available from the social networks.
// All available data is still returned
"status": "error",
"posts": [
{... valid data },
{
"action": "analytics",
"code": 187,
"commentsCount": 0,
"created": "2019-03-22T13:31:02Z",
"createdTime": "2019-03-22T13:31:02+0000",
"from": {
"name": "Ayrshare",
"id": "746346376697"
},
"fullPicture": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/",
"id": "746346376697_3993223", // Facebook Social Post ID
"isPopular": false,
"likeCount": 2,
"mediaUrls": [
{
"description": "Dirk Cotton's approach to retirement planning.",
"media": {
"image": {
"height": 720,
"src": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/608115669879219",
"width": 720
}
},
"mediaType": "link",
"title": "The Retirement Planning Regime",
"url": "https://bit.ly/2RwaH"
}
],
"message": "Error getting analytics.",
"post": "Error getting analytics.",
"status": "error",
"statusType": "shared_story"
},
{... valid data }
]
}
Dieser Endpunkt ermöglicht es Ihnen, sowohl Beiträge als auch deren Analytics von den wichtigsten sozialen Netzwerken (Bluesky, Facebook, Instagram, LinkedIn, Pinterest, Threads, TikTok, X/Twitter und YouTube) abzurufen. Er funktioniert für alle Beiträge auf diesen Plattformen – unabhängig davon, ob sie über die Ayrshare-API erstellt oder direkt über die Oberfläche des sozialen Netzwerks veröffentlicht wurden.
Detailliertere Analytics sind über den Analytics-Endpunkt verfügbar.
Die von diesem Endpunkt zurückgegebenen IDs sind die nativen Social-Post-IDs der sozialen Netzwerke und nicht die Ayrshare-Beitrags-ID.
So können Sie Details zu jedem Beitrag in einem sozialen Netzwerk abrufen, auch wenn er nicht über Ayrshare erstellt wurde.
Sie können beispielsweise einen Beitrag abrufen, der manuell auf facebook.com veröffentlicht wurde, und die zurückgegebene Facebook-Social-Post-ID verwenden, um Kommentare abzurufen oder Analytics abzurufen.
Wenn Sie keine Beiträge benötigen, die außerhalb von Ayrshare erstellt wurden, verwenden Sie einfach die Ayrshare-Beitrags-ID, die von einem Beitrag zurückgegeben wird, zusammen mit den Endpunkten comment, analytics oder history.
Facebook
Instagram
:platform = bluesky, facebook, instagram, linkedin, pinterest, snapchat, threads, tiktok, twitter, youtube.
Beispiel: https://api.ayrshare.com/api/history/instagram
Urheberrechtlich geschützte Medien
Instagram und TikTok schließen alle urheberrechtlich geschützten Medien aus ihren Antworten aus.- Das Instagram-Feld
mediaUrlwird in der Antwort weggelassen, wenn die Medien urheberrechtlich geschütztes Material enthalten oder wegen eines Urheberrechtsverstoßes markiert wurden. Beispiele für urheberrechtlich geschütztes Material sind z. B. Audio in Reels. Sie können dies in der Instagram-App unter „Einstellungen“ → „Kontostatus“ überprüfen. - TikTok gibt keine Medien zurück, wenn diese urheberrechtlich geschütztes Material enthalten oder wegen eines Urheberrechtsverstoßes markiert wurden. Beispiele für urheberrechtlich geschütztes Material sind Audio in Reels (TikTok schaltet diese Videos stumm). Sie können dies in der TikTok-App unter „Aktivität“ → „Systembenachrichtigungen“ überprüfen.Wenn ein solches Video stummgeschaltet ist, können Sie in der TikTok-App Audio hinzufügen. Gehen Sie zum Beitrag und wählen Sie die Option zum Hinzufügen von nicht urheberrechtlich geschütztem Audio. Das Video wird dann in dieser API-Antwort zurückgegeben.
Einschränkungen
- Abgelaufene/archivierte Stories (älter als 24 Stunden) werden automatisch herausgefiltert. Standardmäßig werden nur aktive Stories in die Antwort aufgenommen.
- Verwenden Sie den Query-Parameter
dataType, um nurpostsoder nurstoriesanzufordern. - Verwenden Sie die Query-Parameter
sinceunduntil, um Beiträge nach einem bestimmten Zeitraum zu filtern.
- Antworten enthalten keine Live-Video-Stories.
- Stories sind nur 24 Stunden lang verfügbar.
- Neue Stories, die beim Teilen einer Story von einem Nutzer erstellt werden, werden nicht zurückgegeben. Zu den geteilten Stories gehören auch Stories, die mit den „Add Yours“-Vorlagen erstellt wurden.
- Neue Beiträge, die beim Annehmen von Kollaborationsanfragen erstellt werden, werden nicht zurückgegeben.
- Verwenden Sie den Query-Parameter
dataType, um nurpostsoder nurstoriesanzufordern.
Header-Parameter
Pfadparameter
Die Plattform der abzurufenden Beiträge. Werte:
bluesky, facebook,
instagram, linkedin, pinterest, snapchat, threads, tiktok,
twitter, youtube.Query-Parameter
Anzahl der zurückzugebenden Verlaufsdatensätze. Maximales Limit: 500*Hohe Limits können zu langsameren Antwortzeiten führen, daher empfehlen wir, ein Limit von nicht mehr als 100 zu verwenden.*Höhere Limits sind in Enterprise-Plänen verfügbar. Bitte wenden Sie sich für Details an Ihren Account Manager.
Überspringt die Erfassung vollständiger Analytics für Facebook-Seiten und Instagram. Gibt nur
die Social-Post-ID zurück. Sollte verwendet werden, wenn keine Analytics benötigt werden (nur die
Social-Post-ID erforderlich), für eine schnellere Antwort oder wenn Fehler auftreten, wenn limit > 100.
Nur Facebook. Standardmäßig stammen die zurückgegebenen Beiträge aus dem Facebook-Seiten-Feed. Sie können auch wählen, nur Beiträge zurückzugeben, die von der Seite veröffentlicht wurden.Verwenden Sie „feed“ (Standard), wenn Sie einen umfassenderen Überblick über alle mit der Seite verknüpften Inhalte einschließlich Interaktionen anderer Nutzer wünschen. Verwenden Sie
pagePublished, wenn Sie nur Beiträge abrufen möchten, die von der Seite selbst erstellt wurden.Nur X/Twitter. Mit diesem Parameter können Sie Beiträge eines bestimmten X/Twitter-Nutzers anhand seiner numerischen ID abrufen, anstatt aus Ihrem verknüpften Konto.Um beispielsweise alle Beiträge des Handles
@Google zu erhalten, würden Sie dessen numerische userId 20536157 verwenden.Sie können die numerische userId eines beliebigen X/Twitter-Nutzers über den Brands Get User-Endpunkt herausfinden.Hinweis: Verwenden Sie für diese Anfrage nur den API-KEY im Header. Fügen Sie keinen Profile Key hinzu.Nur X/Twitter. Mit diesem Parameter können Sie Beiträge eines bestimmten X/Twitter-Nutzers anhand seines Handles abrufen, anstatt aus Ihrem verknüpften Konto.Zum Beispiel, um alle Beiträge vom Handle
@Google zu erhalten.Hinweis: Verwenden Sie für diese Anfrage nur den API-KEY im Header. Fügen Sie keinen Profile Key hinzu.Cursor-basierte Paginierung zum Abrufen der nächsten Ergebnisseite. Übergeben Sie den
next-Wert aus dem meta.pagination-Objekt der vorherigen Antwort, um den nächsten Satz von Beiträgen abzurufen.Nur Facebook. ISO-UTC-Datumszeichenfolge zum Filtern von Beiträgen, die an oder nach diesem Datum erstellt wurden. Verwenden Sie zusammen mit
until für einen bestimmten Datumsbereich.Beispiel: since=2026-03-17Nur Facebook. ISO-UTC-Datumszeichenfolge zum Filtern von Beiträgen, die an oder vor diesem Datum erstellt wurden. Verwenden Sie zusammen mit
since für einen bestimmten Datumsbereich.Beispiel: until=2026-03-20Facebook und Instagram. Filtern Sie den zurückgegebenen Inhaltstyp. Standardmäßig werden sowohl reguläre Beiträge als auch aktive Stories zurückgegeben.Werte:
posts— nur reguläre Beiträge (keine Stories)stories— nur Stories
Paginierungs-Antwort
Bei Verwendung der cursor-basierten Paginierung (mit dem Query-Parameternext) enthält die Antwort ein meta.pagination-Objekt mit dem Paginierungszustand.
Das posts-Array in jeder paginierten Antwort enthält Objekte mit derselben Struktur wie in den Antwortbeispielen unten für jede Plattform gezeigt.
Paginierungs-Metadaten für die cursor-basierte Navigation durch Ergebnisse.
Anzeigen properties
Anzeigen properties
Gibt an, ob über die aktuelle Seite hinaus weitere Ergebnisse verfügbar sind. Wenn
true, verwenden Sie den next-Cursor, um zusätzliche Beiträge abzurufen.Ein undurchsichtiger Cursor-String, der als
next-Query-Parameter übergeben wird, um die nächste Ergebnisseite abzurufen. Nur vorhanden, wenn hasMore true ist oder weitere Ergebnisse abgerufen werden können.Die Anzahl der pro Seite angeforderten Ergebnisse.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/instagram
# Get only regular posts (no Stories) within a date range
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/facebook?limit=20&since=2026-03-17&until=2026-03-20&dataType=posts"
# First request
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10"
# Next page request (use 'next' cursor from previous response)
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/history/twitter?limit=10&next=eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUi..."
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/instagram", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
const API_KEY = "API_KEY";
// Function to fetch posts with pagination (up to maxPosts or until cutoffTime)
async function fetchPosts(platform, { limit = 25, maxPosts = 100, cutoffTime = null } = {}) {
const posts = [];
let nextCursor = null;
let pagePosts = [];
do {
const url = new URL(`https://api.ayrshare.com/api/history/${platform}`);
url.searchParams.set("limit", limit);
if (nextCursor) {
url.searchParams.set("next", nextCursor);
}
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});
const data = await response.json();
pagePosts = data.posts || [];
// Filter by date if cutoffTime is specified
if (cutoffTime) {
pagePosts = pagePosts.filter(post => new Date(post.created) >= cutoffTime);
}
posts.push(...pagePosts);
// Get cursor for next page
nextCursor = data.meta?.pagination?.hasMore ? data.meta.pagination.next : null;
} while (nextCursor && pagePosts.length > 0 && posts.length < maxPosts);
return posts.slice(0, maxPosts);
}
// Fetch up to 100 Twitter posts
fetchPosts("twitter", { maxPosts: 100 }).then(posts => console.log(posts));
// Fetch posts from the last 30 days (up to 200)
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
fetchPosts("twitter", { maxPosts: 200, cutoffTime: thirtyDaysAgo }).then(posts => console.log(posts));
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/history/instagram', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/instagram';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace HistoryPlatformGETRequest_csharp
{
class HistoryPlatform
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"status": "success",
"posts": [
// Bluesky Response Example
{
"cid": "bafyreigh7nz7x6pl4atgsextqtcbh33mg66yqt3caeihutn7ojkmpdtnzm", // Bluesky Content ID
"created": "2025-01-06T21:35:08.951Z",
"id": "at://did:plc:n7atrjd22xgkmgwig6dzlhzd/app.bsky.feed.post/3lfb57nxgxs2e", // Bluesky Social Post ID
"indexedAt": "2025-01-06T21:35:09.156Z",
"labels": [],
"likeCount": 2,
"post": "What a wonderful data day!",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf43nl5jis24",
"quoteCount": 3,
"replyCount": 2,
"repostCount": 1,
"viewer": {
"threadMuted": false,
"embeddingDisabled": false
}
},
// Facebook Response Example
// Note: If the FB page has fewer than 100 likes then not all analytics data available.
{
"clicksUnique": 31,
"created": "2022-06-14T23:43:21Z",
"commentsCount": 13,
"engagedUsers": 3,
"fullPicture": "https://scontent.ford4-1.fna.fbcdn.net/v/t39.30808-6/287997502_758105082307121_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=8024bb&_nc_ohc=EkktQTp_uWIAX_xtTxV&_nc_ht=scontent.ford4-1.fna&edm=AKK4YLsEAAAA&oh=00_AT-Y5Ht2Pl3MeY-qIBs6BC10SbZ-47Vfcc7DKiQrCnIUA&oe=62AEEECA",
"id": "104619420979033_758005082307127", // Facebook Social Post ID
"impressionsUnique": 0,
"isPopular": false,
"lastUpdated": "2022-06-14T23:43:38.359Z",
"likeCount": 38,
"likedBy": [ // Users who liked the post
{
"id": "7101149746568432",
"name": "John Smith"
}
],
"mediaUrls": [ // If attached photos or video
{
"media": {
"image": {
"height": 412,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/294978304_1014487762575117_6279324362130508123_n.jpg?stp=dst-jpg_s720x720&_nc_cat=101&ccb=1-7&_nc_sid=ad6a45&_nc_ohc=y3bYN-PGN0YAX9kO2qn&_nc_ht=scontent-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT9by7D4y4sjY4BW5RW53JO6BaG2UkpUCCJrrugW7GDW9w&oe=62E23000",
"width": 720
},
// Source if mediaType is video
"source": "https://video-lga3-1.xx.fbcdn.net/v/t39.25447-2/294718581_137662848672158_7246454806912028286_n.mp4?_nc_cat=111&vs=696d8a2ba08f208b&_nc_vs=HBkcFQAYJEdIVU1rUkdlb1RFaE5IMEFBSDdPNmVaQWxKQmtibWRqQUFBRhUAAsgBAEsGiBJwcm9ncmVzc2l2ZV9yZWNpcGUBMQ1zdWJzYW1wbGVfZnBzABB2bWFmX2VuYWJsZV9uc3ViACBtZWFzdXJlX29yaWdpbmFsX3Jlc29sdXRpb25fc3NpbQAoY29tcHV0ZV9zc2ltX29ubHlfYXRfb3JpZ2luYWxfcmVzb2x1dGlvbgARZGlzYWJsZV9wb3N0X3B2cXMAFQAlABwAACac%2FNfk2tKqARWQTigCQzMYC3Z0c19wcmV2aWV3HBdAGZmZmZmZmhhEZGFzaF9pNGxpdGViYXNpY19wYXNzdGhyb3VnaGFsaWduZWRfNDgwX2NyZl8yOF9tYWluXzMuMF9mcmFnXzJfdmlkZW8SABgYdmlkZW9zLnZ0cy5jYWxsYmFjay5wcm9kOBJWSURFT19WSUVXX1JFUVVFU1QbD4gVb2VtX3RhcmdldF9lbmNvZGVfdGFnBm9lcF9zZBNvZW1fcmVxdWVzdF90aW1lX21zATAMb2VtX2NmZ19ydWxlCnNkX3VubXV0ZWQTb2VtX3JvaV9yZWFjaF9jb3VudAI5OBFvZW1faXNfZXhwZXJpbWVudAAMb2VtX3JvaV9ub3RlC3Byb2dyZXNzaXZlEW9lbV9yb2lfdXNlcl90aWVyAB5vZW1fcm9pX3ByZWRpY3RlZF93YXRjaF90aW1lX3MBMBZvZW1fcm9pX3JlY2lwZV9iZW5lZml0BTAuMDAwJW9lbV9yb2lfc3RhdGljX2JlbmVmaXRfY29zdF9ldmFsdWF0b3ILcHJvZ3Jlc3NpdmUMb2VtX3ZpZGVvX2lkEDEyNjk2MTcwNzM3NzgxNTESb2VtX3ZpZGVvX2Fzc2V0X2lkDzc5ODQ2NjE3NDg0NzE4OBVvZW1fdmlkZW9fcmVzb3VyY2VfaWQPMzc1MjU0ODg3ODkwNzAyHG9lbV9zb3VyY2VfdmlkZW9fZW5jb2RpbmdfaWQPNDUwODU0MzgzNjE1MDc5DnZ0c19yZXF1ZXN0X2lkD2EyYThlNWU4OTBkNTRmMyUCHBwcFfDmFxsBVQACGwFVAAIcFQIAAAAWgLq3AwAlxAEbB4gBcwQ1ODkyAmNkCjIwMjItMDctMjQDcmNiATADYXBwBVdhdGNoAmN0GERJUkVDVEVEX1BPU1RfQVRUQUNITUVOVBNvcmlnaW5hbF9kdXJhdGlvbl9zBTYuNDE3AnRzFHByb2dyZXNzaXZlX29yZGVyaW5nAA%3D%3D&ccb=1-7&_nc_sid=a06cc9&_nc_ohc=bA3WO4Dk72QAX9TB9ag&_nc_ht=video-lga3-1.xx&edm=AKK4YLsEAAAA&oh=00_AT_CzNhlIwNxY_7UMWIGQMNOtD-Aw_LGcVHnDWvcQJVkAw&oe=62E2ADE1&_nc_rid=780575090331889"
},
"mediaType": "video", // "link" or "photo"
"url": "https://www.facebook.com/115237020273490/videos/1269617073778151",
"videoId": "1269617073778151"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:18:38.359Z",
"parentId": "5764771300200609_742258953848744", // If a shared post, then the ID of the original post
"post": "What a nice one",
"postUrl": "https://www.facebook.com/104619420979033_758105082307121",
"properties": [ // for videos only
{
"name": "Length",
"text": "00:07"
}
],
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"statusType": "added_video", // Status actions: added_photos, added_video, app_created_story, approved_friend, created_event, created_group, created_note, mobile_status_update, published_story, shared_story, tagged_in_photo, wall_post
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{
"clicksUnique": 45,
"created": "2022-06-14T14:53:01Z",
"engagedUsers": 2,
"fullPicture": "https://external.ford4-1.fna.fbcdn.net/emg1/v/t13/614683800928174083?url=https%3a%2f%2fwww.alphast.com%2fwp-content%2fuploads%2f2022%2f06%2fheadphones-scaled.jpg&fb_obo=1&utld=fbcdn.net&stp=dst-emg0_q75&ccb=13-1&oh=00_AT-MVM6lP-eWgsqCW6IhImKAJaGy71JIGIntjlVnZkJw&oe=62AAAC5C&_nc_sid=5f3a21",
"id": "104619420979033_757752962332339", // Facebook Social Post ID
"impressionsUnique": 1,
"isPopular": false,
"lastUpdated": "2022-06-14T23:40:48.453Z",
"mediaUrls": [
{
"mediaUrl": "link",
"url": "https://www.alphasht.com/finding-the-best-headphones/"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"nextUpdate": "2022-06-15T00:15:48.453Z",
"post": "Finding The Best Headphones: Finding the best headphones for you depends on several factors.",
"postUrl": "https://www.facebook.com/104619420979033_75775296233233",
"reactions": { // Total lifetime
"like": 1, // Like reactions - The "like" reaction counts include both "like" and "care" reactions.
"love": 1, // Love reactions
"anger": 1, // Anger reactions
"haha": 1, // Haha reactions
"wow": 1, // Wow reactions
"sorry": 1, // Sorry reactions
"total": 6 // Total number of reactions
},
"reactionsByType": 1,
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
{ // Facebook Story
"clicksUnique": 0,
"commentsCount": 0,
"created": "2024-03-15T19:36:29.000Z",
"engagedUsers": 0,
"id": "1593984754722429",
"impressionsFanPaidUnique": 0,
"impressionsFanUnique": 0,
"impressionsOrganicUnique": 0,
"impressionsPaidUnique": 0,
"impressionsUnique": 0,
"likeCount": 0,
"mediaId": "1593984754722429",
"mediaType": "video",
"mediaUrls": [
{
"media": {
"image": {
"height": 720,
"src": "https://scontent-lga3-1.xx.fbcdn.net/v/t15.5256-10/451306699",
"width": 405
},
"source": "https://video-lga3-1.xx.fbcdn.net/o1/v/t2/f2/m69/An_VRpjrlZJxZEUVTHHMpd"
},
"mediaType": "video",
"type": "story"
}
],
"negativeFeedback": 0,
"negativeFeedbackUnique": 0,
"post": "",
"postId": "1433249613981178",
"postUrl": "https://facebook.com/stories/114251701259415/UzpfSVNDOjE0MzMyNDk2MTczMTQ1MTE=/?view_single=1",
"reactions": {},
"reactionsByType": 0,
"sharesCount": 0,
"statusType": "published",
"videoViewTime": 0,
"videoViews": 0,
"videoViewsUnique": 0
},
// Instagram Response Example
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/75317300_249468363049056_6683482523516619964_n.jpg",
"permalink": "https://www.instagram.com/p/B5OBT3ygpfg/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "FEED", // Media product type: AD, FEED, STORY or REELS
"mediaType": "IMAGE", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17833140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "The #Mandalorian is on tonight instead of Friday",
"postUrl": "https://www.instagram.com/p/B5OBT3ygpfg/" // same as permalink
},
{
"mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/72719989_401282024671549_6704610247561386099_n.jpg", // The media_url field is omitted from responses if the media contains copyrighted material or has been flagged for a copyright violation. Examples of copyrighted material can include audio on reels.
"permalink": "https://www.instagram.com/p/B6_EubJFlMI/",
"commentsCount": 0,
"created": "2022-05-20T17:26:03Z",
"likeCount": 0,
"mediaProductType": "REELS", // Media product type: AD, FEED, STORY or REELS
"mediaType": "VIDEO", // Media type: CAROUSEL_ALBUM, IMAGE, or VIDEO
"username": "thegoodone",
"id": "17933140557332933", // Instagram Social Post ID
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/277243581_1136333620462129_9111753545576538669_n.jpg",
"post": "And finally, number eleven of the best shows of 2019 is #Mandalorian #BabyYoda #Bestof2019",
"postUrl": "https://www.instagram.com/p/B6_EubJFlMI/" // same as permalink
},
{
"commentsCount": 3,
"created": "2024-04-29T16:10:10Z",
"id": "17998949393616",
"isPopular": false,
"lastUpdated": "2024-04-29T22:28:20.499Z",
"likeCount": 14,
"mediaProductType": "FEED",
"mediaType": "CAROUSEL_ALBUM",
"mediaUrls": [
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/441166659",
"id": "18395216701078298"
},
{
"mediaUrl": "https://scontent-lga3-2.cdninstagram.com/o1/v/t16/f1/m82/834208F324481538FE6E565772BC6B8E_video_dashinit.mp4",
"thumbnailUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.29350-15/440150892_371703612533736_7866608290099350261_n.jpg",
"id": "18041898211827161"
}
],
"nextUpdate": "2024-04-29T22:39:20.499Z",
"post": "Learn to value yourself, which means: to fight for your happiness. - Ayn Rand",
"postUrl": "https://www.instagram.com/p/C6WgGmSPn/",
"username": "johnboy"
},
// LinkedIn Response Example
{
"clickCount": 0,
"commentCount": 1,
"created": "2022-12-28T16:07:38Z",
"engagement": 0.6666666666666666,
"id": "urn:li:share:701389826709", // LinkedIn Social Post ID
"impressionCount": 3,
"lastModified": "2022-12-28T16:07:38Z",
"likeCount": 1,
"post": "left thirty pocket track flower whistle",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:701389826709",
"publishedAt": "2022-12-28T16:07:38Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0,
"status": "PUBLISHED",
"uniqueImpressionsCount": 3,
"visibility": "PUBLIC"
},
{
"clickCount": 0,
"comments": [
"urn:li:comment:(urn:li:activity:722)" // Look up using the Comments endpoint
],
"commentCount": 1,
"commentsState": "OPEN",
"created": "2022-12-28T17:05:11Z",
"engagement": 0.16, // Not available for Personal accounts
"id": "urn:li:share:70139127498", // LinkedIn Social Post ID
"impressionCount": 12, // Not available for Personal accounts
"lastModified": "2022-12-28T17:05:11Z",
"likeBy": [
"urn:li:person:Sgwlpf744" // Look up using the brands endpoint
],
"likeCount": 1,
"likedByCurrentUser": false,
"mediaUrls": [ // please see .../ayrshare.com/additional-info/upcoming-api-changes#changes-in-effect-december-1-2023
{
"id": "urn:li:video:C4E10AQHz0RMm5aAiAg",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5aAiAg"
},
{
"id": "urn:li:video:C4E10AQHz0RMm5adsH2",
"url": "https://media.licdn.com/dms/image/C4E10AQHz0RMm5adsH2"
}
],
"post": "no monkey gulf organization mood choose earn",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:share:70139127498",
"publishedAt": "2022-12-28T17:05:11Z",
"reactions": { // Get reactions on a LinkedIn share
"like": 1, // "Like in the UI
"praise": 2, // "Celebrate" in the UI
"maybe": 3, // "Curious" in the UI
"empathy": 3, // "Love" in the UI
"interest": 2 // "Insightful" in the UI
"appreciation": 5 // "Support" in the UI
},
"shareCount": 0, // Not available for Personal accounts
"status": "PUBLISHED",
"uniqueImpressionsCount": 9, // Not available for Personal accounts
"totalFirstLevelComments": 1,
"visibility": "PUBLIC"
},
// Pinterest Response Example
{
"altText": "",
"boardId": "955255839651522358",
"coverImageUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#353027", // Dominant pin color. Hex number, e.g. "#6E7874"
"duration": 6416, // Time in millisecord
"height": 1062,
"id": "7184649418547260", // Pinterest Social Post ID
"link": "",
"mediaType": "video",
"mediaUrl": "https://i.pinimg.com/originals/7e/ea/af/7eeaaf4bce167902b06fe3370227e.jpg",
"note": "What a great post",
"post": "You are what you believe yourself to be. - Paulo Coelho",
"postUrl": "https://www.pinterest.com/pin/7184649418547260",
"productTags": [],
"title": "My new post",
"username": "ayrshare",
"width": 1856
},
{
"altText": "",
"created": "2022-08-09T22:25:12Z",
"dominantColor": "#7c7c7c",
"height": 600,
"id": "7184649468512979", // Pinterest Social Post ID
"link": "",
"mediaType": "image",
"mediaUrl": "https://i.pinimg.com/originals/1b/0a/02/1b0a02123fba55042474b61bb2aa1.jpg",
"post": "Peace begins with a smile. - Mother Teresa",
"postUrl": "https://www.pinterest.com/pin/7184649468512979",
"username": "ayrshare",
"width": 600
},
{
"altText": "",
"created": "2022-10-17T12:26:05Z",
"dominantColor": "#7f805e",
"id": "36493237618990511", // Pinterest Social Post ID
"link": "",
"mediaType": "multiple_mixed",
"mediaUrls": [
{
"mediaType": "image",
"height": 442,
"width": 249,
"mediaUrl": "https://i.pinimg.com/originals/6c/e2/1f/6ce21fa3936b51cd39c34be6f60dd469.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "image",
"height": 589,
"width": 332,
"mediaUrl": "https://i.pinimg.com/originals/9370f0845be155b5640c0f.jpg"
},
{
"mediaType": "video",
"duration": 19600,
"height": 1280,
"width": 720,
"mediaUrl": "https://i.pinimg.com/videos/thumbnails/originals/9370f0845be155b5640c0f.jpg"
}
],
"post": " ",
"postUrl": "https://www.pinterest.com/pin/36493237618990511",
"username": "johnsmith"
},
// Snapchat Response Example
{
"id": "43d61bfe-2249-5a46-944a-d36d27c9530b",
"profileId": "43548e97-edf1-44f9-984a-0a38470133",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/fY3MDNOXp0hxLecKdr4hV",
"type": "PUBLIC_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"created": "2025-05-19T19:38:36.789Z",
"ended": "2025-05-19T19:38:36.790Z"
},
{
"id": "07c99fea-1c72-4f72-bcd9-7dacfae753e0",
"profileId": "43548e97-edf1-44f9-984a-0a3847023",
"thumbnailUrl": "https://cf-st.sc-cdn.net/d/wTf9NQ0mZ4GCDyFj7feQ8",
"type": "SAVED_STORY", // PUBLIC_STORY, SAVED_STORY, or SPOTLIGHT
"title": "A song about snaps",
"created": "2025-05-20T18:09:04.876Z",
"updated": "2025-05-20T18:09:04.876Z"
},
// TikTok Response Example
{
"audienceCities": [
{
"city_name": "US Teton County",
"percentage": 3.1
},
{
"city_name": "US Queens",
"percentage": 6.3
}
],
"audienceCountries": [
{
"country": "GB",
"percentage": 0.0029
},
{
"country": "US",
"percentage": 0.9604
}
],
"averageTimeWatched": 2.0132, // Average watch time in seconds. The average time viewers spent watching your video.
"commentsCount": 1, // Total number of lifetime comments. Available 24-48 hours after posting.
"created": "2024-02-26T18:32:00Z",
"embedUrl": "https://www.tiktok.com/static/profile-video?id=73399801580586794&",
"engagementLikes": [ // Engagement likes. The distribution of your viewers who liked your video at specific points in the video's timeline.
{
"percentage": 0,
"second": "179"
},
{
"percentage": 0,
"second": "339"
}
],
"fullVideoWatchedRate": 0.0176, // The percentage of viewers who watched the entire video.
"id": "7339980158058679594",
"impressionSources": [
{
"impression_source": "Search",
"percentage": 0
},
{
"impression_source": "Sound",
"percentage": 0
},
{
"impression_source": "other_profile_vv",
"percentage": 0
},
{
"impression_source": "Follow",
"percentage": 0
},
{
"impression_source": "For You",
"percentage": 1
},
{
"impression_source": "Hashtag",
"percentage": 0
},
{
"impression_source": "Personal Profile",
"percentage": 0
}
],
"likeCount": 2, // Total number of lifetime likes. Available 24-48 hours after posting.
"mediaType": "video",
"musicTitle": "♬ original sound - Mack",
"musicUrl": "https://www.tiktok.com/music/original-sound",
"name": "Mack",
"post": "I have failed over and over and over again in my life and that is why I succeed. - Michael Jordan",
"postUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"reach": 653, // The number of people who watched your published content at least once.
"shareUrl": "https://www.tiktok.com/@happy/video/7339980158058679594",
"shareCount": 2, // Total number of lifetime shares. Available 24-48 hours after posting.
"tags": [],
"thumbnailHeight": 1024,
"thumbnailUrl": "https://p19-sign.tiktokcdn-us.com/obj/tos-useast5-p-85c255-tx/oIpT 9CLHAaQfuD67E3jfAFJ5eVDuF5Ibkmszg?x-expires=1709305200&x-signature=ZBTR0Q%2B4KLi8szRCir8eYEcAs1s%3D",
"thumbnailWidth": 576,
"totalTimeWatched": 1373, // Total watch time in seconds. The total time viewers spent watching your video.
"url": "https://www.tiktok.com/@happy",
"videoDuration": 11.332, // Video duration in seconds.
"videoViewRetention": [ // This metric indicates how many of your viewers are still watching after a certain amount of time.
{
"percentage": 0.1,
"second": "155"
},
{
"percentage": 0.07,
"second": "234"
}
],
/* Total number of lifetime users who viewed the video. Available 24-48 hours after posting.
If the user swipes away from the ad then swipes back, it would be counted as 2 impressions.
Therefore, a new video view will be counted again with the new impression session.
*/
"videoViews": 697
},
// Twitter Response Example
// Note: Non-public and organic metrics only available last 30-days of Tweets
{
"created": "2022-05-20T20:07:53.000Z",
"entities": {
"urls": [
{
"start": 77, // Starting character position (inclusive)
"end": 96, // Ending character position (exclusive)
"url": "https://t.co/abc123", // Shortened t.co URL
"expandedUrl": "https://www.ayrshare.com/docs", // Full URL after redirect
"displayUrl": "ayrshare.com/docs", // User-friendly display version
"unwoundUrl": "https://www.ayrshare.com/docs" // Final destination URL
}
],
"hashtags": [
{
"start": 97, // Starting character position (inclusive)
"end": 112, // Ending character position (exclusive)
"tag": "SocialMediaAPI" // Hashtag text without #
}
],
"mentions": [
{
"start": 113, // Starting character position (inclusive)
"end": 122, // Ending character position (exclusive)
"username": "ayrshare" // Username without @
}
],
"cashtags": [
{
"start": 123, // Starting character position (inclusive)
"end": 128, // Ending character position (exclusive)
"tag": "META" // Stock symbol without $
}
],
"annotations": [
{
"start": 46, // Starting character position (inclusive)
"end": 54, // Ending character position (exclusive)
"probability": 0.9456, // Confidence score (0.0 to 1.0)
"type": "Product", // Entity type: Person, Place, Product, Organization, Other
"normalizedText": "Ayrshare" // Standardized entity name
}
]
},
"id": "1187026023991603", // Twitter Social Post ID
"media": [ // Attached media
{
"mediaKey": "7_1555577959943217152",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1555577959943217152/pu/img/f4M9veIozFjQA_XD.jpg",
"durationMs": 2168, // Duration in milliseconds, videos only
"type": "video" // or "photo", "animated_gif"
}
],
"nonPublicMetrics": { // Use this to determine the total number of impressions generated for the Tweet. Only available for Tweets created the last 30 days.
"impressionCount": 1, // Number of times the Tweet has been viewed
"userProfileClicks": 0
},
"organicMetrics": { // Use this to measure organic engagement for the Tweet. Only available for Tweets created the last 30 days.
"userProfileClicks": 2,
"impressionCount": 4, // Number of times the Tweet has been viewed organically.
"replyCount": 3,
"retweetCount": 1,
"likeCount": 234
},
"possiblySensitive": false, // Tweet contains possibly sensitive information
"post": "Just launched our social media campaign using Ayrshare! Check out the API at https://t.co/abc123 #SocialMediaAPI @ayrshare $META",
"postUrl": "https://twitter.com/myhandle/status/1187026023991603",
"publicMetrics": { // Use this to measure Tweet engagement. Only available for Tweets created the last 30 days.
"retweetCount": 2,
"replyCount": 2,
"likeCount": 5,
"quoteCount": 1
},
"referencedTweets": [ // If a quoted or reply tweet
{
"type": "quoted", // or "replied_to"
"id": "1556718165828276224", // Quoted or replied Tweet ID
"url": "https://www.twitter.com/1556718165828276224" // Quoted or Replied Tweet URL
}
],
"source": "Ayrshare", // Determine if a Twitter user posted from the web, mobile device, or other app.
"text": "To effectively communicate, we must realize that we are all different", // Deprecated, use "post" field
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
{
"authorId": "1194338779881472",
"created": "2023-12-27T03:24:23.000Z",
"createdAt": "2023-12-27T03:24:23.000Z",
"editHistoryTweetIds": [
"17398682514485715"
],
"id": "17398682514485715",
"media": [ // available for videos and gifs
{
"nonPublicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback50Count": 4,
"playback25Count": 11,
"playback75Count": 2
},
"publicMetrics": {
"viewCount": 27
},
"durationMs": 28240,
"organicMetrics": {
"playback100Count": 2,
"playback0Count": 55,
"playback25Count": 11,
"playback75Count": 2,
"playback50Count": 4,
"viewCount": 27
},
"mediaKey": "7_1739849636389814272",
"previewImageUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1739849636389814272/pu/img/bCkAdkD0R00-ZlkY.jpg",
"width": 1920,
"type": "video",
"height": 1080,
"mediaUrls": [
{
"bitRate": 256000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/480x270/4RoZCqynednVMFgy.mp4?tag=12"
},
{
"bitRate": 832000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/640x360/RYy5iHTIxu7_iyZm.mp4?tag=12"
},
{
"bitRate": 2176000,
"contentType": "video/mp4",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/vid/avc1/1280x720/9UpR90ekFA-9Ucxo.mp4?tag=12"
},
{
"contentType": "application/x-mpegURL",
"mediaUrl": "https://video.twimg.com/ext_tw_video/1739849636389814272/pu/pl/0AVy2xIOLQcsrEZG.m3u8?tag=12&container=fmp4"
}
]
}
],
"nonPublicMetrics": {
"impressionCount": 54,
"userProfileClicks": 0
},
"organicMetrics": {
"userProfileClicks": 0,
"likeCount": 0,
"replyCount": 0,
"impressionCount": 54,
"retweetCount": 0
},
"possiblySensitive": false,
"post": "Family is the most important thing in the world. - Diana, Princess of Wales https://t.co/MgYxnJDer6",
"postUrl": "https://twitter.com/superme/status/17398682514485715",
"publicMetrics": {
"retweetCount": 0,
"replyCount": 0,
"likeCount": 0,
"quoteCount": 0,
"bookmarkCount": 0,
"impressionCount": 54
},
"urls": [ // Available for long Tweets only
{
"start": 866,
"end": 889,
"url": "https://t.co/3r6xz4hBnM",
"expandedUrl": "https://www.cnn.com",
"displayUrl": "cnn.com"
}
],
},
// YouTube Response Example
{
"created": "2022-08-15T19:14:44Z",
"description": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire", // Deprecated, use "post" field
"id": "Q-4OuHCALVa", // YouTube Social Post ID
"position": 0,
"post": "Doubt is not a pleasant condition, but certainty is absurd. - Voltaire",
"postUrl": "https://www.youtube.com/watch?v=Q-4OuHCALVa",
"privacyStatus": "public",
"license": "youtube", // "youtube" or "creativeCommon"
"embeddable": true, // whether the video can be embedded on external sites
"publicStatsViewable": true, // whether the extended stats panel is publicly viewable
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Q-4OuHCALVa/default.jpg",
"title": "Yo time"
},
{
"created": "2022-08-08T22:24:42Z",
"description": "Little author little, one travels far. - J.R.R. Tolkien", // Deprecated, use "post" field
"id": "Btg4ysKnHea", // YouTube Social Post ID
"position": 1,
"post": "Little author little, one travels far. - J.R.R. Tolkien",
"postUrl": "https://www.youtube.com/watch?v=Btg4ysKnHea",
"privacyStatus": "unlisted",
"license": "creativeCommon",
"embeddable": false,
"publicStatsViewable": false,
"published": "2025-05-07T16:27:12Z",
"thumbnailUrl": "https://i.ytimg.com/vi/Btg4ysKnHea/default.jpg",
"title": "Nice one 2"
}
],
"lastUpdated": "2022-11-14T16:04:51.994Z",
"nextUpdate": "2022-11-14T16:37:21.994Z",
"meta": {
"pagination": {
"hasMore": true, // More results available
"next": "eyJ0b2tlbiI6IjE3MzkyNjg1MTQ0ODU3MTUiLCJzb3VyY2UiOiJwdWJsaWMiLCJwbGF0Zm9ybSI6InR3aXR0ZXIifQ==", // Cursor for next page
"limit": 10 // Requested page size
}
}
}
{
"status": "error",
"code": 196,
"message": "Instagram is not connected"
}
{
// When some of the data is not available from the social networks.
// All available data is still returned
"status": "error",
"posts": [
{... valid data },
{
"action": "analytics",
"code": 187,
"commentsCount": 0,
"created": "2019-03-22T13:31:02Z",
"createdTime": "2019-03-22T13:31:02+0000",
"from": {
"name": "Ayrshare",
"id": "746346376697"
},
"fullPicture": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/",
"id": "746346376697_3993223", // Facebook Social Post ID
"isPopular": false,
"likeCount": 2,
"mediaUrls": [
{
"description": "Dirk Cotton's approach to retirement planning.",
"media": {
"image": {
"height": 720,
"src": "https://external.fphl1-1.fna.fbcdn.net/emg1/v/t13/608115669879219",
"width": 720
}
},
"mediaType": "link",
"title": "The Retirement Planning Regime",
"url": "https://bit.ly/2RwaH"
}
],
"message": "Error getting analytics.",
"post": "Error getting analytics.",
"status": "error",
"statusType": "shared_story"
},
{... valid data }
]
}
⌘I
