> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Get All Your Posts via the API | Ayrshare Docs

> Learn how to retrieve all your published and scheduled social media posts with the Ayrshare API, including history, status, and analytics for each post.

This guide explains how to retrieve all posts associated with your account
through different approaches, whether they originated from Ayrshare or other
sources.

## Getting All Posts for All User Profiles (Ayrshare origin)

1. Get all user profiles associated with the primary profile:

   * Use your [Authorization Bearer](/apis/overview#authorization) token in the header
   * Call the [Get User Profiles](/apis/profiles/get-profiles) endpoint

2. Get profile keys:

   * Extract the `refId` from each user profile
   * Use your internal store to create a list of associated user profile keys

3. Retrieve posts:
   * Use the [Posts History](/apis/history/get-history) endpoint
   * Get all posts associated with each user profile key

## Getting Posts for a Particular Social Network for All Users (Ayrshare and non-Ayrshare origin)

1. Get all user profiles associated with the primary profile:

   * Use your [Authorization Bearer](/apis/overview#authorization) token in the header
   * Call the [Get User Profiles](/apis/profiles/get-profiles) endpoint

2. Get profile keys:

   * Extract the `refId` from each user profile
   * Use your internal store to create a list of associated user profile keys

3. Retrieve posts specific to a social network
   * Use the [Posts History for a Platform](/apis/history/history-platform)
     endpoint
   * Place a platform in the `platform` path parameter. Values: `facebook`,
     `instagram`, `linkedin`, `pinterest`, `snapchat`, `threads`, `tiktok`, `twitter`, `youtube`
   * Get all platform posts associated with each user profile key
